Unify the library on an akgl_ namespace
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
#ifndef _GAME_H_
|
||||
#define _GAME_H_
|
||||
#ifndef _AKGL_GAME_H_
|
||||
#define _AKGL_GAME_H_
|
||||
|
||||
#include <SDL3_mixer/SDL_mixer.h>
|
||||
#include "tilemap.h"
|
||||
|
||||
#define GAME_AUDIO_TRACK_BGM 1
|
||||
#define GAME_AUDIO_MAX_TRACKS 64
|
||||
#define AKGL_GAME_AUDIO_TRACK_BGM 1
|
||||
#define AKGL_GAME_AUDIO_MAX_TRACKS 64
|
||||
|
||||
#define TIME_ONESEC_NS 1000000000
|
||||
#define TIME_ONESEC_MS 1000000
|
||||
#define AKGL_TIME_ONESEC_NS 1000000000
|
||||
#define AKGL_TIME_ONESEC_MS 1000000
|
||||
|
||||
/* ==================== GAME STATE VARIABLES =================== */
|
||||
|
||||
@@ -16,11 +16,11 @@ typedef struct {
|
||||
float w;
|
||||
float h;
|
||||
SDL_Texture *texture;
|
||||
} GAME_frame;
|
||||
} akgl_Frame;
|
||||
|
||||
typedef struct {
|
||||
int flags;
|
||||
} GameState;
|
||||
} akgl_GameState;
|
||||
|
||||
typedef struct {
|
||||
char name[256];
|
||||
@@ -28,30 +28,30 @@ typedef struct {
|
||||
char uri[256];
|
||||
int screenwidth;
|
||||
int screenheight;
|
||||
GameState state;
|
||||
akgl_GameState state;
|
||||
int fps;
|
||||
SDL_Time gameStartTime;
|
||||
SDL_Time lastIterTime;
|
||||
SDL_Time lastFPSTime;
|
||||
int framesSinceUpdate;
|
||||
MIX_Mixer *mixer;
|
||||
MIX_Track *tracks[GAME_AUDIO_MAX_TRACKS];
|
||||
} Game;
|
||||
MIX_Track *tracks[AKGL_GAME_AUDIO_MAX_TRACKS];
|
||||
} akgl_Game;
|
||||
|
||||
|
||||
extern SDL_Window *window;
|
||||
extern SDL_Renderer *renderer;
|
||||
extern tilemap gamemap;
|
||||
extern akgl_Tilemap gamemap;
|
||||
extern MIX_Audio *bgm;
|
||||
extern SDL_FRect camera;
|
||||
extern Game game;
|
||||
extern akgl_Game game;
|
||||
|
||||
#define BITMASK_HAS(x, y) (x & y) == y
|
||||
#define BITMASK_ADD(x, y) x |= y
|
||||
#define BITMASK_DEL(x, y) x &= ~(y)
|
||||
#define BITMASK_CLEAR(x) x = 0;
|
||||
#define AKGL_BITMASK_HAS(x, y) (x & y) == y
|
||||
#define AKGL_BITMASK_ADD(x, y) x |= y
|
||||
#define AKGL_BITMASK_DEL(x, y) x &= ~(y)
|
||||
#define AKGL_BITMASK_CLEAR(x) x = 0;
|
||||
|
||||
akerr_ErrorContext AKERR_NOIGNORE *GAME_init();
|
||||
void GAME_updateFPS();
|
||||
akerr_ErrorContext AKERR_NOIGNORE *akgl_game_init();
|
||||
void akgl_game_updateFPS();
|
||||
|
||||
#endif //_GAME_H_
|
||||
#endif //_AKGL_GAME_H_
|
||||
|
||||
Reference in New Issue
Block a user