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

src/stratagus/mainloop.cpp File Reference

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "stratagus.h"
#include "video.h"
#include "tileset.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 "commands.h"
#include "pathfinder.h"
#include "editor.h"
#include "replay.h"
#include "particle.h"
#include <guichan.h>

Classes

struct  GameLogic

mainloop.cpp - The main game loop.

int KeyScrollState = ScrollNone
 variable set when we are scrolling via keyboard
int MouseScrollState = ScrollNone
 variable set when we are scrolling via mouse
EventCallback GameCallbacks
EventCallback EditorCallbacks
 Game callbacks.
const int CPU_NUM = 1
 Editor callbacks.
static CMutex DisplayUpdateLocker
void DrawGuichanWidgets ()
void DoScrollArea (int state, bool fast)
void DrawMapArea ()
 Cleanup all modules.
void UpdateDisplay ()
 Exit with fatal error.
static void InitGameCallbacks ()
static void GameLogicLoop ()
static void DisplayLoop ()
static void SingleGameLoop ()
void GameMainLoop ()
 Draw the map area.

Function Documentation

static void DisplayLoop (  )  [static]

void DoScrollArea ( int  state,
bool  fast 
)

Handle scrolling area.

Parameters:
state Scroll direction/state.
fast Flag scroll faster.
Todo:
Support dynamic acceleration of scroll speed.
Todo:
If the scroll key is longer pressed the area is scrolled faster.

void DrawGuichanWidgets (  ) 

void DrawMapArea (  ) 

Cleanup all modules.

Draw map area

static void GameLogicLoop (  )  [static]

void GameMainLoop (  ) 

Draw the map area.

Game main loop.

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

static void InitGameCallbacks (  )  [static]

static void SingleGameLoop (  )  [static]

void UpdateDisplay (  ) 

Exit with fatal error.

Display update.

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


Variable Documentation

const int CPU_NUM = 1

Editor callbacks.

Game callbacks.

int KeyScrollState = ScrollNone

variable set when we are scrolling via keyboard

current scroll state of keyboard

int MouseScrollState = ScrollNone

variable set when we are scrolling via mouse

current scroll state of mouse

(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.