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

mainloop.cpp File Reference
#include "online_service.h"
#include "stratagus.h"
#include "actions.h"
#include "editor.h"
#include "fow.h"
#include "game.h"
#include "map.h"
#include "missile.h"
#include "network.h"
#include "particle.h"
#include "replay.h"
#include "results.h"
#include "sound.h"
#include "translate.h"
#include "trigger.h"
#include "ui.h"
#include "unit.h"
#include "video.h"
#include "parameters.h"
#include <guichan.h>

mainloop.cpp - The main game loop.

enum  CallPeriod {
  cEvery2nd = 0b1, cEvery4th = 0b11, cEvery8th = 0b111, cEvery16th = 0b1111,
  cEvery32nd = 0b11111, cEvery64th = 0b111111, cEvery128th = 0b1111111, cEvery256th = 0b11111111
}
 
int KeyScrollState = ScrollNone
 variable set when we are scrolling via keyboard More...
 
int MouseScrollState = ScrollNone
 variable set when we are scrolling via mouse More...
 
EventCallback GameCallbacks
 
EventCallback EditorCallbacks
 Game callbacks. More...
 
void DrawGuichanWidgets ()
 
void DoScrollArea (int state, bool fast, bool isKeyboard)
 Editor callbacks. More...
 
void DrawMapArea ()
 Game display update. More...
 
void UpdateDisplay ()
 Exit with fatal error. More...
 
static void InitGameCallbacks ()
 
static void GameLogicLoop ()
 
static void DisplayLoop ()
 
static void SingleGameLoop ()
 
void GameMainLoop ()
 Draw the map area. More...
 

Enumeration Type Documentation

◆ CallPeriod

enum CallPeriod
Enumerator
cEvery2nd 
cEvery4th 
cEvery8th 
cEvery16th 
cEvery32nd 
cEvery64th 
cEvery128th 
cEvery256th 

Function Documentation

◆ DisplayLoop()

static void DisplayLoop ( )
static

◆ DoScrollArea()

void DoScrollArea ( int  state,
bool  fast,
bool  isKeyboard 
)

Editor callbacks.

Handle scrolling area.

Parameters
stateScroll direction/state.
fastFlag scroll faster.
Todo:

Support dynamic acceleration of scroll speed.

If the scroll key is longer pressed the area is scrolled faster.

◆ DrawGuichanWidgets()

void DrawGuichanWidgets ( )

◆ DrawMapArea()

void DrawMapArea ( )

Game display update.

Draw map area

◆ GameLogicLoop()

static void GameLogicLoop ( )
static

◆ GameMainLoop()

void GameMainLoop ( )

Draw the map area.

Game main loop.

Unit actions. Missile actions. Players (AI). Cyclic events (color cycle,...) Display update. Input/Network/Sound.

◆ InitGameCallbacks()

static void InitGameCallbacks ( )
static

◆ SingleGameLoop()

static void SingleGameLoop ( )
static

◆ UpdateDisplay()

void UpdateDisplay ( )

Exit with fatal error.

Display update.

This functions updates everything on screen. The map, the gui, the cursors.

Variable Documentation

◆ EditorCallbacks

EventCallback EditorCallbacks

Game callbacks.

◆ GameCallbacks

EventCallback GameCallbacks

◆ KeyScrollState

int KeyScrollState = ScrollNone

variable set when we are scrolling via keyboard

current scroll state of keyboard

◆ MouseScrollState

int MouseScrollState = ScrollNone

variable set when we are scrolling via mouse

current scroll state of mouse

(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.