____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
A futuristic real-time strategy game.
This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project.
Distributed under the "GNU General Public License"
#include "stratagus.h"
#include <sstream>
#include "sound.h"
#include "iolib.h"
#include "network.h"
#include "interface.h"
#include "cursor.h"
#include "map.h"
#include "guichan.h"
#include "patch_type.h"
#include "patch.h"
#include "patch_manager.h"
#include "ui.h"
#include "font.h"
Go to the source code of this file.
Definition in file patch_editor.cpp.
| #define NumSpeeds 7 |
| enum PatchButton |
| ButtonNone | |
| ButtonImpassable | |
| ButtonWater | |
| ButtonSpeed0 | |
| ButtonSpeed1 | |
| ButtonSpeed2 | |
| ButtonSpeed3 | |
| ButtonSpeed4 | |
| ButtonSpeed5 | |
| ButtonSpeed6 | |
| ButtonSpeed7 | |
| ButtonTransparent |
Definition at line 73 of file patch_editor.cpp.
| static void DoScroll | ( | ) | [static] |
Definition at line 108 of file patch_editor.cpp.
References CPatchType::getGraphic(), GetTicks(), CPatch::getType(), CVideo::Height, CGraphic::Height, KeyScrollState, MouseScrollState, PatchMenuWidth, ScrollDown, ScrollLeft, ScrollNone, ScrollRight, ScrollUp, ScrollX, ScrollY, Video, CVideo::Width, and CGraphic::Width.
Referenced by PatchEditorMainLoop().
| static void DrawCoordinates | ( | ) | [static] |
Definition at line 397 of file patch_editor.cpp.
References GameFont, CVideo::Height, MouseOverTileX, MouseOverTileY, PatchMenuWidth, Video, VideoDrawTextCentered(), and CVideo::Width.
Referenced by PatchEditorUpdateDisplay().
| static void DrawGrids | ( | ) | [static] |
Definition at line 362 of file patch_editor.cpp.
References ColorBlack, CVideo::DrawHLineClip(), CVideo::DrawVLineClip(), CPatchType::getTileHeight(), CPatchType::getTileWidth(), CPatch::getType(), ScrollX, ScrollY, TileSizeX, TileSizeY, and Video.
Referenced by PatchEditorUpdateDisplay().
| void DrawGuichanWidgets | ( | ) |
Definition at line 160 of file widgets.cpp.
| static void DrawIcons | ( | ) | [static] |
Definition at line 376 of file patch_editor.cpp.
References ColorBlack, ColorBlue, ColorGreen, CurrentButton, CVideo::DrawRectangleClip(), MouseOverButton, PatchIcons, and Video.
Referenced by PatchEditorUpdateDisplay().
| static void DrawPatch | ( | ) | [static] |
Definition at line 323 of file patch_editor.cpp.
References CGraphic::DrawClip(), CPatchType::getGraphic(), CPatch::getType(), ScrollX, and ScrollY.
Referenced by PatchEditorUpdateDisplay().
| static void DrawPatchTileIcons | ( | ) | [static] |
Definition at line 329 of file patch_editor.cpp.
References CGraphic::DrawClip(), CPatchType::getFlag(), CPatchType::getTileHeight(), CPatchType::getTileWidth(), CPatch::getType(), int(), MapFieldSpeedMask, MapFieldTransparent, MapFieldUnpassable, MapFieldWaterAllowed, ScrollX, ScrollY, TileSizeX, TileSizeY, and y.
Referenced by PatchEditorUpdateDisplay().
| static void InitCallbacks | ( | EventCallback * | callbacks | ) | [static] |
Definition at line 465 of file patch_editor.cpp.
References _event_callback_::ButtonPressed, _event_callback_::ButtonReleased, _event_callback_::KeyPressed, _event_callback_::KeyReleased, _event_callback_::KeyRepeated, _event_callback_::MouseExit, _event_callback_::MouseMoved, NetworkEvent(), _event_callback_::NetworkEvent, PatchEditorCallbackButtonDown(), PatchEditorCallbackButtonUp(), PatchEditorCallbackExit(), PatchEditorCallbackKeyDown(), PatchEditorCallbackKeyRepeated(), PatchEditorCallbackKeyUp(), and PatchEditorCallbackMouse().
Referenced by PatchEditorMainLoop().
| static void PatchAddIcon | ( | int | x, | |
| int | y, | |||
| CGraphic * | g, | |||
| PatchButton | b | |||
| ) | [static] |
Definition at line 536 of file patch_editor.cpp.
References PatchIcon::Button, PatchIcon::G, PatchIcons, PatchIcon::X, and PatchIcon::Y.
Referenced by PatchLoadIcons().
| static void PatchEditorCallbackButtonDown | ( | unsigned | button | ) | [static] |
Definition at line 152 of file patch_editor.cpp.
References ButtonNone, ButtonSpeed0, ButtonSpeed7, CurrentButton, DraggingFlag, FlagMap, CPatchType::getFlag(), CPatch::getType(), LeftButton, MapFieldSpeedMask, MouseOverButton, MouseOverTileX, MouseOverTileY, CPatchType::setFlag(), and SetFlagWhileDragging.
Referenced by InitCallbacks().
| static void PatchEditorCallbackButtonUp | ( | unsigned | button | ) | [static] |
Definition at line 181 of file patch_editor.cpp.
References DraggingFlag.
Referenced by InitCallbacks().
| static void PatchEditorCallbackExit | ( | void | ) | [static] |
| static void PatchEditorCallbackKeyDown | ( | unsigned | key, | |
| unsigned | keychar | |||
| ) | [static] |
Definition at line 186 of file patch_editor.cpp.
References Exit(), HandleCommandKey(), HandleKeyModifiersDown(), KeyModifiers, KeyScrollState, ModifierAlt, ModifierControl, ScrollDown, ScrollLeft, ScrollRight, ScrollUp, and ToggleFullScreen().
Referenced by InitCallbacks().
| static void PatchEditorCallbackKeyRepeated | ( | unsigned | dummy1, | |
| unsigned | dummy2 | |||
| ) | [static] |
| static void PatchEditorCallbackKeyUp | ( | unsigned | key, | |
| unsigned | keychar | |||
| ) | [static] |
Definition at line 229 of file patch_editor.cpp.
References HandleKeyModifiersUp(), KeyScrollState, ScrollDown, ScrollLeft, ScrollRight, and ScrollUp.
Referenced by InitCallbacks().
| static void PatchEditorCallbackMouse | ( | int | x, | |
| int | y | |||
| ) | [static] |
Definition at line 261 of file patch_editor.cpp.
References ButtonNone, ButtonSpeed0, ButtonSpeed7, CurrentButton, CursorConfig::Cursor, DraggingFlag, FlagMap, GameCursor, CPatchType::getFlag(), CPatchType::getTileHeight(), CPatch::getType(), HandleCursorMove(), HandleMouseScrollArea(), CVideo::Height, int(), MapFieldSpeedMask, MouseOverButton, MouseOverTileX, MouseOverTileY, PatchIcons, PatchMenuWidth, CUserInterface::Point, ScrollX, ScrollY, CPatchType::setFlag(), SetFlagWhileDragging, TileSizeX, TileSizeY, UI, Video, and CVideo::Width.
Referenced by InitCallbacks().
| static void PatchEditorMainLoop | ( | ) | [static] |
Definition at line 477 of file patch_editor.cpp.
References _, gcn::Container::add(), gcn::Widget::addActionListener(), ButtonImpassable, ButtonNone, CheckMusicFinished(), CurrentButton, DoScroll(), GetCallbacks(), gcn::Widget::getHeight(), gcn::Gui::getTop(), gcn::Widget::getWidth(), CVideo::Height, InitCallbacks(), CPatchManager::load(), Map, MouseOverButton, PatchEditorRunning, PatchEditorUpdateDisplay(), CMap::PatchManager, PatchMenuWidth, PatchNewButton(), ScrollX, ScrollY, SetCallbacks(), gcn::Widget::setDimension(), gcn::Container::setOpaque(), gcn::Gui::setTop(), Video, WaitEventsOneFrame(), and CVideo::Width.
Referenced by StartPatchEditor().
| static void PatchEditorUpdateDisplay | ( | ) | [static] |
Definition at line 408 of file patch_editor.cpp.
References ColorGray, DrawCoordinates(), DrawCursor(), DrawGrids(), DrawGuichanWidgets(), DrawIcons(), DrawPatch(), DrawPatchTileIcons(), CVideo::FillRectangle(), CVideo::Height, Invalidate(), PatchMenuWidth, RealizeVideoMemory(), Video, and CVideo::Width.
Referenced by PatchEditorMainLoop().
| static void PatchFreeIcons | ( | ) | [static] |
Definition at line 590 of file patch_editor.cpp.
References FlagMap, CGraphic::Free(), and PatchIcons.
Referenced by StartPatchEditor().
| static void PatchLoadIcons | ( | ) | [static] |
Definition at line 546 of file patch_editor.cpp.
References ButtonImpassable, ButtonSpeed0, ButtonTransparent, ButtonWater, FlagMap, CGraphic::Load(), MapFieldTransparent, MapFieldUnpassable, MapFieldWaterAllowed, CGraphic::New(), NumSpeeds, PatchAddIcon(), PatchMenuWidth, Video, and CVideo::Width.
Referenced by StartPatchEditor().
| static gcn::Button* PatchNewButton | ( | const std::string & | caption | ) | [static] |
Definition at line 428 of file patch_editor.cpp.
References gcn::Widget::setBackgroundColor(), gcn::Widget::setBaseColor(), and gcn::Widget::setSize().
Referenced by PatchEditorMainLoop().
| void StartPatchEditor | ( | const std::string & | patchName | ) |
Definition at line 606 of file patch_editor.cpp.
References CPatchManager::add(), CPatchManager::clear(), CPatchType::getFile(), CPatchType::getFlags(), CPatchManager::getPatchType(), CPatchType::getTileHeight(), CPatchType::getTileWidth(), Map, CPatchManager::newPatchType(), PatchEditorMainLoop(), PatchFreeIcons(), PatchLoadIcons(), and CMap::PatchManager.
Referenced by tolua_stratagus_StartPatchEditor00().
PatchButton CurrentButton [static] |
Definition at line 99 of file patch_editor.cpp.
Referenced by DrawIcons(), PatchEditorCallbackButtonDown(), PatchEditorCallbackMouse(), and PatchEditorMainLoop().
bool DraggingFlag [static] |
Definition at line 104 of file patch_editor.cpp.
Referenced by PatchEditorCallbackButtonDown(), PatchEditorCallbackButtonUp(), and PatchEditorCallbackMouse().
std::map<int, unsigned short> FlagMap [static] |
Definition at line 98 of file patch_editor.cpp.
Referenced by PatchEditorCallbackButtonDown(), PatchEditorCallbackMouse(), PatchFreeIcons(), and PatchLoadIcons().
CGraphic* ImpassableG [static] |
Definition at line 65 of file patch_editor.cpp.
CGraphic* ImpassableSmallG [static] |
Definition at line 66 of file patch_editor.cpp.
PatchButton MouseOverButton [static] |
Definition at line 100 of file patch_editor.cpp.
Referenced by DrawIcons(), PatchEditorCallbackButtonDown(), PatchEditorCallbackMouse(), and PatchEditorMainLoop().
int MouseOverTileX [static] |
Definition at line 101 of file patch_editor.cpp.
Referenced by DrawCoordinates(), PatchEditorCallbackButtonDown(), and PatchEditorCallbackMouse().
int MouseOverTileY [static] |
Definition at line 102 of file patch_editor.cpp.
Referenced by DrawCoordinates(), PatchEditorCallbackButtonDown(), and PatchEditorCallbackMouse().
Definition at line 56 of file patch_editor.cpp.
gcn::Container* PatchEditorContainer [static] |
Definition at line 54 of file patch_editor.cpp.
| bool PatchEditorRunning |
Definition at line 51 of file patch_editor.cpp.
Referenced by PatchExitButtonListener::action(), DrawCursor(), DrawGuichanWidgets(), HideCursor(), PatchEditorMainLoop(), and WaitEventsOneFrame().
std::vector<PatchIcon> PatchIcons [static] |
Definition at line 96 of file patch_editor.cpp.
Referenced by DrawIcons(), PatchAddIcon(), PatchEditorCallbackMouse(), and PatchFreeIcons().
const int PatchMenuWidth = 150 [static] |
Definition at line 58 of file patch_editor.cpp.
Referenced by DoScroll(), DrawCoordinates(), PatchEditorCallbackMouse(), PatchEditorMainLoop(), PatchEditorUpdateDisplay(), and PatchLoadIcons().
float ScrollX [static] |
Definition at line 60 of file patch_editor.cpp.
Referenced by DoScroll(), DrawGrids(), DrawPatch(), DrawPatchTileIcons(), PatchEditorCallbackMouse(), and PatchEditorMainLoop().
float ScrollY [static] |
Definition at line 61 of file patch_editor.cpp.
Referenced by DoScroll(), DrawGrids(), DrawPatch(), DrawPatchTileIcons(), PatchEditorCallbackMouse(), and PatchEditorMainLoop().
bool SetFlagWhileDragging [static] |
Definition at line 105 of file patch_editor.cpp.
Referenced by PatchEditorCallbackButtonDown(), and PatchEditorCallbackMouse().
Definition at line 70 of file patch_editor.cpp.
CGraphic* SpeedSmallG[NumSpeeds+1] [static] |
Definition at line 71 of file patch_editor.cpp.
CGraphic* TransparentG [static] |
Definition at line 63 of file patch_editor.cpp.
CGraphic* TransparentSmallG [static] |
Definition at line 64 of file patch_editor.cpp.
Definition at line 67 of file patch_editor.cpp.
CGraphic* WaterSmallG [static] |
Definition at line 68 of file patch_editor.cpp.
1.5.6