ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/src/Daodan_Console.c
Revision: 437
Committed: Fri Jul 17 05:04:02 2009 UTC (16 years, 2 months ago) by rossy
Content type: text/x-csrc
File size: 529 byte(s)
Log Message:
Daodan_Console

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_PrintF(const char* fmt, ...)
14 {
15 va_list ap;
16 va_start(ap, fmt);
17 char* buffer = malloc(vsnprintf(NULL, 0, fmt, ap) + 1);
18
19 vsprintf(buffer, fmt, ap);
20 va_end(ap);
21
22 DDrConsole_Print(buffer);
23 free(buffer);
24 return;
25 }