#include "Genesis.h"#include "VidMode.h"Go to the source code of this file.
|
|
Definition at line 35 of file CONSOLE.H. Referenced by Console_HeaderPrintf(). |
|
|
Definition at line 34 of file CONSOLE.H. Referenced by Console_HeaderPrintf(), and PrintHeaderText(). |
|
|
Definition at line 33 of file CONSOLE.H. Referenced by Console_HeaderPrintf(). |
|
|
Definition at line 20 of file CONSOLE.H. Referenced by Client_CreateStatusBar(), PrintClientScores(), PrintCrossHair(), RenderWorld(), and SetupConsole(). |
|
|
Definition at line 30 of file CONSOLE.H. Referenced by Console_Frame(), Console_Scroll(), and MoveCursorPos(). |
|
|
|
|
||||||||||||
|
Definition at line 35 of file CONSOLE.C. References Console_Destroy(), Console_Printf(), Console_Console::DrawYPos, Engine, Console_Console::Engine, GE_FALSE, geRam_Allocate, NULL, SetupConsole(), VidMode, and Console_Console::VidMode. Referenced by GameMgr_SetDriverAndMode().
00036 {
00037 Console_Console *NewConsole;
00038
00039 NewConsole = geRam_Allocate(sizeof(Console_Console));
00040
00041 if (!NewConsole)
00042 return NULL;
00043
00044 memset(NewConsole, 0, sizeof(Console_Console));
00045
00046 NewConsole->Engine = Engine;
00047 NewConsole->VidMode = VidMode;
00048
00049 if (!SetupConsole(NewConsole))
00050 goto ExitWithError;
00051
00052 NewConsole->DrawYPos = -400.0f;
00053
00054 Console_Printf(NewConsole, " \n");
00055 Console_Printf(NewConsole, " \n");
00056
00057 return NewConsole;
00058
00059 // ERROR
00060 ExitWithError:
00061 {
00062 if (NewConsole)
00063 Console_Destroy(NewConsole);
00064
00065 return GE_FALSE;
00066 }
00067 }
|
|
|
Definition at line 72 of file CONSOLE.C. References Console_FreeResources(), Console_Console::Engine, and geRam_Free. Referenced by Console_Create(), GameMgr_FreeAllObjects(), and GameMgr_PrepareToChangeMode().
00073 {
00074 assert(Console);
00075 assert(Console->Engine);
00076
00077 Console_FreeResources(Console);
00078
00079 geRam_Free(Console);
00080 }
|
|
||||||||||||
|
Definition at line 416 of file CONSOLE.C. References Console_Console::Active, Console_Console::BGBitmap, GE_Rect::Bottom, Console_Console::CursorPos, Console_Console::DrawYPos, Console_Console::Engine, Console_Console::Fast, Console_Console::FontBitmap, Console_Console::FontHeight, Console_Console::FontLUT1, Console_Console::FontWidth, GE_TRUE, geBoolean, geEngine_DrawBitmap(), int32, GE_Rect::Left, NULL, PrintHeaderText(), Console_Console::PrintPos, GE_Rect::Right, Console_Console::StopY, TEXT_BUFFER_SIZE, Console_Console::TextBuffer, GE_Rect::Top, and y. Referenced by GameMgr_ConsolePrintf(), and WinMain().
00417 {
00418 int32 w, h;
00419 int32 x, y, PrintPos, YPos;
00420 char Val;
00421
00422 assert(Console);
00423
00424 PrintHeaderText(Console, Time);
00425
00426 if (Console->Active && Console->DrawYPos < 0)
00427 {
00428 Console->DrawYPos += Time*700.0f;
00429
00430 if (Console->DrawYPos > 0)
00431 Console->DrawYPos = 0.0f;
00432
00433 if (Console->Fast)
00434 Console->DrawYPos = 0;
00435 }
00436 else if (!Console->Active && Console->DrawYPos > -400)
00437 {
00438 Console->DrawYPos -= Time*700;
00439
00440 if (Console->DrawYPos < -400.0f)
00441 Console->DrawYPos = -400.0f;
00442
00443 if (Console->Fast)
00444 Console->DrawYPos = -400;
00445 }
00446
00447 if (Console->DrawYPos < -350)
00448 return GE_TRUE;
00449
00450 YPos = (int32)Console->DrawYPos;
00451
00452 for (h=0; h<3; h++)
00453 {
00454 for (w=0; w<5; w++)
00455 {
00456 geEngine_DrawBitmap(Console->Engine, Console->BGBitmap, NULL, w*128, h*128+YPos);
00457 }
00458 }
00459
00460 // Draw the TextBuffer
00461 PrintPos = Console->PrintPos;
00462 x = 0;
00463 y = 0;
00464 while (1) // Print till bottom of console, of till hit cursor pos
00465 {
00466 GE_Rect Rect;
00467 int32 PrintX, PrintY;
00468
00469 if (x >= 2)
00470 {
00471 if (PrintPos >= Console->CursorPos) // At cursor, stop printing
00472 break;
00473
00474 Val = Console->TextBuffer[PrintPos%TEXT_BUFFER_SIZE];
00475 PrintPos++;
00476
00477 if (Val == '\n') // Next line on enter
00478 {
00479 x = 0;
00480 y++;
00481
00482 if (y >= Console->StopY)
00483 break; // Bottom of console, so stop...
00484
00485 continue;
00486 }
00487 }
00488 else
00489 {
00490 if (x == 0)
00491 Val = '('; // Print (> for the first 2 characters
00492 else
00493 Val = '>';
00494 }
00495
00496
00497 PrintX = x*(Console->FontWidth+1);
00498 PrintY = y*(Console->FontHeight+1)+YPos;
00499
00500 // Print the character
00501 Rect.Left = (Console->FontLUT1[Val]>>16);
00502 Rect.Right = Rect.Left+Console->FontWidth;
00503 Rect.Top = (Console->FontLUT1[Val]&0xffff);
00504 Rect.Bottom = Rect.Top+Console->FontHeight;
00505 geEngine_DrawBitmap(Console->Engine, Console->FontBitmap, &Rect, PrintX, PrintY);
00506
00507 x++; // Advance one cursor pos
00508 }
00509
00510 return GE_TRUE;
00511 }
|
|
|
Definition at line 85 of file CONSOLE.C. References Console_Console::BGBitmap, Console_Console::Engine, Console_Console::FontBitmap, GE_TRUE, geBitmap_Destroy(), geBoolean, geEngine_RemoveBitmap(), and NULL. Referenced by Console_Destroy(), and SetupConsole().
00086 {
00087 geBoolean Ret;
00088
00089 // Free the background bitmap...
00090 if (Console->BGBitmap)
00091 {
00092 Ret = geEngine_RemoveBitmap(Console->Engine, Console->BGBitmap);
00093 assert(Ret == GE_TRUE);
00094 geBitmap_Destroy(&Console->BGBitmap);
00095 Console->BGBitmap = NULL;
00096 }
00097
00098 if (Console->FontBitmap)
00099 {
00100 Ret = geEngine_RemoveBitmap(Console->Engine, Console->FontBitmap);
00101 assert(Ret == GE_TRUE);
00102 geBitmap_Destroy(&Console->FontBitmap);
00103 Console->FontBitmap = NULL;
00104 }
00105 }
|
|
||||||||||||||||
|
Definition at line 231 of file CONSOLE.C. References Console_Console::Active, and Console_Console::Fast.
|
|
||||||||||||||||
|
Definition at line 137 of file CONSOLE.C. References Console_Console::CurrentHeader, GE_TRUE, geBoolean, HEADER_STAY_TIME, Console_Console::HeaderText, Console_Console::HeaderTime, MAX_HEADER_STRINGS, and MAX_HEADER_TEXT_SIZE. Referenced by ReadServerMessages().
00138 {
00139 va_list ArgPtr;
00140 char TempStr[256];
00141
00142 assert(Console);
00143 assert(Str);
00144
00145 assert(strlen(Str) < MAX_HEADER_TEXT_SIZE);
00146
00147 va_start (ArgPtr, Str);
00148 vsprintf (TempStr, Str, ArgPtr);
00149 va_end (ArgPtr);
00150
00151 assert(strlen(TempStr) < MAX_HEADER_TEXT_SIZE);
00152
00153 strcpy(Console->HeaderText[Console->CurrentHeader], TempStr);
00154 Console->HeaderTime[Console->CurrentHeader] = HEADER_STAY_TIME;
00155
00156 Console->CurrentHeader++;
00157 Console->CurrentHeader%=MAX_HEADER_STRINGS;
00158
00159 return GE_TRUE;
00160 }
|
|
||||||||||||||||
|
Definition at line 349 of file CONSOLE.C. References Console_ParseTokens(), Console_Scroll(), Console_Console::CursorPos, Console_Console::CursorX, Console_Console::CursorY, GE_FALSE, GE_TRUE, geBoolean, MoveCursorPos(), Console_Console::StopX, Console_Console::StopY, and Console_Console::TextBuffer. Referenced by Console_Printf(), and WndProc().
00350 {
00351 assert(Console);
00352
00353 if (Key == VK_LEFT || Key == VK_RIGHT || Key == VK_UP || Key == VK_DOWN || Key == VK_ESCAPE)
00354 return GE_TRUE;
00355
00356 if (Key == 33) // Page up
00357 {
00358 Console_Scroll(Console, -1, GE_FALSE);
00359
00360 return GE_TRUE;
00361 }
00362 else if (Key == 34) // Page down
00363 {
00364 Console_Scroll(Console, 1, GE_FALSE);
00365
00366 return GE_TRUE;
00367 }
00368 else if (Key == VK_RETURN || Key == '\n')
00369 {
00370 if (Console->CursorX <= 0)
00371 return GE_TRUE;
00372
00373 if (Console->CursorY < Console->StopY-1)
00374 Console->CursorY++;
00375 else // When it gets to the bottom of the screen, start scrolling...
00376 Console_Scroll(Console, 1, GE_TRUE);
00377
00378 Console->TextBuffer[Console->CursorPos] = '\n';
00379 MoveCursorPos(Console, 1);
00380
00381 if (Cmd)
00382 Console_ParseTokens(Console);
00383
00384 // Must set to 0 after parse tokens, so it can use it to see where we are in the
00385 // buffer
00386 Console->CursorX = 0;
00387
00388 return GE_TRUE;
00389 }
00390 else if (Key == VK_BACK)
00391 {
00392 if (Console->CursorX <= 0)
00393 return GE_TRUE;
00394
00395 Console->CursorX--;
00396 MoveCursorPos(Console, -1);
00397
00398 return GE_TRUE;
00399 }
00400 else if (Console->CursorX >= Console->StopX) // Too much on one line
00401 return GE_TRUE;
00402
00403 //Console->TokenBuffer[Console->CursorX] = Key;
00404 Console->TextBuffer[Console->CursorPos] = (char)Key;
00405
00406 Console->CursorX++;
00407
00408 MoveCursorPos(Console, 1);
00409
00410 return GE_TRUE;
00411 }
|
|
||||||||||||||||
|
Definition at line 110 of file CONSOLE.C. References Console_KeyDown(), GE_FALSE, GE_TRUE, geBoolean, and int32. Referenced by Client_Create(), Client_MovePlayerModel(), Console_Create(), Console_ParseTokens(), GameMgr_ConsolePrintf(), GameMgr_SetDriverAndMode(), Host_Create(), ParseClientMessage(), Server_BotConnect(), Server_ClientConnect(), Server_ClientDisconnect(), Server_ConsolePrintf(), Server_Create(), Server_CreatePlayer(), Server_GetNextPlayer(), Server_MovePlayerModel(), Server_SetClientHealth(), Server_SetClientScore(), Server_SetViewPlayer(), and WndProc().
00111 {
00112 va_list ArgPtr;
00113 char TempStr[500];
00114 int32 Length, i;
00115
00116 assert(Console);
00117 assert(Str);
00118
00119 va_start (ArgPtr, Str);
00120 vsprintf (TempStr, Str, ArgPtr);
00121 va_end (ArgPtr);
00122
00123 Length = strlen(TempStr);
00124
00125 // Insert the text a key at a time, through the normal KeyDown pipeline...
00126 for (i=0; i< Length; i++)
00127 {
00128 Console_KeyDown(Console, TempStr[i], GE_FALSE);
00129 }
00130
00131 return GE_TRUE;
00132 }
|
|
||||||||||||||||
|
Definition at line 240 of file CONSOLE.C. References Console_Console::Active, and Console_Console::Fast.
|
|
|
Definition at line 219 of file CONSOLE.C. References Console_Console::Active, GE_TRUE, and geBoolean. Referenced by WndProc().
|
|
||||||||||||||||||||||||||||
|
Definition at line 166 of file CONSOLE.C. References GE_Rect::Bottom, Console_Console::Engine, Console_Console::FontBitmap, Console_Console::FontHeight, Console_Console::FontLUT1, Console_Console::FontWidth, GE_TRUE, geBoolean, geEngine_DrawBitmap(), int32, GE_Rect::Left, GE_Rect::Right, GE_Rect::Top, and y. Referenced by DrawStatusBar(), PrintClientScores(), PrintCrossHair(), PrintHeaderText(), and WinMain().
00167 {
00168 va_list ArgPtr;
00169 char TempStr[500];
00170 int32 Length, i;
00171 int32 StartX, StartY, SkipX;
00172
00173 assert(Console);
00174 assert(Str);
00175
00176 va_start (ArgPtr, Str);
00177 vsprintf (TempStr, Str, ArgPtr);
00178 va_end (ArgPtr);
00179
00180 Length = strlen(TempStr);
00181
00182 if (!Flags)
00183 {
00184 SkipX = Console->FontWidth+1;
00185 StartY = y*Console->FontHeight+1;
00186 }
00187 else
00188 {
00189 SkipX = 1;
00190 StartY = y;
00191 }
00192
00193 StartX = x*SkipX;
00194
00195 for (i=0; i< Length; i++)
00196 {
00197 GE_Rect Rect;
00198 char Val;
00199
00200 Val = Val = TempStr[i];
00201
00202 // Print the character
00203 Rect.Left = (Console->FontLUT1[Val]>>16);
00204 Rect.Right = Rect.Left+Console->FontWidth;
00205 Rect.Top = (Console->FontLUT1[Val]&0xffff);
00206 Rect.Bottom = Rect.Top+Console->FontHeight;
00207
00208 geEngine_DrawBitmap(Console->Engine, Console->FontBitmap, &Rect, StartX, StartY);
00209
00210 StartX+=(Console->FontWidth+1); // Advance one cursor pos
00211 }
00212
00213 return GE_TRUE;
00214 }
|
1.3.2