1 /* editMode.h 2 Enables the editing of a given map. 3 4 Copyright (C) 2000 Mathias Broxvall 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2 of the License, or 9 (at your option) any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program; if not, write to the Free Software 18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 */ 20 21 #ifndef EDITMODE_H 22 #define EDITMODE_H 23 24 #include "gameMode.h" 25 26 class Game; 27 class Map; 28 class EMenuWindow; 29 class EStatusWindow; 30 class EQuitWindow; 31 class ESaveWindow; 32 class ECloseWindow; 33 class EOpenWindow; 34 class ENewWindow; 35 class ESubWindow; 36 37 class EditMode : public GameMode { 38 public: 39 EditMode(); 40 virtual ~EditMode(); 41 42 static EditMode *init(); 43 static void cleanup(); 44 static void loadStrings(); 45 static EditMode *editMode; 46 47 void loadMap(char *mapname); 48 void closeMap(); 49 void saveMap(); 50 51 void drawMenus(); 52 void drawInfo(); 53 54 void display(); 55 void key(int); 56 void tick(Real td); 57 void mouseDown(int state, int x, int y); 58 59 void activated(); 60 void deactivated(); 61 void resizeWindows(); 62 void closeAllDialogWindows(); 63 void askNew(); 64 void askQuit(); 65 void askSave(); 66 void askClose(); 67 void askOpen(); 68 void testLevel(); 69 void copyRegion(); 70 void pasteRegion(); 71 72 Game *game; 73 Map *map; 74 75 char levelname[256]; 76 char pathname[256]; 77 double time; 78 79 protected: 80 private: 81 void doCommand(int); 82 void doCellAction(int, int); 83 void makeHill(int radius); 84 void doSmooth(int radius); 85 86 int x, y; 87 int mapIsWritable; 88 89 double scale; /* This is the increment with which we modify heights etc. or scale textures */ 90 double rotation; /* Only for textures */ 91 Real raise; 92 Color color; 93 int menuChoise; 94 int doSave; 95 int hill; 96 int currentEditMode, currentFeature; 97 98 EMenuWindow *menuWindow; 99 EStatusWindow *statusWindow; 100 EQuitWindow *quitWindow; 101 ESaveWindow *saveWindow; 102 ECloseWindow *closeWindow; 103 EOpenWindow *openWindow; 104 ENewWindow *newWindow; 105 friend class EMenuWindow; 106 friend class ESubWindow; 107 friend class EStatusWindow; 108 109 class Cell *cellClipboard; 110 int cellClipboardWidth, cellClipboardHeight; 111 }; 112 113 #endif 114