ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/src/Daodan_Console.c
Revision: 689
Committed: Mon Mar 4 15:52:19 2013 UTC (12 years, 7 months ago) by alloc
Content type: text/x-csrc
File size: 1364 byte(s)
Log Message:
Daodan: Cleaned up code so no major warnings exist

File Contents

# Content
1 #include <stdlib.h>
2 #include <stdarg.h>
3 //#include <stdint.h>
4
5 #include "Daodan_Console.h"
6 #include "BFW_Utility.h"
7 #include "Oni_Symbols.h"
8
9 void DDrConsole_Print(const char* text)
10 {
11 COrTextArea_Print(COgConsoleLines, 1, COgDefaultTextShade, COgDefaultTextShadow, text, 0, COgFadeTimeValue);
12 }
13
14 void DDrConsole_PrintColored(const char* text, int priority, RGBA color, RGBA shade)
15 {
16 int* intcolor = (int*)&color;
17 int* intshade = (int*)&shade;
18 COrTextArea_Print(COgConsoleLines, 1, *intcolor, *intshade, text, 0, COgFadeTimeValue);
19 }
20
21 void DDrConsole_PrintF(const char* fmt, ...)
22 {
23 char* buffer;
24 va_list ap;
25 va_start(ap, fmt);
26 buffer = malloc(vsnprintf(NULL, 0, fmt, ap) + 1);
27
28 vsprintf(buffer, fmt, ap);
29 va_end(ap);
30
31 DDrConsole_Print(buffer);
32 free(buffer);
33 return;
34 }
35
36 TStColorFormattingCharacter DDrDSayColors[] = {
37 {'r', 0, 0xFFEB5050}, //red
38 {'y', 0, 0xFFFCFF1C}, //yellow
39 {'b', 0, 0xFF93BBE9}, //blue
40 {'u', 0, 0xFFF67603}, //umber
41 {'g', 0, 0xFFA2DAA5}, //green
42 {'l', 0, 0xFFBE90D9}, //lilac
43 {'o', 0, 0xFFFBA500}, //orange
44 {'c', 0, 0xFF93EAEB}, //cyan
45 //New Colors Here...
46 {'k', 0, 0xFF000000}, //black
47 {'v', 0, 0xFFEB40EB}, //violet
48 {'w', 0, 0xFFFFFFFF}, //white...
49 {'e', 0, 0xFF505050}, //darkgrey
50 {'f', 0, 0xFFAAAAAA}, //grey
51 {0, 0, 0} //POWER RANGERS GO!
52 };
53
54