Moved mario global state vars in to struct

This commit is contained in:
jaburns
2020-10-27 15:11:12 -06:00
parent 0c67335112
commit b921cb04bb
15 changed files with 186 additions and 272 deletions
+21 -1
View File
@@ -1,3 +1,23 @@
#include "global_state.h"
struct GlobalState *gState = 0;
#include <stdlib.h>
#include <string.h>
struct GlobalState *g_state = 0;
struct GlobalState *global_state_create(void)
{
struct GlobalState *state = malloc( sizeof( struct GlobalState ));
memset( state, 0, sizeof( struct GlobalState ));
return state;
}
void global_state_bind(struct GlobalState *state)
{
g_state = state;
}
void global_state_destroy(struct GlobalState *state)
{
free( state );
}