00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef __EDITOR_H__
00031 #define __EDITOR_H__
00032
00034
00035 #include <vector>
00036 #include <string>
00037 #include "icons.h"
00038 #ifndef __VEC2I_H__
00039 #include "vec2i.h"
00040 #endif
00041
00042
00043
00044
00045 class CUnitType;
00046
00047
00048 enum EditorRunningType {
00049 EditorNotRunning = 0,
00050 EditorStarted = 1,
00051 EditorCommandLine = 2,
00052 EditorEditing = 4
00053 };
00054
00055 enum EditorStateType {
00056 EditorSelecting,
00057 EditorEditTile,
00058 EditorEditUnit,
00059 EditorSetStartLocation
00060 };
00061
00062 class CEditor
00063 {
00064 public:
00065 CEditor();
00066 ~CEditor() {}
00067
00068 void Init();
00070 void CreateRandomMap() const;
00071
00072
00073 std::vector<std::string> UnitTypes;
00074 std::vector<const CUnitType *> ShownUnitTypes;
00075 std::vector<unsigned int> ShownTileTypes;
00076
00077 bool TerrainEditable;
00078 IconConfig Select;
00079 IconConfig Units;
00080 std::string StartUnitName;
00081 const CUnitType *StartUnit;
00082
00083 int UnitIndex;
00084 int CursorUnitIndex;
00085 int SelectedUnitIndex;
00086
00087 int TileIndex;
00088 int CursorTileIndex;
00089 int SelectedTileIndex;
00090
00091 int CursorPlayer;
00092 int SelectedPlayer;
00093
00094 bool MapLoaded;
00095 bool WriteCompressedMaps;
00096
00097 EditorRunningType Running;
00098
00099 EditorStateType State;
00100
00101 int PopUpX;
00102 int PopUpY;
00103
00104 };
00105
00106
00107
00108
00109
00110 extern CEditor Editor;
00111
00112
00113
00114
00115
00117 extern void StartEditor(const char *filename);
00118
00120 extern void EditorMainLoop();
00122 extern void EditorUpdateDisplay();
00123
00125 extern int EditorSaveMap(const std::string &file);
00126
00128 extern void EditorCclRegister();
00129
00131 extern void EditTile(const Vec2i &pos, int tile);
00133 extern void EditTiles(const Vec2i &pos, int tile, int size);
00134
00136 extern void ChangeTile(const Vec2i &pos, int tile);
00138 extern void EditorTileChanged(const Vec2i &pos);
00139
00140
00142
00143 #endif // !__EDITOR_H__