Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/Helpers/LogHelpers.c
338 views
1
// ---------------------------------------------------------------------
2
// RSDK Project: Sonic Mania
3
// Object Description: LogHelpers Object
4
// Object Author: Christian Whitehead/Simon Thomley/Hunter Bridges
5
// Decompiled by: Rubberduckycooly & RMGRich
6
// ---------------------------------------------------------------------
7
8
#include "Game.h"
9
10
ObjectLogHelpers *LogHelpers = NULL;
11
12
void LogHelpers_Update(void) {}
13
14
void LogHelpers_LateUpdate(void) {}
15
16
void LogHelpers_StaticUpdate(void) {}
17
18
void LogHelpers_Draw(void) {}
19
20
void LogHelpers_Create(void *data) {}
21
22
void LogHelpers_StageLoad(void) {}
23
24
void LogHelpers_PrintText(const char *message)
25
{
26
#if MANIA_USE_PLUS
27
if (!SceneInfo->inEditor)
28
RSDK.PrintText(PRINT_NORMAL, message);
29
#else
30
LogHelpers_Print("%s", message);
31
#endif
32
}
33
#if MANIA_USE_PLUS
34
void LogHelpers_PrintString(String *message)
35
{
36
if (!SceneInfo->inEditor)
37
RSDK.PrintString(PRINT_NORMAL, message);
38
}
39
#endif
40
void LogHelpers_PrintInt32(const char *message, int32 value)
41
{
42
#if MANIA_USE_PLUS
43
if (!SceneInfo->inEditor)
44
RSDK.PrintInt32(PRINT_NORMAL, message, value);
45
#else
46
LogHelpers_Print("%s: %d", message, value);
47
#endif
48
}
49
50
void LogHelpers_Print(const char *message, ...)
51
{
52
if (!SceneInfo->inEditor) {
53
char messageText[0x100];
54
55
va_list args;
56
va_start(args, message);
57
vsprintf(messageText, message, args);
58
59
#if MANIA_USE_PLUS
60
RSDK.PrintText(PRINT_NORMAL, messageText);
61
#else
62
int32 len = (int32)strlen(messageText);
63
messageText[len] = '\n';
64
messageText[len + 1] = 0;
65
66
RSDK.PrintMessage((void *)messageText, MESSAGE_STRING);
67
#endif
68
69
va_end(args);
70
}
71
}
72
73
#if MANIA_USE_PLUS
74
void LogHelpers_PrintVector2(const char *message, Vector2 value)
75
{
76
if (!SceneInfo->inEditor)
77
RSDK.PrintVector2(PRINT_NORMAL, message, value);
78
}
79
#endif
80
81
#if GAME_INCLUDE_EDITOR
82
void LogHelpers_EditorDraw(void) {}
83
84
void LogHelpers_EditorLoad(void) {}
85
#endif
86
87
void LogHelpers_Serialize(void) {}
88
89