summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2007-09-22 20:55:11 +0000
committerTim Angus <tim@ngus.net>2007-09-22 20:55:11 +0000
commit6eb2ff79c06c6d5acab3070937a680ff3494ba50 (patch)
tree4d14fb84712d4c7a1c2ed19b2056b0e40b445d4b /src/client
parent0edfa2794ebbcc7019093e5d88b7ca7269704902 (diff)
* Merge of ioq3-r1186
Diffstat (limited to 'src/client')
-rw-r--r--src/client/cl_console.c9
-rw-r--r--src/client/cl_curl.c8
-rw-r--r--src/client/cl_curl.h4
-rw-r--r--src/client/cl_keys.c51
-rw-r--r--src/client/cl_main.c10
-rw-r--r--src/client/cl_scrn.c22
-rw-r--r--src/client/client.h8
-rw-r--r--src/client/keys.h4
-rw-r--r--src/client/qal.c4
-rw-r--r--src/client/qal.h6
-rw-r--r--src/client/snd_codec.c2
-rw-r--r--src/client/snd_codec_ogg.c2
-rw-r--r--src/client/snd_openal.c4
13 files changed, 66 insertions, 68 deletions
diff --git a/src/client/cl_console.c b/src/client/cl_console.c
index 14bc65be..9d2d8e7c 100644
--- a/src/client/cl_console.c
+++ b/src/client/cl_console.c
@@ -464,7 +464,7 @@ void Con_DrawInput (void) {
SCR_DrawSmallChar( con.xadjust + 1 * SMALLCHAR_WIDTH, y, ']' );
Field_Draw( &g_consoleField, con.xadjust + 2 * SMALLCHAR_WIDTH, y,
- SCREEN_WIDTH - 3 * SMALLCHAR_WIDTH, qtrue );
+ SCREEN_WIDTH - 3 * SMALLCHAR_WIDTH, qtrue, qtrue );
}
/*
@@ -520,7 +520,6 @@ void Con_DrawSolidConsole( float frac ) {
for (x=0 ; x<i ; x++) {
SCR_DrawSmallChar( cls.glconfig.vidWidth - ( i - x ) * SMALLCHAR_WIDTH,
-
(lines-(SMALLCHAR_HEIGHT+SMALLCHAR_HEIGHT/2)), Q3_VERSION[x] );
}
@@ -615,17 +614,17 @@ void Con_DrawConsole( void ) {
if( chat_team )
{
- SCR_DrawBigString( 8, 232, "Team Say:", 1.0f );
+ SCR_DrawBigString( 8, 232, "Team Say:", 1.0f, qfalse );
skip = 11;
}
else
{
- SCR_DrawBigString( 8, 232, "Say:", 1.0f );
+ SCR_DrawBigString( 8, 232, "Say:", 1.0f, qfalse );
skip = 5;
}
Field_BigDraw( &chatField, skip * BIGCHAR_WIDTH, 232,
- SCREEN_WIDTH - ( skip + 1 ) * BIGCHAR_WIDTH, qtrue );
+ SCREEN_WIDTH - ( skip + 1 ) * BIGCHAR_WIDTH, qtrue, qtrue );
}
}
diff --git a/src/client/cl_curl.c b/src/client/cl_curl.c
index d15cbba8..96bd7abc 100644
--- a/src/client/cl_curl.c
+++ b/src/client/cl_curl.c
@@ -20,11 +20,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
-#if USE_CURL
+#ifdef USE_CURL
#include "client.h"
cvar_t *cl_cURLLib;
-#if USE_CURL_DLOPEN
+#ifdef USE_CURL_DLOPEN
#include "../sys/sys_loadlib.h"
char* (*qcurl_version)(void);
@@ -88,7 +88,7 @@ CL_cURL_Init
*/
qboolean CL_cURL_Init()
{
-#if USE_CURL_DLOPEN
+#ifdef USE_CURL_DLOPEN
if(cURLLib)
return qtrue;
@@ -156,7 +156,7 @@ CL_cURL_Shutdown
void CL_cURL_Shutdown( void )
{
CL_cURL_Cleanup();
-#if USE_CURL_DLOPEN
+#ifdef USE_CURL_DLOPEN
if(cURLLib)
{
Sys_UnloadLibrary(cURLLib);
diff --git a/src/client/cl_curl.h b/src/client/cl_curl.h
index 7b3f8929..08aec802 100644
--- a/src/client/cl_curl.h
+++ b/src/client/cl_curl.h
@@ -37,14 +37,14 @@ extern cvar_t *cl_cURLLib;
#define DEFAULT_CURL_LIB "libcurl.so.3"
#endif
-#if USE_LOCAL_HEADERS
+#ifdef USE_LOCAL_HEADERS
#include "../libcurl/curl/curl.h"
#else
#include <curl/curl.h>
#endif
-#if USE_CURL_DLOPEN
+#ifdef USE_CURL_DLOPEN
extern char* (*qcurl_version)(void);
extern CURL* (*qcurl_easy_init)(void);
diff --git a/src/client/cl_keys.c b/src/client/cl_keys.c
index 1ce97418..e6e8261c 100644
--- a/src/client/cl_keys.c
+++ b/src/client/cl_keys.c
@@ -310,7 +310,8 @@ Handles horizontal scrolling and cursor blinking
x, y, and width are in pixels
===================
*/
-void Field_VariableSizeDraw( field_t *edit, int x, int y, int width, int size, qboolean showCursor ) {
+void Field_VariableSizeDraw( field_t *edit, int x, int y, int width, int size, qboolean showCursor,
+ qboolean noColorEscape ) {
int len;
int drawLen;
int prestep;
@@ -351,47 +352,45 @@ void Field_VariableSizeDraw( field_t *edit, int x, int y, int width, int size, q
float color[4];
color[0] = color[1] = color[2] = color[3] = 1.0;
- SCR_DrawSmallStringExt( x, y, str, color, qfalse );
+ SCR_DrawSmallStringExt( x, y, str, color, qfalse, noColorEscape );
} else {
// draw big string with drop shadow
- SCR_DrawBigString( x, y, str, 1.0 );
+ SCR_DrawBigString( x, y, str, 1.0, noColorEscape );
}
// draw the cursor
- if ( !showCursor ) {
- return;
- }
-
- if ( (int)( cls.realtime >> 8 ) & 1 ) {
- return; // off blink
- }
+ if ( showCursor ) {
+ if ( (int)( cls.realtime >> 8 ) & 1 ) {
+ return; // off blink
+ }
- if ( key_overstrikeMode ) {
- cursorChar = 11;
- } else {
- cursorChar = 10;
- }
+ if ( key_overstrikeMode ) {
+ cursorChar = 11;
+ } else {
+ cursorChar = 10;
+ }
- i = drawLen - Q_PrintStrlen( str );
+ i = drawLen - strlen( str );
- if ( size == SMALLCHAR_WIDTH ) {
- SCR_DrawSmallChar( x + ( edit->cursor - prestep - i ) * size, y, cursorChar );
- } else {
- str[0] = cursorChar;
- str[1] = 0;
- SCR_DrawBigString( x + ( edit->cursor - prestep - i ) * size, y, str, 1.0 );
+ if ( size == SMALLCHAR_WIDTH ) {
+ SCR_DrawSmallChar( x + ( edit->cursor - prestep - i ) * size, y, cursorChar );
+ } else {
+ str[0] = cursorChar;
+ str[1] = 0;
+ SCR_DrawBigString( x + ( edit->cursor - prestep - i ) * size, y, str, 1.0, qfalse );
+ }
}
}
-void Field_Draw( field_t *edit, int x, int y, int width, qboolean showCursor )
+void Field_Draw( field_t *edit, int x, int y, int width, qboolean showCursor, qboolean noColorEscape )
{
- Field_VariableSizeDraw( edit, x, y, width, SMALLCHAR_WIDTH, showCursor );
+ Field_VariableSizeDraw( edit, x, y, width, SMALLCHAR_WIDTH, showCursor, noColorEscape );
}
-void Field_BigDraw( field_t *edit, int x, int y, int width, qboolean showCursor )
+void Field_BigDraw( field_t *edit, int x, int y, int width, qboolean showCursor, qboolean noColorEscape )
{
- Field_VariableSizeDraw( edit, x, y, width, BIGCHAR_WIDTH, showCursor );
+ Field_VariableSizeDraw( edit, x, y, width, BIGCHAR_WIDTH, showCursor, noColorEscape );
}
/*
diff --git a/src/client/cl_main.c b/src/client/cl_main.c
index 80c35db1..fc73ad47 100644
--- a/src/client/cl_main.c
+++ b/src/client/cl_main.c
@@ -736,7 +736,7 @@ CL_ShutdownAll
*/
void CL_ShutdownAll(void) {
-#if USE_CURL
+#ifdef USE_CURL
CL_cURL_Shutdown();
#endif
// clear sounds
@@ -1415,7 +1415,7 @@ Called when all downloading has been completed
*/
void CL_DownloadsComplete( void ) {
-#if USE_CURL
+#ifdef USE_CURL
// if we downloaded with cURL
if(clc.cURLUsed) {
clc.cURLUsed = qfalse;
@@ -1546,7 +1546,7 @@ void CL_NextDownload(void) {
*s++ = 0;
else
s = localName + strlen(localName); // point at the nul byte
-#if USE_CURL
+#ifdef USE_CURL
if(!(cl_allowDownload->integer & DLF_NO_REDIRECT)) {
if(clc.sv_allowDownload & DLF_NO_REDIRECT) {
Com_Printf("WARNING: server does not "
@@ -2162,7 +2162,7 @@ void CL_Frame ( int msec ) {
return;
}
-#if USE_CURL
+#ifdef USE_CURL
if(clc.downloadCURLM) {
CL_cURL_PerformDownload();
// we can't process frames normally when in disconnected
@@ -2653,7 +2653,7 @@ void CL_Init( void ) {
cl_showMouseRate = Cvar_Get ("cl_showmouserate", "0", 0);
cl_allowDownload = Cvar_Get ("cl_allowDownload", "0", CVAR_ARCHIVE);
-#if USE_CURL
+#ifdef USE_CURL
cl_cURLLib = Cvar_Get("cl_cURLLib", DEFAULT_CURL_LIB, CVAR_ARCHIVE);
#endif
diff --git a/src/client/cl_scrn.c b/src/client/cl_scrn.c
index a8d37e22..f5c6cb9b 100644
--- a/src/client/cl_scrn.c
+++ b/src/client/cl_scrn.c
@@ -197,7 +197,8 @@ to a fixed color.
Coordinates are at 640 by 480 virtual resolution
==================
*/
-void SCR_DrawStringExt( int x, int y, float size, const char *string, float *setColor, qboolean forceColor ) {
+void SCR_DrawStringExt( int x, int y, float size, const char *string, float *setColor, qboolean forceColor,
+ qboolean noColorEscape ) {
vec4_t color;
const char *s;
int xx;
@@ -209,7 +210,7 @@ void SCR_DrawStringExt( int x, int y, float size, const char *string, float *set
s = string;
xx = x;
while ( *s ) {
- if ( Q_IsColorString( s ) ) {
+ if ( !noColorEscape && Q_IsColorString( s ) ) {
s += 2;
continue;
}
@@ -224,7 +225,7 @@ void SCR_DrawStringExt( int x, int y, float size, const char *string, float *set
xx = x;
re.SetColor( setColor );
while ( *s ) {
- if ( Q_IsColorString( s ) ) {
+ if ( !noColorEscape && Q_IsColorString( s ) ) {
if ( !forceColor ) {
Com_Memcpy( color, g_color_table[ColorIndex(*(s+1))], sizeof( color ) );
color[3] = setColor[3];
@@ -241,16 +242,16 @@ void SCR_DrawStringExt( int x, int y, float size, const char *string, float *set
}
-void SCR_DrawBigString( int x, int y, const char *s, float alpha ) {
+void SCR_DrawBigString( int x, int y, const char *s, float alpha, qboolean noColorEscape ) {
float color[4];
color[0] = color[1] = color[2] = 1.0;
color[3] = alpha;
- SCR_DrawStringExt( x, y, BIGCHAR_WIDTH, s, color, qfalse );
+ SCR_DrawStringExt( x, y, BIGCHAR_WIDTH, s, color, qfalse, noColorEscape );
}
-void SCR_DrawBigStringColor( int x, int y, const char *s, vec4_t color ) {
- SCR_DrawStringExt( x, y, BIGCHAR_WIDTH, s, color, qtrue );
+void SCR_DrawBigStringColor( int x, int y, const char *s, vec4_t color, qboolean noColorEscape ) {
+ SCR_DrawStringExt( x, y, BIGCHAR_WIDTH, s, color, qtrue, noColorEscape );
}
@@ -260,11 +261,10 @@ SCR_DrawSmallString[Color]
Draws a multi-colored string with a drop shadow, optionally forcing
to a fixed color.
-
-Coordinates are at 640 by 480 virtual resolution
==================
*/
-void SCR_DrawSmallStringExt( int x, int y, const char *string, float *setColor, qboolean forceColor ) {
+void SCR_DrawSmallStringExt( int x, int y, const char *string, float *setColor, qboolean forceColor,
+ qboolean noColorEscape ) {
vec4_t color;
const char *s;
int xx;
@@ -274,7 +274,7 @@ void SCR_DrawSmallStringExt( int x, int y, const char *string, float *setColor,
xx = x;
re.SetColor( setColor );
while ( *s ) {
- if ( Q_IsColorString( s ) ) {
+ if ( !noColorEscape && Q_IsColorString( s ) ) {
if ( !forceColor ) {
Com_Memcpy( color, g_color_table[ColorIndex(*(s+1))], sizeof( color ) );
color[3] = setColor[3];
diff --git a/src/client/client.h b/src/client/client.h
index b6a75f55..12d13f9c 100644
--- a/src/client/client.h
+++ b/src/client/client.h
@@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "../cgame/cg_public.h"
#include "../game/bg_public.h"
-#if USE_CURL
+#ifdef USE_CURL
#include "cl_curl.h"
#endif /* USE_CURL */
@@ -502,9 +502,9 @@ void SCR_FillRect( float x, float y, float width, float height,
void SCR_DrawPic( float x, float y, float width, float height, qhandle_t hShader );
void SCR_DrawNamedPic( float x, float y, float width, float height, const char *picname );
-void SCR_DrawBigString( int x, int y, const char *s, float alpha ); // draws a string with embedded color control characters with fade
-void SCR_DrawBigStringColor( int x, int y, const char *s, vec4_t color ); // ignores embedded color control characters
-void SCR_DrawSmallStringExt( int x, int y, const char *string, float *setColor, qboolean forceColor );
+void SCR_DrawBigString( int x, int y, const char *s, float alpha, qboolean noColorEscape ); // draws a string with embedded color control characters with fade
+void SCR_DrawBigStringColor( int x, int y, const char *s, vec4_t color, qboolean noColorEscape ); // ignores embedded color control characters
+void SCR_DrawSmallStringExt( int x, int y, const char *string, float *setColor, qboolean forceColor, qboolean noColorEscape );
void SCR_DrawSmallChar( int x, int y, int ch );
diff --git a/src/client/keys.h b/src/client/keys.h
index 3c3fe802..a2d24da5 100644
--- a/src/client/keys.h
+++ b/src/client/keys.h
@@ -34,8 +34,8 @@ extern qkey_t keys[MAX_KEYS];
// NOTE TTimo the declaration of field_t and Field_Clear is now in qcommon/qcommon.h
void Field_KeyDownEvent( field_t *edit, int key );
void Field_CharEvent( field_t *edit, int ch );
-void Field_Draw( field_t *edit, int x, int y, int width, qboolean showCursor );
-void Field_BigDraw( field_t *edit, int x, int y, int width, qboolean showCursor );
+void Field_Draw( field_t *edit, int x, int y, int width, qboolean showCursor, qboolean noColorEscape );
+void Field_BigDraw( field_t *edit, int x, int y, int width, qboolean showCursor, qboolean noColorEscape );
#define COMMAND_HISTORY 32
extern field_t historyEditLines[COMMAND_HISTORY];
diff --git a/src/client/qal.c b/src/client/qal.c
index 1ff99e39..a3448ba2 100644
--- a/src/client/qal.c
+++ b/src/client/qal.c
@@ -24,11 +24,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// Dynamically loads OpenAL
-#if USE_OPENAL
+#ifdef USE_OPENAL
#include "qal.h"
-#if USE_OPENAL_DLOPEN
+#ifdef USE_OPENAL_DLOPEN
#include "../sys/sys_loadlib.h"
diff --git a/src/client/qal.h b/src/client/qal.h
index 7747d987..c43f9c13 100644
--- a/src/client/qal.h
+++ b/src/client/qal.h
@@ -29,12 +29,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "../qcommon/q_shared.h"
#include "../qcommon/qcommon.h"
-#if USE_OPENAL_DLOPEN
+#ifdef USE_OPENAL_DLOPEN
#define AL_NO_PROTOTYPES
#define ALC_NO_PROTOTYPES
#endif
-#if USE_LOCAL_HEADERS
+#ifdef USE_LOCAL_HEADERS
#include "../AL/al.h"
#include "../AL/alc.h"
#else
@@ -48,7 +48,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#endif
#endif
-#if USE_OPENAL_DLOPEN
+#ifdef USE_OPENAL_DLOPEN
extern LPALENABLE qalEnable;
extern LPALDISABLE qalDisable;
extern LPALISENABLED qalIsEnabled;
diff --git a/src/client/snd_codec.c b/src/client/snd_codec.c
index 088236a4..0f947551 100644
--- a/src/client/snd_codec.c
+++ b/src/client/snd_codec.c
@@ -103,7 +103,7 @@ void S_CodecInit()
{
codecs = NULL;
S_CodecRegister(&wav_codec);
-#if USE_CODEC_VORBIS
+#ifdef USE_CODEC_VORBIS
S_CodecRegister(&ogg_codec);
#endif
}
diff --git a/src/client/snd_codec_ogg.c b/src/client/snd_codec_ogg.c
index f13f9a8d..764bbd25 100644
--- a/src/client/snd_codec_ogg.c
+++ b/src/client/snd_codec_ogg.c
@@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// OGG support is enabled by this define
-#if USE_CODEC_VORBIS
+#ifdef USE_CODEC_VORBIS
// includes for the Q3 sound system
#include "client.h"
diff --git a/src/client/snd_openal.c b/src/client/snd_openal.c
index 61b250d6..d8ad48c8 100644
--- a/src/client/snd_openal.c
+++ b/src/client/snd_openal.c
@@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include "snd_codec.h"
#include "client.h"
-#if USE_OPENAL
+#ifdef USE_OPENAL
#include "qal.h"
@@ -1865,7 +1865,7 @@ S_AL_Init
*/
qboolean S_AL_Init( soundInterface_t *si )
{
-#if USE_OPENAL
+#ifdef USE_OPENAL
qboolean enumsupport, founddev = qfalse;