More assertions.
This commit is contained in:
@ -43,6 +43,7 @@ int32_t main() {
|
|||||||
|
|
||||||
// Prepare the game
|
// Prepare the game
|
||||||
game = malloc(sizeof(game_t));
|
game = malloc(sizeof(game_t));
|
||||||
|
ASSERT_NOT_NULL(game);
|
||||||
GAME_STATE = game;
|
GAME_STATE = game;
|
||||||
input = &game->engine.input;
|
input = &game->engine.input;
|
||||||
|
|
||||||
@ -72,9 +73,6 @@ int32_t main() {
|
|||||||
inputBind(input, INPUT_MOUSE_X, GLFW_PLATFORM_INPUT_MOUSE_X);
|
inputBind(input, INPUT_MOUSE_X, GLFW_PLATFORM_INPUT_MOUSE_X);
|
||||||
inputBind(input, INPUT_MOUSE_Y, GLFW_PLATFORM_INPUT_MOUSE_Y);
|
inputBind(input, INPUT_MOUSE_Y, GLFW_PLATFORM_INPUT_MOUSE_Y);
|
||||||
|
|
||||||
// Set up the client
|
|
||||||
game->engine.client.setTitle = &glfwClientSetTitle;
|
|
||||||
|
|
||||||
// Set up some GLFW stuff
|
// Set up some GLFW stuff
|
||||||
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
|
||||||
glfwSetWindowTitle(window, game->engine.name);
|
glfwSetWindowTitle(window, game->engine.name);
|
||||||
@ -112,13 +110,20 @@ int32_t main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void glfwOnResize(GLFWwindow *window, int32_t width, int32_t height) {
|
void glfwOnResize(GLFWwindow *window, int32_t width, int32_t height) {
|
||||||
|
ASSERT_NOT_NULL(window);
|
||||||
|
ASSERT_GREATER_THAN(width, 0);
|
||||||
|
ASSERT_GREATER_THAN(height, 0);
|
||||||
|
|
||||||
renderSetResolution(&GAME_STATE->engine.render, (float)width, (float)height);
|
renderSetResolution(&GAME_STATE->engine.render, (float)width, (float)height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void glfwOnKey(GLFWwindow *window,
|
void glfwOnKey(GLFWwindow *window,
|
||||||
int32_t key, int32_t scancode, int32_t action, int32_t mods
|
int32_t key, int32_t scancode, int32_t action, int32_t mods
|
||||||
) {
|
) {
|
||||||
input_t *input = &GAME_STATE->engine.input;
|
input_t *input;
|
||||||
|
ASSERT_NOT_NULL(window);
|
||||||
|
|
||||||
|
input = &GAME_STATE->engine.input;
|
||||||
if(action == GLFW_PRESS) {
|
if(action == GLFW_PRESS) {
|
||||||
inputStateSet(input, glfwGetInputSourceForKey(key), 1.0f);
|
inputStateSet(input, glfwGetInputSourceForKey(key), 1.0f);
|
||||||
} else if(action == GLFW_RELEASE) {
|
} else if(action == GLFW_RELEASE) {
|
||||||
@ -131,7 +136,10 @@ void glfwOnError(int error, const char* description) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void glfwOnCursor(GLFWwindow *window, double x, double y) {
|
void glfwOnCursor(GLFWwindow *window, double x, double y) {
|
||||||
input_t *input = &GAME_STATE->engine.input;
|
input_t *input;
|
||||||
|
ASSERT_NOT_NULL(window);
|
||||||
|
|
||||||
|
input = &GAME_STATE->engine.input;
|
||||||
inputStateSet(input, GLFW_PLATFORM_INPUT_MOUSE_X, (float)x);
|
inputStateSet(input, GLFW_PLATFORM_INPUT_MOUSE_X, (float)x);
|
||||||
inputStateSet(input, GLFW_PLATFORM_INPUT_MOUSE_Y, (float)y);
|
inputStateSet(input, GLFW_PLATFORM_INPUT_MOUSE_Y, (float)y);
|
||||||
}
|
}
|
||||||
@ -145,5 +153,6 @@ inputsource_t glfwGetInputSourceForKey(int32_t key) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void glfwClientSetTitle(char *name) {
|
void glfwClientSetTitle(char *name) {
|
||||||
|
ASSERT_NOT_NULL(window);
|
||||||
glfwSetWindowTitle(window, name);
|
glfwSetWindowTitle(window, name);
|
||||||
}
|
}
|
@ -8,6 +8,7 @@
|
|||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
#include <libs.h>
|
#include <libs.h>
|
||||||
#include "display/render.h"
|
#include "display/render.h"
|
||||||
|
#include "assert/assert.h"
|
||||||
#include "input/input.h"
|
#include "input/input.h"
|
||||||
#include "game/game.h"
|
#include "game/game.h"
|
||||||
|
|
||||||
|
@ -9,8 +9,9 @@
|
|||||||
#include "../libs.h"
|
#include "../libs.h"
|
||||||
|
|
||||||
#define ASSERT_TRUE(x) assert(x)
|
#define ASSERT_TRUE(x) assert(x)
|
||||||
|
#define ASSERT_FALSE(x) ASSERT_TRUE((x) == false)
|
||||||
|
|
||||||
#define ASSERT_NOT_NULL(x) ASSERT_TRUE(x != NULL)
|
#define ASSERT_NOT_NULL(x) ASSERT_FALSE(x == NULL)
|
||||||
|
|
||||||
#define ASSERT_IF(x, y) (x ? y : false)
|
#define ASSERT_IF(x, y) (x ? y : false)
|
||||||
|
|
||||||
@ -21,4 +22,7 @@
|
|||||||
#define ASSERT_LESS_THAN_EQUAL_TO (x, y) ASSERT_TRUE(x <= y)
|
#define ASSERT_LESS_THAN_EQUAL_TO (x, y) ASSERT_TRUE(x <= y)
|
||||||
|
|
||||||
#define ASSERT_GREATER_THAN(x, y) ASSERT_TRUE(x > y)
|
#define ASSERT_GREATER_THAN(x, y) ASSERT_TRUE(x > y)
|
||||||
#define ASSERT_GREATER_THAN_EQUAL_TO(x, y) ASSERT_TRUE(x >= y)
|
#define ASSERT_GREATER_THAN_EQUAL_TO(x, y) ASSERT_TRUE(x >= y)
|
||||||
|
|
||||||
|
#define ASSERT_FLAG_OFF(flags, flag) ASSERT_FALSE(flags & flag)
|
||||||
|
#define ASSERT_FLAG_ON(flags, flag) ASSERT_TRUE(flags & flag)
|
@ -11,6 +11,9 @@ tilesetdiv_t * bitmapFontGetCharacterDivision(tileset_t *tileset,
|
|||||||
char character
|
char character
|
||||||
) {
|
) {
|
||||||
int32_t i = ((int32_t)character) - BITMAP_FONT_CHAR_START;
|
int32_t i = ((int32_t)character) - BITMAP_FONT_CHAR_START;
|
||||||
|
|
||||||
|
ASSERT_NOT_NULL(tileset);
|
||||||
|
|
||||||
return tileset->divisions + i;
|
return tileset->divisions + i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,6 +27,10 @@ bitmapfontmeasure_t bitmapFontMeasure(char *string,
|
|||||||
.height = 0, .lines = 1, .width = 0
|
.height = 0, .lines = 1, .width = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ASSERT_NOT_NULL(string);
|
||||||
|
ASSERT_GREATER_THAN(charWidth, 0);
|
||||||
|
ASSERT_GREATER_THAN(charHeight, 0);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
y = 0;
|
y = 0;
|
||||||
x = 0;
|
x = 0;
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "../libs.h"
|
#include "../libs.h"
|
||||||
|
#include "../assert/assert.h"
|
||||||
#include "spritebatch.h"
|
#include "spritebatch.h"
|
||||||
#include "tileset.h"
|
#include "tileset.h"
|
||||||
#include "../util/math.h"
|
#include "../util/math.h"
|
||||||
|
@ -11,11 +11,13 @@ void cameraLookAt(camera_t *camera,
|
|||||||
float x, float y, float z,
|
float x, float y, float z,
|
||||||
float targetX, float targetY, float targetZ
|
float targetX, float targetY, float targetZ
|
||||||
) {
|
) {
|
||||||
|
ASSERT_NOT_NULL(camera);
|
||||||
matrixIdentity(&camera->view);
|
matrixIdentity(&camera->view);
|
||||||
matrixLookAt(&camera->view, x, y, z, targetX, targetY, targetZ, 0, 1, 0);
|
matrixLookAt(&camera->view, x, y, z, targetX, targetY, targetZ, 0, 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cameraLookAtStruct(camera_t *camera, cameralookat_t look) {
|
void cameraLookAtStruct(camera_t *camera, cameralookat_t look) {
|
||||||
|
ASSERT_NOT_NULL(camera);
|
||||||
cameraLookAt(camera,
|
cameraLookAt(camera,
|
||||||
look.x, look.y, look.z, look.lookX, look.lookY, look.lookZ
|
look.x, look.y, look.z, look.lookX, look.lookY, look.lookZ
|
||||||
);
|
);
|
||||||
@ -25,6 +27,8 @@ void cameraLook(camera_t *camera,
|
|||||||
float x, float y, float z,
|
float x, float y, float z,
|
||||||
float pitch, float yaw, float roll
|
float pitch, float yaw, float roll
|
||||||
) {
|
) {
|
||||||
|
ASSERT_NOT_NULL(camera);
|
||||||
|
|
||||||
matrixIdentity(&camera->view);
|
matrixIdentity(&camera->view);
|
||||||
matrixLook(&camera->view, x, y, z, pitch, yaw, roll, 0, 1, 0);
|
matrixLook(&camera->view, x, y, z, pitch, yaw, roll, 0, 1, 0);
|
||||||
}
|
}
|
||||||
@ -32,6 +36,8 @@ void cameraLook(camera_t *camera,
|
|||||||
void cameraPerspective(camera_t *camera,
|
void cameraPerspective(camera_t *camera,
|
||||||
float fov, float aspect, float camNear, float camFar
|
float fov, float aspect, float camNear, float camFar
|
||||||
) {
|
) {
|
||||||
|
ASSERT_NOT_NULL(camera);
|
||||||
|
|
||||||
matrixIdentity(&camera->projection);
|
matrixIdentity(&camera->projection);
|
||||||
matrixPerspective(&camera->projection,mathDeg2Rad(fov),aspect,camNear,camFar);
|
matrixPerspective(&camera->projection,mathDeg2Rad(fov),aspect,camNear,camFar);
|
||||||
}
|
}
|
||||||
@ -39,6 +45,8 @@ void cameraPerspective(camera_t *camera,
|
|||||||
void cameraOrtho(camera_t *camera,
|
void cameraOrtho(camera_t *camera,
|
||||||
float left, float right, float bottom, float top, float camNear, float camFar
|
float left, float right, float bottom, float top, float camNear, float camFar
|
||||||
) {
|
) {
|
||||||
|
ASSERT_NOT_NULL(camera);
|
||||||
|
|
||||||
matrixIdentity(&camera->projection);
|
matrixIdentity(&camera->projection);
|
||||||
matrixOrtho(&camera->projection, left, right, bottom, top, camNear, camFar);
|
matrixOrtho(&camera->projection, left, right, bottom, top, camNear, camFar);
|
||||||
}
|
}
|
||||||
@ -47,9 +55,13 @@ void cameraOrbit(camera_t *camera,
|
|||||||
float distance, float yaw, float pitch,
|
float distance, float yaw, float pitch,
|
||||||
float targetX, float targetY, float targetZ
|
float targetX, float targetY, float targetZ
|
||||||
) {
|
) {
|
||||||
|
|
||||||
float cy = cosf(pitch);
|
float cy = cosf(pitch);
|
||||||
float x = distance * sinf(yaw) * cy;
|
float x = distance * sinf(yaw) * cy;
|
||||||
float y = distance * sinf(pitch);
|
float y = distance * sinf(pitch);
|
||||||
float z = distance * cosf(yaw) * cy;
|
float z = distance * cosf(yaw) * cy;
|
||||||
|
|
||||||
|
ASSERT_NOT_NULL(camera);
|
||||||
|
|
||||||
cameraLookAt(camera, x, y, z, targetX, targetY, targetZ);
|
cameraLookAt(camera, x, y, z, targetX, targetY, targetZ);
|
||||||
}
|
}
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "../libs.h"
|
#include "../libs.h"
|
||||||
|
#include "../assert/assert.h"
|
||||||
#include "../util/math.h"
|
#include "../util/math.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
|
|
||||||
|
@ -32,10 +32,16 @@ void renderDispose() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void renderSetResolution(render_t *render, float width, float height) {
|
void renderSetResolution(render_t *render, float width, float height) {
|
||||||
|
ASSERT_NOT_NULL(render);
|
||||||
|
ASSERT_GREATER_THAN(width, 0);
|
||||||
|
ASSERT_GREATER_THAN(height, 0);
|
||||||
|
|
||||||
render->width = width;
|
render->width = width;
|
||||||
render->height = height;
|
render->height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
void renderResetFramebuffer(render_t *render) {
|
void renderResetFramebuffer(render_t *render) {
|
||||||
|
ASSERT_NOT_NULL(render);
|
||||||
|
|
||||||
frameBufferUnbind(render->width, render->height, true);
|
frameBufferUnbind(render->width, render->height, true);
|
||||||
}
|
}
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "../libs.h"
|
#include "../libs.h"
|
||||||
|
#include "../assert/assert.h"
|
||||||
#include "framebuffer.h"
|
#include "framebuffer.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
# Sources
|
# Sources
|
||||||
target_sources(${PROJECT_NAME}
|
target_sources(${PROJECT_NAME}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
client.c
|
|
||||||
engine.c
|
engine.c
|
||||||
thread.c
|
thread.c
|
||||||
event.c
|
event.c
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2021 Dominic Masters
|
|
||||||
*
|
|
||||||
* This software is released under the MIT License.
|
|
||||||
* https://opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "client.h"
|
|
||||||
|
|
||||||
void clientInit(client_t *client) {
|
|
||||||
client->setTitle = NULL;
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2021 Dominic Masters
|
|
||||||
*
|
|
||||||
* This software is released under the MIT License.
|
|
||||||
* https://opensource.org/licenses/MIT
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
#include "../libs.h"
|
|
||||||
|
|
||||||
/** Callback to set the window title */
|
|
||||||
typedef void clientsettitle_t(char *string);
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
clientsettitle_t *setTitle;
|
|
||||||
} client_t;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize the client to its default state.
|
|
||||||
*
|
|
||||||
* @param client Client to initialize.
|
|
||||||
*/
|
|
||||||
void clientInit(client_t *client);
|
|
@ -8,6 +8,8 @@
|
|||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
|
|
||||||
void engineInit(engine_t *engine) {
|
void engineInit(engine_t *engine) {
|
||||||
|
ASSERT_NOT_NULL(engine);
|
||||||
|
|
||||||
randSeed(123);
|
randSeed(123);
|
||||||
|
|
||||||
#if defined(GAME_NAME)
|
#if defined(GAME_NAME)
|
||||||
@ -16,7 +18,6 @@ void engineInit(engine_t *engine) {
|
|||||||
engine->name = "Dawn";
|
engine->name = "Dawn";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
clientInit(&engine->client);
|
|
||||||
epochInit(&engine->time);
|
epochInit(&engine->time);
|
||||||
saveManagerInit(&engine->save);
|
saveManagerInit(&engine->save);
|
||||||
inputInit(&engine->input);
|
inputInit(&engine->input);
|
||||||
@ -27,6 +28,9 @@ void engineInit(engine_t *engine) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void engineUpdateStart(engine_t *engine, float delta) {
|
void engineUpdateStart(engine_t *engine, float delta) {
|
||||||
|
ASSERT_NOT_NULL(engine);
|
||||||
|
ASSERT_GREATER_THAN(delta, 0);
|
||||||
|
|
||||||
epochUpdate(&engine->time, delta);
|
epochUpdate(&engine->time, delta);
|
||||||
inputUpdate(&engine->input);
|
inputUpdate(&engine->input);
|
||||||
assetManagerUpdate(&engine->assetManager);
|
assetManagerUpdate(&engine->assetManager);
|
||||||
@ -35,6 +39,8 @@ void engineUpdateStart(engine_t *engine, float delta) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool engineUpdateEnd(engine_t *engine) {
|
bool engineUpdateEnd(engine_t *engine) {
|
||||||
|
ASSERT_NOT_NULL(engine);
|
||||||
|
|
||||||
if(inputIsPressed(&engine->input, INPUT_NULL)) {
|
if(inputIsPressed(&engine->input, INPUT_NULL)) {
|
||||||
printf("Game exit requested\n");
|
printf("Game exit requested\n");
|
||||||
return false;
|
return false;
|
||||||
@ -43,6 +49,8 @@ bool engineUpdateEnd(engine_t *engine) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void engineDispose(engine_t *engine) {
|
void engineDispose(engine_t *engine) {
|
||||||
|
ASSERT_NOT_NULL(engine);
|
||||||
|
|
||||||
assetManagerDispose(&engine->assetManager);
|
assetManagerDispose(&engine->assetManager);
|
||||||
inputDispose(&engine->input);
|
inputDispose(&engine->input);
|
||||||
renderDispose();
|
renderDispose();
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "../libs.h"
|
#include "../libs.h"
|
||||||
#include "client.h"
|
#include "../assert/assert.h"
|
||||||
#include "../util/rand.h"
|
#include "../util/rand.h"
|
||||||
#include "../input/input.h"
|
#include "../input/input.h"
|
||||||
#include "../epoch/epoch.h"
|
#include "../epoch/epoch.h"
|
||||||
@ -33,9 +33,6 @@ typedef struct {
|
|||||||
|
|
||||||
/** Save Manager for the game */
|
/** Save Manager for the game */
|
||||||
savemanager_t save;
|
savemanager_t save;
|
||||||
|
|
||||||
/** Game client information */
|
|
||||||
client_t client;
|
|
||||||
} engine_t;
|
} engine_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -8,38 +8,55 @@
|
|||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
|
|
||||||
void threadInit(thread_t *thread, threadfunction_t *call) {
|
void threadInit(thread_t *thread, threadfunction_t *call) {
|
||||||
|
ASSERT_NOT_NULL(thread);
|
||||||
|
ASSERT_NOT_NULL(call);
|
||||||
|
|
||||||
thread->call = call;
|
thread->call = call;
|
||||||
thread->user = NULL;
|
thread->user = NULL;
|
||||||
thread->state = 0x00;
|
thread->state = 0x00;
|
||||||
}
|
}
|
||||||
|
|
||||||
void threadStart(thread_t *thread) {
|
void threadStart(thread_t *thread) {
|
||||||
|
ASSERT_NOT_NULL(thread);
|
||||||
|
ASSERT_FLAG_OFF(thread->state, THREAD_FLAG_RUNNING);
|
||||||
|
ASSERT_FLAG_OFF(thread->state, THREAD_FLAG_QUEUED);
|
||||||
|
|
||||||
thread->state |= THREAD_FLAG_QUEUED;
|
thread->state |= THREAD_FLAG_QUEUED;
|
||||||
sysThreadCreate(&_threadWrappedCallback, thread->pt, thread);
|
sysThreadCreate(&_threadWrappedCallback, thread->pt, thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
void threadJoin(thread_t *thread) {
|
void threadJoin(thread_t *thread) {
|
||||||
|
ASSERT_NOT_NULL(thread);
|
||||||
|
ASSERT_FLAG_ON(thread->state, THREAD_FLAG_RUNNING);
|
||||||
|
|
||||||
sysThreadJoin(thread->pt);
|
sysThreadJoin(thread->pt);
|
||||||
}
|
}
|
||||||
|
|
||||||
void threadCancel(thread_t *thread) {
|
void threadCancel(thread_t *thread) {
|
||||||
|
ASSERT_NOT_NULL(thread);
|
||||||
|
ASSERT_FLAG_ON(thread->state, THREAD_FLAG_RUNNING);
|
||||||
|
|
||||||
sysThreadCancel(thread->pt, 1);
|
sysThreadCancel(thread->pt, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void threadSleep(float time) {
|
void threadSleep(float time) {
|
||||||
|
ASSERT_GREATER_THAN(time, 0);
|
||||||
|
|
||||||
sleep((unsigned long)(time * 1000.0f));
|
sleep((unsigned long)(time * 1000.0f));
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t _threadWrappedCallback(thread_t *thread) {
|
int32_t _threadWrappedCallback(thread_t *thread) {
|
||||||
int32_t response;
|
int32_t response;
|
||||||
|
|
||||||
flagOff(thread->state, THREAD_FLAG_QUEUED);
|
ASSERT_NOT_NULL(thread);
|
||||||
|
|
||||||
thread->state |= THREAD_FLAG_RUNNING;
|
thread->state |= THREAD_FLAG_RUNNING;
|
||||||
|
thread->state = flagOff(thread->state, THREAD_FLAG_QUEUED);
|
||||||
|
|
||||||
response = thread->call(thread);
|
response = thread->call(thread);
|
||||||
|
|
||||||
thread->state |= THREAD_FLAG_HAS_RUN;
|
thread->state |= THREAD_FLAG_HAS_RUN;
|
||||||
flagOff(thread->state, THREAD_FLAG_RUNNING);
|
thread->state = flagOff(thread->state, THREAD_FLAG_RUNNING);
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "../libs.h"
|
#include "../libs.h"
|
||||||
|
#include "../assert/assert.h"
|
||||||
#include "../util/flags.h"
|
#include "../util/flags.h"
|
||||||
|
|
||||||
typedef struct _thread_t thread_t;
|
typedef struct _thread_t thread_t;
|
||||||
|
@ -17,6 +17,7 @@ bool onEventTriggered(void *user, event_t event, void *args[], int32_t argc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool gameInit(game_t *game) {
|
bool gameInit(game_t *game) {
|
||||||
|
ASSERT_NOT_NULL(game);
|
||||||
|
|
||||||
eventManagerInit(&eventManager);
|
eventManagerInit(&eventManager);
|
||||||
eventManagerSubscribe(&eventManager, EVENT_TEST, NULL, onEventTriggered);
|
eventManagerSubscribe(&eventManager, EVENT_TEST, NULL, onEventTriggered);
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "../../libs.h"
|
#include "../../libs.h"
|
||||||
|
#include "../../assert/assert.h"
|
||||||
#include "../../engine/engine.h"
|
#include "../../engine/engine.h"
|
||||||
#include "../../engine/event.h"
|
#include "../../engine/event.h"
|
||||||
#include "../../display/primitive/primitive.h"
|
#include "../../display/primitive/primitive.h"
|
||||||
|
Reference in New Issue
Block a user