00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef ISOMATH_INCLUDED
00030 #define ISOMATH_INCLUDED
00031
00032 #include "gldebug.h"
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085 #include "gltypes.h"
00086 #include "glfixed.h"
00087
00088
00114 class GlIsoMath
00115 {
00116 public:
00119 static void TileToScreen( GlFixed tileX, GlFixed tileY, GlFixed tileZ,
00120 int tileWidth, int tileHeight,
00121 int screenOffsetX, int screenOffsetY,
00122 GlFixed* screenX, GlFixed* screenY );
00123
00127 static void ScreenToFlatTile( GlFixed screenX, GlFixed screenY, GlFixed tileZ,
00128 int tileWidth, int tileHeight,
00129 int screenOffsetX, int screenOffsetY,
00130 GlFixed* tileX, GlFixed* tileY );
00131
00135 static void TileToWorld( GlFixed tileX, GlFixed tileY, GlFixed tileZ,
00136 GlFixed* worldX, GlFixed* worldY, GlFixed* worldZ );
00137
00138
00139
00140
00141
00142
00143
00144
00148 GlIsoMath( int tileWidth, int tileHeight );
00149
00153 void SetScreenBaseToOrigin( int screenW, int screenH );
00154
00156 void SetScreenCenterToTile( int screenW, int screenH,
00157 int tileX, int tileY, int tileZ );
00158
00160 void SetScreenToTile( int screenX, int screenY,
00161 int tileX, int tileY, int tileZ );
00162
00164 void TileToScreen( GlFixed tileX, GlFixed tileY, GlFixed tileZ,
00165 int* screenX, int* screenY ) const;
00166
00170 void ScreenToFlatTile( int screenX, int screenY, GlFixed tileZ,
00171 GlFixed* tileX, GlFixed* tileY ) const;
00172
00173 private:
00174 int tileWidth, tileHeight;
00175 int screenOffsetX, screenOffsetY;
00176 };
00177
00178 #endif