OpenMortal Apocalypse mirror
Sourceforge mirror
SourceForge.net Logo
      News | Info | Characters | Arenas | Screenshots | Forums | Download  
Developer: Making of | Character-HOWTO | AI Design | Submit a Character
Documentation: Main Page | Modules | Class Hierarchy | Class List | File List

common.cpp File Reference

#include <stdio.h>
#include <stdarg.h>
#include "common.h"
#include "State.h"
#include "Joystick.h"
#include "SDL.h"
#include "Event.h"

Functions

void debug (const char *format,...)
bool FindPlayerKey (SDLKey a_enKey, int &a_riOutPlayer, int &a_riOutKey)
bool TranslateEvent (const SDL_Event *a_poInEvent, SMortalEvent *a_poOutEvent)
 TranslateEvent is an important function in the OpenMortal event processing chain.
bool MortalPollEvent (SMortalEvent &a_roOutEvent)
 MortalPollEvent works like SDL_PollEvent, except that it returns an SMortalEvent.
void MortalWaitEvent (SMortalEvent &a_roOutEvent)
 MortalWaitEvent works like SDL_WaitEvent, except that it returns an SMortalEvent.

Variables

SDL_Surface * gamescreen = NULL

Function Documentation

void debug const char *  format,
  ...
 

bool FindPlayerKey SDLKey  a_enKey,
int &  a_riOutPlayer,
int &  a_riOutKey
 

bool MortalPollEvent SMortalEvent a_roOutEvent  ) 
 

MortalPollEvent works like SDL_PollEvent, except that it returns an SMortalEvent.

void MortalWaitEvent SMortalEvent a_roOutEvent  ) 
 

MortalWaitEvent works like SDL_WaitEvent, except that it returns an SMortalEvent.

bool TranslateEvent const SDL_Event *  a_poInEvent,
SMortalEvent a_poOutEvent
 

TranslateEvent is an important function in the OpenMortal event processing chain.

It takes an SDL_Event and converts it to a game related event. This allows for the "transparent" handling of joysticks and such.

Parameters:
a_poInEvent The SDL event which is to be translated.
a_poOutEvent The output event.
Returns:
true if the event could be translated (it was relevant for the game), or false if it couldn't (a_poOutEvent will be set to Me_NOTHING).


Variable Documentation

SDL_Surface* gamescreen = NULL