_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
editor.h
Go to the documentation of this file.
1 // _________ __ __
2 // / _____// |_____________ _/ |______ ____ __ __ ______
3 // \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
4 // / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
5 // /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
6 // \/ \/ \//_____/ \/
7 // ______________________ ______________________
8 // T H E W A R B E G I N S
9 // Stratagus - A free fantasy real time strategy game engine
10 //
12 //
13 // (c) Copyright 2002-2006 by Lutz Sammer
14 //
15 // This program is free software; you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation; only version 2 of the License.
18 //
19 // This program is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU General Public License for more details.
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program; if not, write to the Free Software
26 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 // 02111-1307, USA.
28 //
29 
30 #ifndef __EDITOR_H__
31 #define __EDITOR_H__
32 
34 
35 #include <vector>
36 #include <string>
37 #include "icons.h"
38 #ifndef __VEC2I_H__
39 #include "vec2i.h"
40 #endif
41 /*----------------------------------------------------------------------------
42 -- Declarations
43 ----------------------------------------------------------------------------*/
44 
45 class CUnitType;
46 
47 
53 };
54 
60 };
61 
62 class CEditor
63 {
64 public:
65  CEditor();
66  ~CEditor() {}
67 
68  void Init();
70  void CreateRandomMap() const;
71 
72 
73  std::vector<std::string> UnitTypes;
74  std::vector<const CUnitType *> ShownUnitTypes;
75  std::vector<unsigned int> ShownTileTypes;
76 
80  std::string StartUnitName;
82 
83  int UnitIndex;
86 
87  int TileIndex;
90 
93 
94  bool MapLoaded;
96 
98 
100 
101  int PopUpX;
102  int PopUpY;
103 
104 };
105 
106 /*----------------------------------------------------------------------------
107 -- Variables
108 ----------------------------------------------------------------------------*/
109 
110 extern CEditor Editor;
111 
112 extern char TileToolRandom;
113 
114 /*----------------------------------------------------------------------------
115 -- Functions
116 ----------------------------------------------------------------------------*/
117 
119 extern void StartEditor(const char *filename);
120 
122 extern void EditorMainLoop();
124 extern void EditorUpdateDisplay();
125 
127 extern int EditorSaveMap(const std::string &file);
128 
130 extern void EditorCclRegister();
131 
133 extern void EditorTileChanged(const Vec2i &pos);
134 
135 extern void EditorChangeTile(const Vec2i &pos, int tileIndex, int d);
136 
138 
139 #endif // !__EDITOR_H__
void EditorMainLoop()
Editor main event loop.
Definition: editloop.cpp:1928
int SelectedPlayer
Player under the cursor.
Definition: editor.h:92
void Init()
Definition: editloop.cpp:1803
Icon reference (used in config tables)
Definition: icons.h:139
int UnitIndex
Unit used to display the start location.
Definition: editor.h:83
char TileToolRandom
Definition: editloop.cpp:94
int CursorUnitIndex
Unit icon draw index.
Definition: editor.h:84
CEditor Editor
Definition: script_editor.cpp:44
std::vector< const CUnitType * > ShownUnitTypes
Sorted editor unit-type table.
Definition: editor.h:74
int SelectedTileIndex
tile icon under cursor.
Definition: editor.h:89
int CursorTileIndex
tile icon draw index.
Definition: editor.h:88
Not Running.
Definition: editor.h:50
void CreateRandomMap() const
Make random map.
Definition: edmap.cpp:359
const CUnitType * StartUnit
name of the Unit used to display the start location.
Definition: editor.h:81
std::vector< std::string > UnitTypes
Definition: editor.h:73
Definition: editor.h:49
void StartEditor(const char *filename)
Start the editor.
Definition: editloop.cpp:2049
bool MapLoaded
Player selected for draw.
Definition: editor.h:94
Edit tiles.
Definition: editor.h:58
Edit units.
Definition: editor.h:59
CEditor()
Definition: editor.cpp:76
void EditorUpdateDisplay()
Update editor display.
Definition: editloop.cpp:1030
Select.
Definition: editor.h:57
int PopUpY
Definition: editor.h:102
Definition: unittype.h:467
int CursorPlayer
tile type to draw.
Definition: editor.h:91
Editor Enabled at all.
Definition: editor.h:51
std::string StartUnitName
Editor's units icon.
Definition: editor.h:80
int SelectedUnitIndex
Unit icon under cursor.
Definition: editor.h:85
int PopUpX
Current editor state.
Definition: editor.h:101
int TileIndex
Unit type to draw.
Definition: editor.h:87
int EditorSaveMap(const std::string &file)
Save a map from editor.
Definition: editloop.cpp:1910
EditorStateType
Definition: editor.h:55
Called from Command Line.
Definition: editor.h:52
Definition: editor.h:56
EditorRunningType Running
Use compression when saving.
Definition: editor.h:97
Definition: editor.h:62
bool TerrainEditable
Shown editor tile-type table.
Definition: editor.h:77
IconConfig Units
Editor's select icon.
Definition: editor.h:79
Definition: vec2i.h:36
std::vector< unsigned int > ShownTileTypes
Shown editor unit-type table.
Definition: editor.h:75
EditorRunningType
Definition: editor.h:48
void EditorChangeTile(const Vec2i &pos, int tileIndex, int d)
Definition: edmap.cpp:97
EditorStateType State
Editor is running.
Definition: editor.h:99
void EditorTileChanged(const Vec2i &pos)
Update surroundings for tile changes.
Definition: edmap.cpp:207
~CEditor()
Definition: editor.h:66
IconConfig Select
Is the terrain editable ?
Definition: editor.h:78
bool WriteCompressedMaps
Map loaded in editor.
Definition: editor.h:95
void EditorCclRegister()
Register ccl features.
Definition: script_editor.cpp:89
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.