____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
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 <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "stratagus.h"
#include "video.h"
#include "map.h"
#include "font.h"
#include "sound.h"
#include "sound_server.h"
#include "unitsound.h"
#include "unittype.h"
#include "player.h"
#include "unit.h"
#include "cursor.h"
#include "minimap.h"
#include "actions.h"
#include "missile.h"
#include "interface.h"
#include "menus.h"
#include "network.h"
#include "ui.h"
#include "trigger.h"
#include "results.h"
#include "settings.h"
#include "replay.h"
#include "pathfinder.h"
#include "editor.h"
#include "script.h"
#include "particle.h"
#include <guichan.h>
Go to the source code of this file.
Functions | |
| void | DrawGuichanWidgets () |
| void | DoScrollArea (int state, bool fast) |
| void | DrawMapArea (void) |
| Draw the map area. | |
| void | UpdateDisplay (void) |
| Game display update. | |
| static void | InitGameCallbacks (void) |
| void | GameMainLoop (void) |
| Game main loop. | |
Variables | |
| int | KeyScrollState = ScrollNone |
| < variable set when we are scrolling via keyboard | |
| int | MouseScrollState = ScrollNone |
| current key state | |
| EventCallback | GameCallbacks |
| Game callbacks. | |
| EventCallback | EditorCallbacks |
| Editor callbacks. | |
Definition in file mainloop.cpp.
| void DoScrollArea | ( | int | state, | |
| bool | fast | |||
| ) |
Handle scrolling area.
| state | Scroll direction/state. | |
| fast | Flag scroll faster. |
Definition at line 100 of file mainloop.cpp.
References CursorX, CursorY, FRAMES_PER_SECOND, HandleMouseMove(), CViewport::MapHeight, CViewport::MapWidth, CViewport::MapX, CViewport::MapY, CViewport::OffsetX, CViewport::OffsetY, ScrollDown, ScrollLeft, ScrollNone, ScrollRight, ScrollUp, CUserInterface::SelectedViewport, CViewport::Set(), SkipFrames, TileSizeX, TileSizeY, UI, and VideoSyncSpeed.
Referenced by EditorMainLoop(), and GameMainLoop().
| void DrawGuichanWidgets | ( | ) |
Definition at line 160 of file widgets.cpp.
References gcn::Gui::draw(), Editor, GameRunning, PatchEditorRunning, CEditor::Running, gcn::Gui::setUseDirtyDrawing(), and UseOpenGL.
| void DrawMapArea | ( | void | ) |
Draw the map area.
Draw map area
Definition at line 162 of file mainloop.cpp.
References NoUnitP, CUserInterface::NumViewports, TileSizeX, TileSizeY, UI, UnitActionDie, and CUserInterface::Viewports.
Referenced by EditorUpdateDisplay(), and UpdateDisplay().
| void GameMainLoop | ( | void | ) |
Game main loop.
Game main loop.
Unit actions. Missile actions. Players (AI). Cyclic events (color cycle,...) Display update. Input/Network/Sound.
Definition at line 253 of file mainloop.cpp.
References Assert, CclCommand(), CheckMusicFinished(), CursorConfig::Cursor, CYCLES_PER_SECOND, DoScrollArea(), EndReplayLog(), CParticleManager::exit(), FastForwardCycle, FlagRevealMap, GameCursor, GameCycle, GamePaused, GameRunning, GetCallbacks(), GodMode, CParticleManager::init(), InitGameCallbacks(), KeyModifiers, KeyScrollState, CUserInterface::Minimap, MissileActions(), ModifierControl, MouseScrollState, MultiPlayerReplayEachCycle(), NetworkCommands(), NetworkInSync, NetworkQuit(), NetworkRecover(), NumPlayers, ParticleManager, PlayersEachCycle(), PlayersEachSecond(), CUserInterface::Point, RealizeVideoMemory(), ReplayRevealMap, RescueUnits(), SaveGameLoading, SetCallbacks(), SetVideoSync(), SinglePlayerReplayEachCycle(), SkipGameCycle, TriggersEachCycle(), UI, UnitActions(), CParticleManager::update(), CMinimap::Update(), UpdateDisplay(), UpdateMessages(), UpdateTimer(), and WaitEventsOneFrame().
Referenced by StartMap().
| static void InitGameCallbacks | ( | void | ) | [static] |
Definition at line 231 of file mainloop.cpp.
References _event_callback_::ButtonPressed, _event_callback_::ButtonReleased, HandleButtonDown(), HandleButtonUp(), HandleKeyDown(), HandleKeyRepeat(), HandleKeyUp(), HandleMouseExit(), HandleMouseMove(), _event_callback_::KeyPressed, _event_callback_::KeyReleased, _event_callback_::KeyRepeated, _event_callback_::MouseExit, _event_callback_::MouseMoved, NetworkEvent(), and _event_callback_::NetworkEvent.
Referenced by GameMainLoop().
| void UpdateDisplay | ( | void | ) |
Game display update.
Display update.
This functions updates everything on screen. The map, the gui, the cursors.
Definition at line 187 of file mainloop.cpp.
References BigMapMode, CUserInterface::ButtonPanel, CursorState, CursorStateRectangle, CStatusLine::Draw(), CButtonPanel::Draw(), CInfoPanel::Draw(), CMinimap::Draw(), DrawCosts(), CMinimap::DrawCursor(), DrawCursor(), DrawGuichanWidgets(), DrawMapArea(), DrawMenuButtonArea(), DrawMessages(), DrawPieMenu(), DrawResources(), DrawTimer(), Editor, EditorEditing, CUserInterface::Fillers, GameRunning, CUserInterface::InfoPanel, int(), Invalidate(), CViewport::MapX, CViewport::MapY, CUserInterface::Minimap, CEditor::Running, CUserInterface::SelectedViewport, CUserInterface::StatusLine, and UI.
Referenced by GameMainLoop(), and MenuScreen::run().
Editor callbacks.
Definition at line 85 of file mainloop.cpp.
Referenced by EditorMainLoop(), CEditor::Init(), and MenuScreen::stop().
| int KeyScrollState = ScrollNone |
< variable set when we are scrolling via keyboard
current scroll state of mouse
variable set when we are scrolling via mouse
Definition at line 79 of file mainloop.cpp.
Referenced by CommandKey(), DoScroll(), EditorCallbackKeyDown(), EditorCallbackKeyUp(), EditorMainLoop(), GameMainLoop(), HandleKeyUp(), HandleMouseExit(), PatchEditorCallbackKeyDown(), and PatchEditorCallbackKeyUp().
| int MouseScrollState = ScrollNone |
current key state
Definition at line 82 of file mainloop.cpp.
Referenced by DoScroll(), EditorCallbackMouse(), EditorMainLoop(), GameMainLoop(), HandleMouseExit(), HandleMouseOn(), and HandleMouseScrollArea().
1.5.6