]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Game.h
Added a instruction file for compilation.
[lugaru.git] / Source / Game.h
index 19604e1d5047931b3aeecb09407d358aab8d9e40..431f3243e8f6622931416b17dae35a07ec4ba76b 100644 (file)
@@ -68,6 +68,7 @@ struct TextureInfo;
 class CampaignLevel
 {
 private:
+       int width;
        struct Position
        {
                int x;
@@ -86,12 +87,39 @@ public:
        std::vector<int> nextlevel;
        Position location;
        
-       CampaignLevel() {
+       CampaignLevel() : width(10) {
                choosenext = 1;
                location.x = 0;
                location.y = 0;
        }
        
+       int getStartX() {
+               return 30+120+location.x*400/512;
+       }
+       
+       int getStartY() {
+               return 30+30+(512-location.y)*400/512;
+       }
+       
+       int getEndX() {
+               return getStartX()+width;
+       }
+       
+       int getEndY() {
+               return getStartY()+width;
+       }
+       
+       XYZ getCenter() {
+               XYZ center;
+               center.x=getStartX()+width/2;
+               center.y=getStartY()+width/2;
+               return center;
+       }
+       
+       int getWidth() {
+               return width;
+       }
+       
        istream& operator<< (istream& is) {
                is.ignore(256,':');
                is.ignore(256,':');
@@ -148,8 +176,6 @@ class Game
                int endx[100];
                int endy[100];
                float selectedlong[100];
-               float offsetx[100];
-               float offsety[100];
                int selected;
                int keyselect;
                int indemo;