102 Dalmatians: Puppies to the Rescue
Decompilation Source Reference | GitLab repository
Loading...
Searching...
No Matches
diagnostics.c
Go to the documentation of this file.
1/* Recovered game implementation; original addresses identify provenance. */
10#include "pcdogs/level/types.h"
13#include "pcdogs/ui/functions.h"
14
15// Original pcdogs.exe: 0x4176c0
16// Writes each non-null message and category to the open debug log, flushing after each write. The formatted buffer is passed directly as the output format string.
17void Debug_Log(char const *category, char const *message)
18{
19 if (!g_debugLogFile)
20 return;
21
22 if (message)
23 {
27 }
28
29 if (!category)
30 return;
31
35}
36
37// Original pcdogs.exe: 0x43cf20
38// Renders the tracked actor's position and the current frame rate as debug text.
40{
41 struct Math_Vec3I32 position = {0};
43 if (level)
44 {
45 const struct Actor *actor = level->entity_array[(uint16_t)level->current_entity_index].runtime_actor;
46 if (actor)
47 position = actor->position;
48 }
49
50 char text[256];
54 UI_RenderText(0x14000a, text, 0, NULL);
56 UI_RenderText(0x46012c, text, 0, NULL);
57}
#define camera_debug_pos_scale
Definition globals.h:21
#define g_debugLogFile
Definition globals.h:12
#define Debug_LogMessageBuffer
Definition globals.h:18
#define Debug_Log_LineFormat
Definition globals.h:14
void Debug_Log(char const *category, char const *message)
Definition diagnostics.c:17
void Debug_RenderOverlay()
Definition diagnostics.c:39
#define pkg_resource_current_level_data
Definition globals.h:117
#define STR_DEBUG_POS_FORMAT
Definition globals.h:102
#define STR_DEBUG_FPS_FORMAT
Definition globals.h:99
int32_t CRT_fprintf(struct File_Handle *stream, char const *format,...)
Definition formatting.c:47
int32_t CRT_fflush(struct File_Handle *stream)
Definition stdio.c:17
int32_t String_FormatCRTString(char *buffer, char const *format,...)
Definition formatting.c:18
Definition types.h:118
struct Math_Vec3I32 position
Definition types.h:132
struct Actor * runtime_actor
Definition types.h:107
int16_t current_entity_index
Definition types.h:43
struct Entity * entity_array
Definition types.h:45
int32_t y
Definition types.h:471
int32_t x
Definition types.h:470
int32_t z
Definition types.h:472
void UI_RenderText(uint32_t packed_xy, char const *text, uint32_t text_flags, void *font_context)
Definition text.c:226
#define g_currentFPS
Definition values.h:492