ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/src/Daodan_Console.c
Revision: 477
Committed: Tue Nov 3 11:09:12 2009 UTC (15 years, 11 months ago) by gumby
Content type: text/x-csrc
File size: 1357 byte(s)
Log Message:
Added in all colors
Fixed Guard whatever for Daodan_Console.h

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
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}, //red
36 {'y', 0, 0, 0xFFFCFF1C}, //yellow
37 {'b', 0, 0, 0xFF93BBE9}, //blue
38 {'u', 0, 0, 0xFFF67603}, //umber
39 {'g', 0, 0, 0xFFA2DAA5}, //green
40 {'l', 0, 0, 0xFFBE90D9}, //lilac
41 {'o', 0, 0, 0xFFFBA500}, //orange
42 {'c', 0, 0, 0xFF93EAEB}, //cyan
43 //New Colors Here...
44 {'k', 0, 0, 0xFF000000}, //black
45 {'v', 0, 0, 0xFFEB40EB}, //violet
46 {'w', 0, 0, 0xFFFFFFFF}, //white...
47 {'e', 0, 0, 0xFF505050}, //darkgrey
48 {'f', 0, 0, 0xFFAAAAAA}, //grey
49 {0} //POWER RANGERS GO!
50 };
51
52