$treeview $search $mathjax
Stratagus
2.2.7
$projectbrief
|
$projectbrief
|
$searchbox |
_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include <deque>
#include "stratagus.h"
#include "editor.h"
#include "commands.h"
#include "font.h"
#include "game.h"
#include "guichan.h"
#include "interface.h"
#include "iocompat.h"
#include "iolib.h"
#include "map.h"
#include "menus.h"
#include "minimap.h"
#include "network.h"
#include "replay.h"
#include "script.h"
#include "settings.h"
#include "sound.h"
#include "sound_server.h"
#include "tileset.h"
#include "translate.h"
#include "ui.h"
#include "unit_find.h"
#include "unittype.h"
#include "video.h"
#include "widgets.h"
Classes | |
struct | EditorAction |
class | EditorUnitSliderListener |
class | EditorSliderListener |
editloop.cpp - The editor main loop. | |
#define | UNIT_ICON_X (IconWidth + 7) |
#define | UNIT_ICON_Y (0) |
#define | TILE_ICON_X (IconWidth * 2 + 16) |
#define | TILE_ICON_Y (2) |
#define | START_ICON_X (IconWidth * 3 + 16) |
#define | START_ICON_Y (2) |
enum | _mode_buttons_ { SelectButton = 201, UnitButton, TileButton, StartButton } |
enum | EditorActionType { EditorActionTypePlaceUnit, EditorActionTypeRemoveUnit } |
static int | IconWidth |
static int | IconHeight |
Icon width in panels. | |
static int | ButtonPanelWidth |
Icon height in panels. | |
static int | ButtonPanelHeight |
static char | TileToolRandom |
static char | TileToolDecoration |
Tile tool draws random. | |
static int | TileCursorSize |
Tile tool draws with decorations. | |
static bool | UnitPlacedThisPress = false |
Tile cursor size 1x1 2x2 ... 4x4. | |
static bool | UpdateMinimap = false |
Only allow one unit per press. | |
static int | MirrorEdit = 0 |
Update units on the minimap. | |
static int | VisibleUnitIcons |
Mirror editing enabled. | |
static int | VisibleTileIcons |
Number of icons that are visible at a time. | |
static std::deque< EditorAction > | EditorUndoActions |
static std::deque< EditorAction > | EditorRedoActions |
gcn::Gui * | Gui |
static gcn::Container * | editorContainer |
static gcn::Slider * | editorUnitSlider |
static gcn::Slider * | editorSlider |
static EditorUnitSliderListener * | editorUnitSliderListener |
static EditorSliderListener * | editorSliderListener |
void | DoScrollArea (int state, bool fast) |
Editor callbacks. | |
void | DrawGuichanWidgets () |
void | CleanGame () |
static void | EditorUndoAction () |
static void | EditorRedoAction () |
static void | EditorAddUndoAction (EditorAction action) |
static int | GetTileNumber (int basic, int random, int filler) |
void | EditTile (const Vec2i &pos, int tile) |
static void | EditTilesInternal (const Vec2i &pos, int tile, int size) |
void | EditTiles (const Vec2i &pos, int tile, int size) |
static void | EditorActionPlaceUnit (const Vec2i &pos, const CUnitType &type, CPlayer *player) |
static void | EditorPlaceUnit (const Vec2i &pos, CUnitType &type, CPlayer *player) |
static void | EditorActionRemoveUnit (CUnit &unit) |
static void | EditorRemoveUnit (CUnit &unit) |
static int | CalculateVisibleIcons (bool tiles=false) |
static void | CalculateMaxIconSize () |
static void | RecalculateShownUnits () |
static void | DrawPlayers () |
static void | DrawUnitIcons () |
static void | DrawTileIcon (unsigned tilenum, unsigned x, unsigned y, unsigned flags) |
static void | DrawTileIcons () |
static void | DrawEditorPanel_SelectIcon () |
static void | DrawEditorPanel_UnitsIcon () |
static void | DrawEditorPanel_StartIcon () |
static void | DrawEditorPanel () |
static void | DrawMapCursor () |
static void | DrawStartLocations () |
static void | DrawEditorInfo () |
static void | ShowUnitInfo (const CUnit &unit) |
void | EditorUpdateDisplay () |
Update editor display. | |
static void | EditorCallbackButtonUp (unsigned button) |
static void | EditorCallbackButtonDown (unsigned button) |
static void | EditorCallbackKeyDown (unsigned key, unsigned keychar) |
static void | EditorCallbackKeyUp (unsigned key, unsigned keychar) |
static void | EditorCallbackKeyRepeated (unsigned key, unsigned) |
static void | EditorCallbackMouse (const PixelPos &pos) |
static void | EditorCallbackExit () |
static void | CreateTileIcons () |
static void | CleanTileIcons () |
int | EditorSaveMap (const std::string &file) |
Save a map from editor. | |
void | EditorMainLoop () |
Editor main event loop. | |
void | StartEditor (const char *filename) |
Start the editor. |
#define START_ICON_X (IconWidth * 3 + 16) |
#define START_ICON_Y (2) |
#define TILE_ICON_X (IconWidth * 2 + 16) |
#define TILE_ICON_Y (2) |
#define UNIT_ICON_X (IconWidth + 7) |
#define UNIT_ICON_Y (0) |
enum _mode_buttons_ |
enum EditorActionType |
static void CalculateMaxIconSize | ( | ) | [static] |
Calculate the max height and the max width of icons, and assign them to IconHeight and IconWidth
static int CalculateVisibleIcons | ( | bool | tiles = false |
) | [static] |
Calculate the number of icons that can be displayed
void CleanGame | ( | ) |
Cleanup game.
Call each module to clean up. Contrary to CleanModules, maps can be restarted without reloading all lua files.
static void CleanTileIcons | ( | ) | [static] |
Clean up the tile icons
static void CreateTileIcons | ( | ) | [static] |
Create the tile icons
void DoScrollArea | ( | int | state, | |
bool | fast | |||
) |
static void DrawEditorInfo | ( | ) | [static] |
Draw editor info.
If cursor is on map or minimap show information about the current tile.
static void DrawEditorPanel | ( | ) | [static] |
Draw the editor panels.
static void DrawEditorPanel_SelectIcon | ( | ) | [static] |
static void DrawEditorPanel_StartIcon | ( | ) | [static] |
static void DrawEditorPanel_UnitsIcon | ( | ) | [static] |
void DrawGuichanWidgets | ( | ) |
static void DrawMapCursor | ( | ) | [static] |
static void DrawPlayers | ( | ) | [static] |
Draw a table with the players
static void DrawStartLocations | ( | ) | [static] |
Draw the start locations of all active players on the map
static void DrawTileIcon | ( | unsigned | tilenum, | |
unsigned | x, | |||
unsigned | y, | |||
unsigned | flags | |||
) | [static] |
Draw a tile icon
tilenum | Tile number to display | |
x | X display position | |
y | Y display position | |
flags | State of the icon (IconActive,IconClicked,...) |
static void DrawTileIcons | ( | ) | [static] |
Draw tile icons.
static void DrawUnitIcons | ( | ) | [static] |
Draw unit icons.
static void EditorActionRemoveUnit | ( | CUnit & | unit | ) | [static] |
Remove a unit
static void EditorAddUndoAction | ( | EditorAction | action | ) | [static] |
static void EditorCallbackButtonDown | ( | unsigned | button | ) | [static] |
Called if mouse button pressed down.
button | Mouse button number (0 left, 1 middle, 2 right) |
static void EditorCallbackButtonUp | ( | unsigned | button | ) | [static] |
Callback for input.
static void EditorCallbackExit | ( | ) | [static] |
Callback for exit.
static void EditorCallbackKeyDown | ( | unsigned | key, | |
unsigned | keychar | |||
) | [static] |
Handle key down.
key | Key scancode. | |
keychar | Character code. |
static void EditorCallbackKeyRepeated | ( | unsigned | key, | |
unsigned | ||||
) | [static] |
Callback for input.
static void EditorCallbackKeyUp | ( | unsigned | key, | |
unsigned | keychar | |||
) | [static] |
Handle key up.
key | Key scancode. | |
keychar | Character code. |
static void EditorCallbackMouse | ( | const PixelPos & | pos | ) | [static] |
Callback for input movement of the cursor.
x | Screen X position. | |
y | Screen Y position. |
void EditorMainLoop | ( | ) |
Editor main event loop.
Editor main event loop.
Edit unit.
pos | map tile coordinate. | |
type | Unit type to edit. | |
player | Player owning the unit. |
static void EditorRedoAction | ( | ) | [static] |
static void EditorRemoveUnit | ( | CUnit & | unit | ) | [static] |
Remove a unit
int EditorSaveMap | ( | const std::string & | file | ) |
Save a map from editor.
Save a map from editor.
file | Save the level to this file. |
static void EditorUndoAction | ( | ) | [static] |
void EditorUpdateDisplay | ( | ) |
Update editor display.
Update editor display.
void EditTile | ( | const Vec2i & | pos, | |
int | tile | |||
) |
Edit tile.
pos | map tile coordinate. | |
tile | Tile type to edit. |
void EditTiles | ( | const Vec2i & | pos, | |
int | tile, | |||
int | size | |||
) |
Edit tiles
pos | map tile coordinate. | |
tile | Tile type to edit. | |
size | Size of rectangle |
static void EditTilesInternal | ( | const Vec2i & | pos, | |
int | tile, | |||
int | size | |||
) | [static] |
Edit tiles (internal, used by EditTiles()).
pos | map tile coordinate. | |
tile | Tile type to edit. | |
size | Size of rectangle |
static int GetTileNumber | ( | int | basic, | |
int | random, | |||
int | filler | |||
) | [static] |
Get tile number.
basic | Basic tile number | |
random | Return random tile | |
filler | Get a decorated tile. |
static void RecalculateShownUnits | ( | ) | [static] |
Recalculate the shown units.
static void ShowUnitInfo | ( | const CUnit & | unit | ) | [static] |
Show info about unit.
unit | Unit pointer. |
void StartEditor | ( | const char * | filename | ) |
Start the editor.
Start the editor
filename | Map to load, NULL to create a new map |
int ButtonPanelHeight [static] |
int ButtonPanelWidth [static] |
Icon height in panels.
gcn::Container* editorContainer [static] |
std::deque<EditorAction> EditorRedoActions [static] |
gcn::Slider* editorSlider [static] |
EditorSliderListener* editorSliderListener [static] |
std::deque<EditorAction> EditorUndoActions [static] |
gcn::Slider* editorUnitSlider [static] |
int IconHeight [static] |
Icon width in panels.
int IconWidth [static] |
int MirrorEdit = 0 [static] |
Update units on the minimap.
int TileCursorSize [static] |
Tile tool draws with decorations.
char TileToolDecoration [static] |
Tile tool draws random.
char TileToolRandom [static] |
bool UnitPlacedThisPress = false [static] |
Tile cursor size 1x1 2x2 ... 4x4.
bool UpdateMinimap = false [static] |
Only allow one unit per press.
int VisibleTileIcons [static] |
Number of icons that are visible at a time.
int VisibleUnitIcons [static] |
Mirror editing enabled.