00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "../Include/Ui.h"
00028 #include "../Include/Globals.h"
00029
00030
00031
00032
00033
00034 puText* puDebug1;
00035 puText* puDebug2;
00036 puText* puDebug3;
00037 char msgDebug1[256];
00038 char msgDebug2[256];
00039 char msgDebug3[256];
00040
00041
00042 void init_ui (void)
00043 {
00045 char *mark1 = new char[32];
00046 strcpy (mark1, "puInit Start");
00047 puInit ();
00048 char *mark2 = new char[32];
00049 strcpy (mark2, "puInit End");
00050
00051
00052 strcpy (msgDebug1, "");
00053 strcpy (msgDebug2, "");
00054 strcpy (msgDebug3, "");
00055
00056 puDebug1 = new puText (50, 500);
00057 puDebug2 = new puText (50, 480);
00058 puDebug3 = new puText (50, 460);
00059
00060 puDebug1->setColor (PUCOL_LABEL, 0.5, 0.5, 0.5);
00061 puDebug2->setColor (PUCOL_LABEL, 0.5, 0.5, 0.5);
00062 puDebug3->setColor (PUCOL_LABEL, 0.5, 0.5, 0.5);
00063
00064 puDebug1->setLabel (msgDebug1);
00065 puDebug2->setLabel (msgDebug2);
00066 puDebug3->setLabel (msgDebug3);
00067
00068
00069 init_menu ();
00070 }
00071
00072 void cleanup_ui (void)
00073 {
00074 delete puDebug1;
00075 delete puDebug2;
00076 delete puDebug3;
00077
00078 cleanup_menu ();
00079 }
00080
00081 void DebugMessage1 (const char* fmt, ...)
00082 {
00083 va_list argp;
00084 va_start(argp, fmt);
00085 vsprintf(msgDebug1, fmt, argp);
00086 va_end(argp);
00087
00088 puDebug1->setLabel (msgDebug1);
00089 }
00090
00091 void DebugMessage2 (const char* fmt, ...)
00092 {
00093 va_list argp;
00094 va_start(argp, fmt);
00095 vsprintf(msgDebug2, fmt, argp);
00096 va_end(argp);
00097
00098 puDebug2->setLabel (msgDebug2);
00099 }
00100
00101 void DebugMessage3 (const char* fmt, ...)
00102 {
00103 va_list argp;
00104 va_start(argp, fmt);
00105 vsprintf(msgDebug3, fmt, argp);
00106 va_end(argp);
00107
00108 puDebug3->setLabel (msgDebug3);
00109 }
00110
00111
00112
00113
00114
00115
00116
00117 void DrawUi (float dT)
00118 {
00119
00120 puDisplay ();
00121 }