first commit
This commit is contained in:
56
src/engine/debug.c
Normal file
56
src/engine/debug.c
Normal file
@@ -0,0 +1,56 @@
|
||||
#include "debug.h"
|
||||
|
||||
void
|
||||
debug_vec2_print(const char* string, vec2 value)
|
||||
{
|
||||
if (string)
|
||||
printf("%s %s {%.3f, %.3f}\n", STRING_DEBUG, string, value[0], value[1]);
|
||||
else
|
||||
printf("%s {%.3f, %.3f}\n", STRING_DEBUG, value[0], value[1]);
|
||||
}
|
||||
|
||||
void
|
||||
debug_vec3_print(const char* string, vec3 value)
|
||||
{
|
||||
if (string)
|
||||
printf("%s %s {%.3f, %.3f, %.3f}\n", STRING_DEBUG, string, value[0], value[1], value[2]);
|
||||
else
|
||||
printf("%s {%.3f, %.3f, %.3f}\n", STRING_DEBUG, value[0], value[1], value[2]);
|
||||
}
|
||||
|
||||
void
|
||||
debug_mat4_print(const char* string, mat4 value)
|
||||
{
|
||||
if (string)
|
||||
{
|
||||
printf
|
||||
(
|
||||
"%s %s\n"
|
||||
"\t %.3f %.3f %.3f %.3f\n"
|
||||
"\t %.3f %.3f %.3f %.3f\n"
|
||||
"\t %.3f %.3f %.3f %.3f\n"
|
||||
"\t %.3f %.3f %.3f %.3f\n",
|
||||
STRING_DEBUG, string,
|
||||
value[0][0], value[0][1], value[0][2], value[0][3],
|
||||
value[1][0], value[1][1], value[1][2], value[1][3],
|
||||
value[2][0], value[2][1], value[2][2], value[2][3],
|
||||
value[3][0], value[3][1], value[3][2], value[3][3]
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf
|
||||
(
|
||||
"%s\n"
|
||||
"\t %.3f %.3f %.3f %.3f\n"
|
||||
"\t %.3f %.3f %.3f %.3f\n"
|
||||
"\t %.3f %.3f %.3f %.3f\n"
|
||||
"\t %.3f %.3f %.3f %.3f\n",
|
||||
STRING_DEBUG,
|
||||
value[0][0], value[0][1], value[0][2], value[0][3],
|
||||
value[1][0], value[1][1], value[1][2], value[1][3],
|
||||
value[2][0], value[2][1], value[2][2], value[2][3],
|
||||
value[3][0], value[3][1], value[3][2], value[3][3]
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user