00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __CONSOLE_H__
00016 #define __CONSOLE_H__
00017
00018 #include "Genesis.h"
00019
00020 #define SMALL_CONSOLE_CUTOFF_WIDTH (640)
00021
00022 #include "VidMode.h"
00023
00024 #ifdef __cplusplus
00025 extern "C" {
00026 #endif
00027
00028
00029
00030 #define TEXT_BUFFER_SIZE 4096 // 4k text buffer should do it...
00031 #define TOKEN_BUFFER_SIZE 1024
00032
00033 #define MAX_HEADER_TEXT_SIZE 128
00034 #define MAX_HEADER_STRINGS 4
00035 #define HEADER_STAY_TIME 5.0f
00036
00037 typedef struct
00038 {
00039 geBoolean Active;
00040 geBoolean Fast;
00041
00042 geEngine *Engine;
00043
00044
00045 VidMode VidMode;
00046
00047
00048 float DrawYPos;
00049
00050
00051 char TokenBuffer[TOKEN_BUFFER_SIZE];
00052 char TextBuffer[TEXT_BUFFER_SIZE];
00053 int32 PrintPos;
00054 int32 CursorPos;
00055 int32 CursorX;
00056 int32 CursorY;
00057
00058 int32 BackScroll;
00059 int32 Scroll;
00060
00061 int32 StopX;
00062 int32 StopY;
00063
00064 geBitmap *BGBitmap;
00065
00066
00067 int32 FontWidth;
00068 int32 FontHeight;
00069 int32 FontLUT1[128];
00070 geBitmap *FontBitmap;
00071
00072 char HeaderText[MAX_HEADER_STRINGS][MAX_HEADER_TEXT_SIZE];
00073 float HeaderTime[MAX_HEADER_STRINGS];
00074 int32 CurrentHeader;
00075
00076
00077 void *UserData;
00078
00079 } Console_Console;
00080
00081
00082
00083 Console_Console *Console_Create(geEngine *Engine, VidMode VidMode);
00084 void Console_Destroy(Console_Console *Console);
00085 void Console_FreeResources(Console_Console *Console);
00086 geBoolean Console_Printf(Console_Console *Console, const char *Str, ...);
00087 geBoolean Console_HeaderPrintf(Console_Console *Console, const char *Str, ...);
00088 geBoolean Console_XYPrintf(Console_Console *Console, int32 x, int32 y, uint32 Flags, const char *Str, ...);
00089 geBoolean Console_ToggleActive(Console_Console *Console);
00090 void Console_GetActive(Console_Console *Console, geBoolean *Active, geBoolean *Fast);
00091 void Console_SetActive(Console_Console *Console, geBoolean Active, geBoolean Fast);
00092 geBoolean Console_KeyDown(Console_Console *Console, int32 Key, geBoolean Cmd);
00093 geBoolean Console_Frame(Console_Console *Console, float Time);
00094
00095 #endif