summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2005-12-11 16:41:27 +0000
committerTim Angus <tim@ngus.net>2005-12-11 16:41:27 +0000
commit65b823bf367034c204d370a6a73965a196072153 (patch)
treeb7473da41151546fad6252ec70ca14b92b77046d /src/client
parentd28c9b3a4178a8d653dc479d385f60969c241bdb (diff)
* Added trap_FS_GetFileList to cgame, so it's not longer necessary to hack
around it not being there * Removed Q3 console notify code and improved cgame rendered notify area * Sorted out pain blend texture coordinates
Diffstat (limited to 'src/client')
-rw-r--r--src/client/cl_cgame.c17
-rw-r--r--src/client/cl_console.c130
-rw-r--r--src/client/client.h1
3 files changed, 26 insertions, 122 deletions
diff --git a/src/client/cl_cgame.c b/src/client/cl_cgame.c
index 87099923..38293518 100644
--- a/src/client/cl_cgame.c
+++ b/src/client/cl_cgame.c
@@ -444,6 +444,9 @@ long CL_CgameSystemCalls( long *args ) {
case CG_ARGS:
Cmd_ArgsBuffer( VMA(1), args[2] );
return 0;
+ case CG_LITERAL_ARGS:
+ Cmd_LiteralArgsBuffer( VMA(1), args[2] );
+ return 0;
case CG_FS_FOPENFILE:
return FS_FOpenFileByMode( VMA(1), VMA(2), args[3] );
case CG_FS_READ:
@@ -457,6 +460,8 @@ long CL_CgameSystemCalls( long *args ) {
return 0;
case CG_FS_SEEK:
return FS_Seek( args[1], args[2], args[3] );
+ case CG_FS_GETFILELIST:
+ return FS_GetFileList( VMA(1), VMA(2), VMA(3), args[4] );
case CG_SENDCONSOLECOMMAND:
Cbuf_AddText( VMA(1) );
return 0;
@@ -785,6 +790,18 @@ qboolean CL_GameCommand( void ) {
return VM_Call( cgvm, CG_CONSOLE_COMMAND );
}
+/*
+====================
+CL_GameConsoleText
+====================
+*/
+void CL_GameConsoleText( void ) {
+ if ( !cgvm ) {
+ return;
+ }
+
+ VM_Call( cgvm, CG_CONSOLE_TEXT );
+}
/*
diff --git a/src/client/cl_console.c b/src/client/cl_console.c
index 350dc604..27deb623 100644
--- a/src/client/cl_console.c
+++ b/src/client/cl_console.c
@@ -49,8 +49,6 @@ typedef struct {
int vislines; // in scanlines
- int times[NUM_CON_TIMES]; // cls.realtime time the line was generated
- // for transparent notify lines
vec4_t color;
} console_t;
@@ -59,7 +57,6 @@ extern console_t con;
console_t con;
cvar_t *con_conspeed;
-cvar_t *con_notifytime;
#define DEFAULT_CONSOLE_WIDTH 78
@@ -81,7 +78,6 @@ void Con_ToggleConsole_f (void) {
Field_Clear( &g_consoleField );
g_consoleField.widthInChars = g_console_field_width;
- Con_ClearNotify ();
cls.keyCatchers ^= KEYCATCH_CONSOLE;
}
@@ -230,11 +226,8 @@ Con_ClearNotify
================
*/
void Con_ClearNotify( void ) {
- int i;
-
- for ( i = 0 ; i < NUM_CON_TIMES ; i++ ) {
- con.times[i] = 0;
- }
+ Cmd_TokenizeString( NULL );
+ CL_GameConsoleText( );
}
@@ -296,8 +289,6 @@ void Con_CheckResize (void)
oldtotallines) * oldwidth + j];
}
}
-
- Con_ClearNotify ();
}
con.current = con.totallines - 1;
@@ -313,7 +304,6 @@ Con_Init
void Con_Init (void) {
int i;
- con_notifytime = Cvar_Get ("con_notifytime", "3", 0);
con_conspeed = Cvar_Get ("scr_conspeed", "3", 0);
Field_Clear( &g_consoleField );
@@ -342,15 +332,6 @@ void Con_Linefeed (qboolean skipnotify)
{
int i;
- // mark time for transparent overlay
- if (con.current >= 0)
- {
- if (skipnotify)
- con.times[con.current % NUM_CON_TIMES] = 0;
- else
- con.times[con.current % NUM_CON_TIMES] = cls.realtime;
- }
-
con.x = 0;
if (con.display == con.current)
con.display++;
@@ -373,7 +354,6 @@ void CL_ConsolePrint( char *txt ) {
int c, l;
int color;
qboolean skipnotify = qfalse; // NERVE - SMF
- int prev; // NERVE - SMF
// TTimo - prefix for text that shows up in console but not in notify
// backported from RTCW
@@ -397,6 +377,12 @@ void CL_ConsolePrint( char *txt ) {
con.initialized = qtrue;
}
+ if( !skipnotify && !( cls.keyCatchers & KEYCATCH_CONSOLE ) ) {
+ // feed the text to cgame
+ Cmd_TokenizeString( txt );
+ CL_GameConsoleText( );
+ }
+
color = ColorIndex(COLOR_WHITE);
while ( (c = *txt) != 0 ) {
@@ -441,21 +427,6 @@ void CL_ConsolePrint( char *txt ) {
break;
}
}
-
-
- // mark time for transparent overlay
- if (con.current >= 0) {
- // NERVE - SMF
- if ( skipnotify ) {
- prev = con.current % NUM_CON_TIMES - 1;
- if ( prev < 0 )
- prev = NUM_CON_TIMES - 1;
- con.times[prev] = 0;
- }
- else
- // -NERVE - SMF
- con.times[con.current % NUM_CON_TIMES] = cls.realtime;
- }
}
@@ -492,85 +463,6 @@ void Con_DrawInput (void) {
SCREEN_WIDTH - 3 * SMALLCHAR_WIDTH, qtrue );
}
-
-/*
-================
-Con_DrawNotify
-
-Draws the last few lines of output transparently over the game top
-================
-*/
-void Con_DrawNotify (void)
-{
- int x, v;
- short *text;
- int i;
- int time;
- int skip;
- int currentColor;
-
- currentColor = 7;
- re.SetColor( g_color_table[currentColor] );
-
- v = 0;
- for (i= con.current-NUM_CON_TIMES+1 ; i<=con.current ; i++)
- {
- if (i < 0)
- continue;
- time = con.times[i % NUM_CON_TIMES];
- if (time == 0)
- continue;
- time = cls.realtime - time;
- if (time > con_notifytime->value*1000)
- continue;
- text = con.text + (i % con.totallines)*con.linewidth;
-
- if (cl.snap.ps.pm_type != PM_INTERMISSION && cls.keyCatchers & (KEYCATCH_UI | KEYCATCH_CGAME) ) {
- continue;
- }
-
- for (x = 0 ; x < con.linewidth ; x++) {
- if ( ( text[x] & 0xff ) == ' ' ) {
- continue;
- }
- if ( ( (text[x]>>8)&7 ) != currentColor ) {
- currentColor = (text[x]>>8)&7;
- re.SetColor( g_color_table[currentColor] );
- }
- SCR_DrawSmallChar( cl_conXOffset->integer + con.xadjust + (x+1)*SMALLCHAR_WIDTH, v, text[x] & 0xff );
- }
-
- v += SMALLCHAR_HEIGHT;
- }
-
- re.SetColor( NULL );
-
- if (cls.keyCatchers & (KEYCATCH_UI | KEYCATCH_CGAME) ) {
- return;
- }
-
- // draw the chat line
- if ( cls.keyCatchers & KEYCATCH_MESSAGE )
- {
- if (chat_team)
- {
- SCR_DrawBigString (8, v, "say_team:", 1.0f );
- skip = 11;
- }
- else
- {
- SCR_DrawBigString (8, v, "say:", 1.0f );
- skip = 5;
- }
-
- Field_BigDraw( &chatField, skip * BIGCHAR_WIDTH, v,
- SCREEN_WIDTH - ( skip + 1 ) * BIGCHAR_WIDTH, qtrue );
-
- v += BIGCHAR_HEIGHT;
- }
-
-}
-
/*
================
Con_DrawSolidConsole
@@ -707,11 +599,6 @@ void Con_DrawConsole( void ) {
if ( con.displayFrac ) {
Con_DrawSolidConsole( con.displayFrac );
- } else {
- // draw notify lines
- if ( cls.state == CA_ACTIVE ) {
- Con_DrawNotify ();
- }
}
}
@@ -780,7 +667,6 @@ void Con_Close( void ) {
return;
}
Field_Clear( &g_consoleField );
- Con_ClearNotify ();
cls.keyCatchers &= ~KEYCATCH_CONSOLE;
con.finalFrac = 0; // none visible
con.displayFrac = 0;
diff --git a/src/client/client.h b/src/client/client.h
index dab92159..eff15d51 100644
--- a/src/client/client.h
+++ b/src/client/client.h
@@ -497,6 +497,7 @@ void CIN_CloseAllVideos(void);
void CL_InitCGame( void );
void CL_ShutdownCGame( void );
qboolean CL_GameCommand( void );
+void CL_GameConsoleText( void );
void CL_CGameRendering( stereoFrame_t stereo );
void CL_SetCGameTime( void );
void CL_FirstSnapshot( void );