1 |
#include <stdlib.h> |
2 |
#include <stdarg.h> |
3 |
#include <stdint.h> |
4 |
|
5 |
#include "Daodan_Console.h" |
6 |
#include "BFW_Utility.h" |
7 |
|
8 |
void DDrConsole_Print(const char* text) |
9 |
{ |
10 |
COrTextArea_Print(COgConsoleLines, 1, COgDefaultTextShade, COgDefaultTextShadow, text, 0, COgFadeTimeValue); |
11 |
} |
12 |
|
13 |
void DDrConsole_PrintColored(const char* text, int priority, RGBA color, RGBA shade) |
14 |
{ |
15 |
int* intcolor = (int*)&color; |
16 |
int* intshade = (int*)&shade; |
17 |
COrTextArea_Print(COgConsoleLines, 1, *intcolor, *intshade, text, 0, COgFadeTimeValue); |
18 |
} |
19 |
|
20 |
void DDrConsole_PrintF(const char* fmt, ...) |
21 |
{ |
22 |
va_list ap; |
23 |
va_start(ap, fmt); |
24 |
char* buffer = malloc(vsnprintf(NULL, 0, fmt, ap) + 1); |
25 |
|
26 |
vsprintf(buffer, fmt, ap); |
27 |
va_end(ap); |
28 |
|
29 |
DDrConsole_Print(buffer); |
30 |
free(buffer); |
31 |
return; |
32 |
} |
33 |
|
34 |
TStColorFormattingCharacter DDrDSayColors[] = { |
35 |
{'r', 0, 0, 0xFFEB5050}, |
36 |
{'z', 0, 0, 0xFFFFFFFF}, |
37 |
{0} |
38 |
}; |
39 |
|
40 |
|