29 #include "../idlib/precompiled.h"
36 #define NUM_CON_TIMES 4
37 #define CON_TEXTSIZE 0x30000
38 #define TOTAL_LINES (CON_TEXTSIZE / LINE_WIDTH)
39 #define CONSOLE_FIRSTREPEAT 200
40 #define CONSOLE_REPEAT 100
42 #define COMMAND_HISTORY 64
49 virtual void Init(
void );
53 virtual bool Active(
void );
55 virtual void Close(
void );
56 virtual void Print(
const char *text );
57 virtual void Draw(
bool forceFullScreen );
59 void Dump(
const char *toFile );
150 va_start( argptr, text );
165 va_start( argptr, text );
194 frameTime = t - previous;
197 previousTimes[index %
FPS_FRAMES] = frameTime;
203 total += previousTimes[
i];
208 fps = 10000 * FPS_FRAMES / total;
211 s =
va(
"%ifps", fps );
245 int i, outgoingRate, incomingRate;
246 float outgoingCompression, incomingCompression;
261 if ( outgoingRate != -1 && incomingRate != -1 ) {
263 i, outgoingRate, outgoingCompression, incomingRate, incomingCompression );
278 if ( outgoingRate != -1 && incomingRate != -1 ) {
280 outgoingRate, outgoingCompression, incomingRate, incomingCompression );
299 int index, numActiveDecoders;
303 numActiveDecoders = 0;
308 if ( localTime > sampleTime ) {
310 percent = ( localTime % sampleTime ) * 100 / sampleTime;
315 percent = localTime * 100 / sampleTime;
330 static void Con_Clear_f(
const idCmdArgs &args ) {
331 localConsole.
Clear();
339 static void Con_Dump_f(
const idCmdArgs &args ) {
340 if ( args.
Argc() != 2 ) {
480 if ( ( line[x] & 0xff ) >
' ' )
482 if ( x != LINE_WIDTH )
490 buffer[
i] = line[
i] & 0xff;
492 for ( x = LINE_WIDTH-1; x >= 0; x-- ) {
493 if ( buffer[x] <=
' ' ) {
502 f->
Write( buffer, strlen( buffer ) );
603 if ( key ==
K_TAB ) {
612 if (
nextHistoryLine - historyLine < COMMAND_HISTORY && historyLine > 0 ) {
755 if ( !forceAccept && consoleKey ) {
854 #ifdef ID_ALLOW_TOOLS
864 while ( (c = *(
const unsigned char*)txt) != 0 ) {
879 if ( c >
' ' && (
x == 0 || text[y*
LINE_WIDTH+
x-1] <=
' ' ) ) {
882 if ( txt[l] <=
' ') {
888 if (l != LINE_WIDTH && (
x + l >= LINE_WIDTH) ) {
948 int y, autoCompleteLength;
955 if ( autoCompleteLength > 0 ) {
1009 if ( ( text_p[x] & 0xff ) ==
' ' ) {
1069 for ( x = 0; x <
i; x++ ) {
1114 if ( ( text_p[x] & 0xff ) ==
' ' ) {
1147 if ( forceFullScreen ) {
1159 if ( forceFullScreen ) {
void Draw(int x, int y, int width, bool showCursor, const idMaterial *material)
const int MAX_ASYNC_CLIENTS
virtual void SetColor(const idVec4 &rgba)=0
const int C_COLOR_DEFAULT
idCVar com_showSoundDecoders("com_showSoundDecoders","0", CVAR_BOOL|CVAR_SYSTEM|CVAR_NOCHEAT,"show sound decoders")
void Mem_ClearFrameStats(void)
idCVarSystem * cvarSystem
void MaterialEditorPrintConsole(const char *msg)
Allows the doom engine to reflect console output to the material editors console. ...
GLenum GLsizei GLenum format
void Mem_GetStats(memoryStats_t &stats)
float GetFloat(void) const
void DrawSolidConsole(float frac)
idCVar com_showMemoryUsage("com_showMemoryUsage","0", CVAR_BOOL|CVAR_SYSTEM|CVAR_NOCHEAT,"show total and per frame memory usage")
idCVar com_showAsyncStats("com_showAsyncStats","0", CVAR_BOOL|CVAR_SYSTEM|CVAR_NOCHEAT,"show async network stats")
static idAsyncClient client
idRenderSystem * renderSystem
float SCR_DrawAsyncStats(float y)
int Sys_Milliseconds(void)
idFileSystem * fileSystem
void UpdateDisplayFraction(void)
idCVar com_showFPS("com_showFPS","0", CVAR_BOOL|CVAR_SYSTEM|CVAR_ARCHIVE|CVAR_NOCHEAT,"show frames rendered per second")
static int ColorIndex(int c)
static idCVar con_notifyTime
virtual int GetSoundDecoderInfo(int index, soundDecoderInfo_t &decoderInfo)=0
void ClearAutoComplete(void)
virtual void RemoveCommand(const char *cmdName)=0
void void SCR_DrawTextRightAlign(float &y, const char *text,...) id_attribute((format(printf
float GetIncomingCompression(void) const
virtual const idMaterial * FindMaterial(const char *name, bool makeDefault=true)=0
virtual void DrawSmallChar(int x, int y, int ch, const idMaterial *material)=0
idStr & DefaultFileExtension(const char *extension)
virtual void Draw(bool forceFullScreen)
virtual void ClearNotifyLines(void)
static idVec4 & ColorForIndex(int i)
float SCR_DrawSoundDecoders(float y)
virtual void BufferCommandText(cmdExecution_t exec, const char *text)=0
float SCR_DrawMemoryUsage(float y)
virtual bool Active(void)
float GetClientOutgoingCompression(int clientNum) const
virtual void Print(const char *text)
const int SMALLCHAR_WIDTH
void KeyDownEvent(int key)
GLubyte GLubyte GLubyte GLubyte w
static idAsyncServer server
static int FtoiFast(float f)
unsigned char Sys_GetConsoleKey(bool shifted)
void RadiantPrint(const char *text)
virtual void DrawSmallStringExt(int x, int y, const char *string, const idVec4 &setColor, bool forceColor, const idMaterial *material)=0
void KeyDownEvent(int key)
int GetAutoCompleteLength(void) const
virtual void SetCVarBool(const char *name, const bool value, int flags=0)=0
virtual idFile * OpenFileWrite(const char *relativePath, const char *basePath="fs_savepath")=0
void Mem_GetFrameStats(memoryStats_t &allocs, memoryStats_t &frees)
void SetDisplayFraction(float frac)
virtual void LoadGraphics(void)
float GetOutgoingCompression(void) const
void GetAsyncStatsAvgMsg(idStr &msg)
virtual void SetColor4(float r, float g, float b, float a)=0
int GetClientIncomingRate(int clientNum) const
virtual void UpdateScreen(bool outOfSequence=true)=0
virtual void Printf(const char *fmt,...) id_attribute((format(printf
int GetOutgoingRate(void) const
float SCR_DrawFPS(float y)
virtual void DrawStretchPic(const idDrawVert *verts, const glIndex_t *indexes, int vertCount, int indexCount, const idMaterial *material, bool clip=true, float min_x=0.0f, float min_y=0.0f, float max_x=640.0f, float max_y=480.0f)=0
const idMaterial * consoleShader
idDeclManager * declManager
virtual void DrawBigStringExt(int x, int y, const char *string, const idVec4 &setColor, bool forceColor, const idMaterial *material)=0
idCVar com_allowConsole("com_allowConsole","0", CVAR_BOOL|CVAR_SYSTEM|CVAR_NOCHEAT,"allow toggling console with the tilde key")
virtual bool ProcessEvent(const sysEvent_t *event, bool forceAccept)
int GetClientOutgoingRate(int clientNum) const
static int static int vsnPrintf(char *dest, int size, const char *fmt, va_list argptr)
GLenum GLenum GLvoid * row
const idMaterial * whiteShader
static idCVar con_noPrint
idEditField historyEditLines[COMMAND_HISTORY]
idSoundSystem * soundSystem
void SetWidthInChars(int w)
virtual int Write(const void *buffer, int len)
const int SMALLCHAR_HEIGHT
float GetClientIncomingCompression(int clientNum) const
void Dump(const char *toFile)
const char * c_str(void) const
const char * Argv(int arg) const
virtual void Shutdown(void)
#define CONSOLE_FIRSTREPEAT
char * va(const char *fmt,...)
virtual void CloseFile(idFile *f)=0
int GetIncomingRate(void) const
virtual void virtual void Warning(const char *fmt,...) id_attribute((format(printf
const idMaterial * charSetShader
virtual void AddCommand(const char *cmdName, cmdFunction_t function, int flags, const char *description, argCompletion_t argCompletion=NULL)=0
void SCR_DrawTextLeftAlign(float &y, const char *text,...) id_attribute((format(printf
void Sys_GrabMouseCursor(bool)