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

Event.h File Reference

Go to the source code of this file.

Enumerations

enum  TMortalEventEnum {
  Me_NOTHING, Me_QUIT, Me_MENU, Me_SKIP,
  Me_PLAYERKEYDOWN, Me_PLAYERKEYUP
}
enum  TMortalKeysEnum {
  Mk_UP = 0, Mk_DOWN = 1, Mk_LEFT = 2, Mk_RIGHT = 3,
  Mk_BLOCK = 4, Mk_LPUNCH = 5, Mk_HPUNCH = 6, Mk_LKICK = 7,
  Mk_HKICK = 8
}

Functions

bool TranslateEvent (const SDL_Event *a_poInSDLEvent, 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.


Enumeration Type Documentation

enum TMortalEventEnum
 

Enumeration values:
Me_NOTHING 
Me_QUIT 
Me_MENU 
Me_SKIP 
Me_PLAYERKEYDOWN 
Me_PLAYERKEYUP 

enum TMortalKeysEnum
 

Enumeration values:
Mk_UP 
Mk_DOWN 
Mk_LEFT 
Mk_RIGHT 
Mk_BLOCK 
Mk_LPUNCH 
Mk_HPUNCH 
Mk_LKICK 
Mk_HKICK 


Function Documentation

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