aboutsummaryrefslogtreecommitdiffstats
path: root/code/client/cl_keys.c
diff options
context:
space:
mode:
authortma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-09-21 10:35:24 +0000
committertma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-09-21 10:35:24 +0000
commitef3e7e01a2280c186da589404386ae3364b08a4a (patch)
tree69582b32595f2043903a65dd580572108bc80649 /code/client/cl_keys.c
parent8751aa08ae15df6f179acb4315f951d7add6de02 (diff)
downloadioquake3-aero-ef3e7e01a2280c186da589404386ae3364b08a4a.tar.gz
ioquake3-aero-ef3e7e01a2280c186da589404386ae3364b08a4a.zip
* Don't apply colour escape chars on input fields
git-svn-id: svn://svn.icculus.org/quake3/trunk@1184 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/client/cl_keys.c')
-rw-r--r--code/client/cl_keys.c51
1 files changed, 25 insertions, 26 deletions
diff --git a/code/client/cl_keys.c b/code/client/cl_keys.c
index 11354d2..8991d0e 100644
--- a/code/client/cl_keys.c
+++ b/code/client/cl_keys.c
@@ -309,7 +309,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;
@@ -350,47 +351,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 );
}
/*