|
PVSnesLib
4.6.0
Documentation to code in C or ASM for the Nintendo SNES
|
snes game states engine functionality. More...
#include <snes/snestypes.h>Go to the source code of this file.
Macros | |
| #define | GSTA_MAX 16 |
| #define | gstaInitEngine() GSTATESINIT |
| Initialize all the states of the game with type functions (initialize, update) Your code must define GSTATESINIT as. | |
Functions | |
| void | gstaInitFunctions (u8 staidx, void *initfct, void *updfct) |
| Initialize the game state type functions (initialize, update) of a specific state (intro, menu, etc) | |
| void | gstaProcess (void) |
| call game state engine for all states (gstaSetState must be called before) | |
| void | gstaSetState (u8 staidx) |
| Change the current game state to a new one. | |
snes game states engine functionality.
16 maximum game states managed by engine
| #define GSTA_MAX 16 |
total number of states in the game
| gstaInitEngine | ( | ) | GSTATESINIT |
Initialize all the states of the game with type functions (initialize, update) Your code must define GSTATESINIT as.
It must also define enumeration named STATESDEF in an include file available for all c file using state engine
The declarations must be after the include of pvsneslib main include <snes.h>
| gstaInitFunctions | ( | u8 | staidx, |
| void * | initfct, | ||
| void * | updfct | ||
| ) |
Initialize the game state type functions (initialize, update) of a specific state (intro, menu, etc)
| staidx | The idx of game state depending of the game (intro, menu, etc...) |
| initfct | The address of the function when we init the state |
| updfct | The address of the function when we update the state (need to be called once per frame) |
init and update functions have no parameters
functions name must begin with staini_<statename> and staupd_<statename>
| gstaSetState | ( | u8 | staidx | ) |
Change the current game state to a new one.
| staidx | The idx of game states depending of the game |