windows build compatibility, twn_game_object as abstraction for bridging game code and the engine

This commit is contained in:
veclavtalica
2024-08-27 00:33:37 +03:00
parent 9892bf71dc
commit 2f36d9ea3c
19 changed files with 454 additions and 261 deletions

View File

@ -5,6 +5,8 @@
#include "townengine/game_api.h"
#include <stdio.h>
static void title_tick(struct state *state) {
struct scene_title *scn = (struct scene_title *)state->scene;
@ -20,9 +22,9 @@ static void title_tick(struct state *state) {
/* draw the tick count as an example of dynamic text */
size_t text_str_len = snprintf(NULL, 0, "%ld", state->ctx->tick_count) + 1;
size_t text_str_len = snprintf(NULL, 0, "%lld", state->ctx->tick_count) + 1;
char *text_str = cmalloc(text_str_len);
snprintf(text_str, text_str_len, "%ld", state->ctx->tick_count);
snprintf(text_str, text_str_len, "%lld", state->ctx->tick_count);
const char *font = "fonts/kenney-pixel.ttf";
int text_h = 32;