00001 00011 #ifndef ISO_SCROLLER_H 00012 #define ISO_SCROLLER_H 00013 00014 #include "IsoTilePlotter.h" 00015 00017 typedef enum { 00018 SWM_NONE, 00019 SWM_CLIP, 00021 SWM_WRAP 00022 } SCROLLERWRAPMODE; 00023 00034 class IsoScroller { 00035 public: 00037 00038 IsoScroller(); 00039 ~IsoScroller(); 00040 00042 00043 00044 00046 00048 RECT* getScreenSpace(); 00050 int getScreenSpaceWidth(); 00052 int getScreenSpaceHeight(); 00054 void setScreenSpace(RECT* newScreenSpace); 00062 void adjustScreenSpace(int leftAdjust, int topAdjust, int rightAdjust, int bottomAdjust); 00063 00065 00066 00067 00069 00071 RECT* getWorldSpace(); 00073 int getWorldSpaceWidth(); 00075 int getWorldSpaceHeight(); 00077 void setWorldSpace(RECT* newWorldSpace); 00085 void adjustWorldSpace(int leftAdjust, int topAdjust, int rightAdjust, int bottomAdjust); 00090 void calcWorldSpace(IsoTilePlotter* tilePlotter, RECT* extent, int mapWidth, int mapHeight); 00091 00093 00094 00095 00097 00099 RECT* getAnchorSpace(); 00101 int getAnchorSpaceWidth(); 00103 int getAnchorSpaceHeight(); 00105 void setAnchorSpace(RECT* newAnchorSpace); 00113 void adjustAnchorSpace(int leftAdjust, int topAdjust, int rightAdjust, int bottomAdjust); 00115 void calcAnchorSpace(); 00116 00118 00119 00120 00122 00124 POINT* getAnchor(); 00126 void setAnchor(POINT* newAnchor, bool wrap = true); 00128 void moveAnchor(int xAdjust, int yAdjust, bool wrap = true); 00130 void wrapAnchor(); 00131 00133 00134 00135 00137 00139 POINT ScreenToWorld(POINT screenCoords); 00141 POINT WorldToScreen(POINT worldCoords); 00142 00144 00145 00146 00148 00150 SCROLLERWRAPMODE getHWrapMode(); 00152 SCROLLERWRAPMODE getVWrapMode(); 00153 00155 void setHWrapMode(SCROLLERWRAPMODE newWrapMode); 00157 void setVWrapMode(SCROLLERWRAPMODE newWrapMode); 00159 00160 00161 00163 00165 bool isWorldCoord(POINT coord); 00167 bool isScreenCoord(POINT coord); 00169 bool isAnchorCoord(POINT coord); 00170 00172 00173 private: 00175 RECT screenSpace; 00177 RECT worldSpace; 00179 RECT anchorSpace; 00180 00182 POINT screenAnchor; 00183 00185 SCROLLERWRAPMODE swmHorizontal; 00187 SCROLLERWRAPMODE swmVertical; 00188 }; 00189 00190 #endif//ISO_SCROLLER_H