JacksEscape/app_debug.c
Edgaru089 4f9ea0a09a Debug text & debug build options
use 'winedbg --gdb <file>' to start debugger
2024-03-05 14:19:31 +08:00

31 lines
696 B
C

#include "app.h"
#include "util/vector.h"
#include <stdio.h>
#define PUSH_STRING(str) vector_Append(vec_string, str, strlen(str));
void app_DebugText(App *app, vector_Vector *vec_string) {
vector_Clear(vec_string);
char buf[256] = {};
Component_Player *player = app->player->player;
if (!player) {
PUSH_STRING("Player not available\n");
} else {
snprintf(
buf, sizeof(buf) - 1,
"Player:\n Pos: [%.4lf, %.4lf], Vec:[%.4lf, %.4lf]\n",
player->super->position->position.x,
player->super->position->position.y,
player->super->position->velocity.x,
player->super->position->velocity.y);
PUSH_STRING(buf);
}
char zero = '\0';
vector_Push(vec_string, &zero);
}