finally compiling and running, text still needs rework

This commit is contained in:
2024-09-16 16:17:00 +03:00
parent 551d60ef85
commit 16c96010dc
43 changed files with 299 additions and 309 deletions

View File

@ -1,5 +1,5 @@
#include "townengine/twn_game_object.h"
#include "townengine/context.h"
#include "twn_game_object_c.h"
#include "twn_engine_context_c.h"
#include <x-watcher.h>
#include <SDL2/SDL.h>
@ -56,7 +56,7 @@ static void load_game_object(void) {
handle = new_handle;
if (ctx.tick_count != 0)
if (ctx.game.tick_count != 0)
log_info("Game object was reloaded\n");
return;
@ -83,7 +83,7 @@ static void watcher_callback(XWATCHER_FILE_EVENT event,
switch(event) {
case XWATCHER_FILE_MODIFIED:
SDL_LockMutex(lock);
last_tick_modified = ctx.tick_count;
last_tick_modified = ctx.game.tick_count;
loaded_after_modification = false;
SDL_UnlockMutex(lock);
break;
@ -126,7 +126,7 @@ bool game_object_try_reloading(void) {
/* only load the modified library after some time, as compilers make a lot of modifications */
SDL_LockMutex(lock);
if (ctx.tick_count - last_tick_modified > MODIFIED_TICKS_MERGED &&
if (ctx.game.tick_count - last_tick_modified > MODIFIED_TICKS_MERGED &&
!loaded_after_modification) {
load_game_object();
loaded_after_modification = true;