console.c mergable. Little bit of cleanup of client.h

This commit is contained in:
Ragnvald Maartmann-Moe IV 2001-05-18 18:33:37 +00:00
parent a735b92bab
commit 1dbfea351a
4 changed files with 173 additions and 150 deletions

View file

@ -38,12 +38,13 @@
#include "QF/quakefs.h" #include "QF/quakefs.h"
#include "QF/sound.h" #include "QF/sound.h"
#include "protocol.h"
#include "net.h" #include "net.h"
#include "protocol.h"
#include "r_local.h" #include "r_local.h"
#include "render.h" #include "render.h"
#include "game.h" #include "game.h"
typedef struct usercmd_s typedef struct usercmd_s
{ {
vec3_t viewangles; vec3_t viewangles;
@ -75,32 +76,38 @@ typedef struct
#define NAME_LENGTH 64 #define NAME_LENGTH 64
// /*
// client_state_t should hold all pieces of the client state client_state_t should hold all pieces of the client state
// */
#define SIGNONS 4 // signon messages to receive before connected #define SIGNONS 4 // signon messages to receive before connected
#define MAX_EFRAGS 640
#define MAX_MAPSTRING 2048
#define MAX_DEMOS 8 #define MAX_DEMOS 8
#define MAX_DEMONAME 16 #define MAX_DEMONAME 16
#define MAX_EFRAGS 640
#define MAX_MAPSTRING 2048
typedef enum { typedef enum {
ca_dedicated, // a dedicated server with no ability to start a client ca_dedicated, // a dedicated server with no ability to start a client
ca_disconnected, // full screen console with no connection ca_disconnected, // full screen console with no connection
ca_connected // valid netcon, talking to a server ca_connected // valid netcon, talking to a server
} cactive_t; } cactive_t;
typedef enum {
dl_none,
dl_model,
dl_sound,
dl_skin,
dl_single
} dltype_t; // download type
// FIXME: A grotesque (temporary) hack. They're not the same thing to QW. // FIXME: A grotesque (temporary) hack. They're not the same thing to QW.
#define ca_active ca_connected #define ca_active ca_connected
/*
// the client_static_t structure is persistant through an arbitrary number
// the client_static_t structure is persistant through an arbitrary number of server connections
// of server connections */
//
typedef struct typedef struct
{ {
cactive_t state; cactive_t state;
@ -109,6 +116,14 @@ typedef struct
char mapstring[MAX_QPATH]; char mapstring[MAX_QPATH];
char spawnparms[MAX_MAPSTRING]; // to restart a level char spawnparms[MAX_MAPSTRING]; // to restart a level
// file transfer from server
QFile *download;
char downloadtempname[MAX_OSPATH];
char downloadname[MAX_OSPATH];
int downloadnumber;
dltype_t downloadtype;
int downloadpercent;
// demo loop control // demo loop control
int demonum; // -1 = don't play demos int demonum; // -1 = don't play demos
char demos[MAX_DEMOS][MAX_DEMONAME]; // when not playing char demos[MAX_DEMOS][MAX_DEMONAME]; // when not playing
@ -124,7 +139,6 @@ typedef struct
int td_startframe; // host_framecount at start int td_startframe; // host_framecount at start
float td_starttime; // realtime at second frame of timedemo float td_starttime; // realtime at second frame of timedemo
// connection information // connection information
int signon; // 0 to SIGNONS int signon; // 0 to SIGNONS
struct qsocket_s *netcon; struct qsocket_s *netcon;
@ -134,10 +148,10 @@ typedef struct
extern client_static_t cls; extern client_static_t cls;
// /*
// the client_state_t structure is wiped completely at every the client_state_t structure is wiped completely at every
// server signon server signon
// */
typedef struct typedef struct
{ {
int movemessages; // since connecting to this server int movemessages; // since connecting to this server
@ -195,9 +209,8 @@ typedef struct
float last_received_message; // (realtime) for net trouble icon float last_received_message; // (realtime) for net trouble icon
// /* information that is static for the entire time connected to a server */
// information that is static for the entire time connected to a server
//
struct model_s *model_precache[MAX_MODELS]; struct model_s *model_precache[MAX_MODELS];
struct sfx_s *sound_precache[MAX_SOUNDS]; struct sfx_s *sound_precache[MAX_SOUNDS];
@ -219,17 +232,16 @@ typedef struct
scoreboard_t *scores; // [cl.maxclients] scoreboard_t *scores; // [cl.maxclients]
#ifdef QUAKE2 #ifdef QUAKE2
// light level at player's position including dlights // light level at player's position including dlights this is sent back to the
// this is sent back to the server each frame // server each frame architectually ugly but it works
// architectually ugly but it works
int light_level; int light_level;
#endif #endif
} client_state_t; } client_state_t;
// /*
// cvars cvars
// */
extern cvar_t *cl_name; extern cvar_t *cl_name;
extern cvar_t *cl_color; extern cvar_t *cl_color;
@ -275,11 +287,10 @@ extern entity_t cl_static_entities[MAX_STATIC_ENTITIES];
extern lightstyle_t cl_lightstyle[MAX_LIGHTSTYLES]; extern lightstyle_t cl_lightstyle[MAX_LIGHTSTYLES];
extern dlight_t cl_dlights[MAX_DLIGHTS]; extern dlight_t cl_dlights[MAX_DLIGHTS];
//=============================================================================
// /*
// cl_main cl_main
// */
dlight_t *CL_AllocDlight (int key); dlight_t *CL_AllocDlight (int key);
void CL_DecayLights (void); void CL_DecayLights (void);
@ -300,10 +311,10 @@ void CL_NextDemo (void);
extern int cl_numvisedicts; extern int cl_numvisedicts;
extern entity_t *cl_visedicts[MAX_VISEDICTS]; extern entity_t *cl_visedicts[MAX_VISEDICTS];
//
// cl_input
//
/*
cl_input
*/
void CL_InitInput (void); void CL_InitInput (void);
void CL_SendCmd (void); void CL_SendCmd (void);
void CL_SendMove (usercmd_t *cmd); void CL_SendMove (usercmd_t *cmd);
@ -313,14 +324,14 @@ void CL_UpdateTEnts (void);
void CL_ClearState (void); void CL_ClearState (void);
int CL_ReadFromServer (void); int CL_ReadFromServer (void);
void CL_WriteToServer (usercmd_t *cmd); void CL_WriteToServer (usercmd_t *cmd);
void CL_BaseMove (usercmd_t *cmd); void CL_BaseMove (usercmd_t *cmd);
//
// cl_demo.c /*
// cl_demo.c
*/
void CL_StopPlayback (void); void CL_StopPlayback (void);
int CL_GetMessage (void); int CL_GetMessage (void);
@ -329,15 +340,17 @@ void CL_Record_f (void);
void CL_PlayDemo_f (void); void CL_PlayDemo_f (void);
void CL_TimeDemo_f (void); void CL_TimeDemo_f (void);
//
// cl_parse.c /*
// cl_parse.c
*/
void CL_ParseServerMessage (void); void CL_ParseServerMessage (void);
void CL_NewTranslation (int slot); void CL_NewTranslation (int slot);
//
// view /*
// view
*/
void V_StartPitchDrift (void); void V_StartPitchDrift (void);
void V_StopPitchDrift (void); void V_StopPitchDrift (void);
@ -348,9 +361,9 @@ void V_ParseDamage (void);
void V_SetContentsColor (int contents); void V_SetContentsColor (int contents);
// /*
// cl_tent cl_tent
// */
void CL_TEnts_Init (void); void CL_TEnts_Init (void);
void CL_ClearEnts (void); void CL_ClearEnts (void);
void CL_ClearTEnts (void); void CL_ClearTEnts (void);
@ -359,6 +372,9 @@ struct entity_s **CL_NewTempEntity (void);
void CL_ParseTEnt (void); void CL_ParseTEnt (void);
void CL_SignonReply (void); void CL_SignonReply (void);
extern double realtime;
void Cvar_Info (struct cvar_s *var); void Cvar_Info (struct cvar_s *var);
#endif // __client_h #endif // __client_h

View file

@ -39,6 +39,7 @@
#include <stdarg.h> #include <stdarg.h>
#include "QF/cmd.h" #include "QF/cmd.h"
#include "QF/compat.h"
#include "QF/console.h" #include "QF/console.h"
#include "QF/draw.h" #include "QF/draw.h"
#include "QF/input.h" #include "QF/input.h"
@ -49,7 +50,6 @@
#include "QF/va.h" #include "QF/va.h"
#include "client.h" #include "client.h"
#include "host.h"
int con_ormask; int con_ormask;
console_t con_main; console_t con_main;
@ -61,7 +61,6 @@ int con_totallines; // total lines in console scrollback
float con_cursorspeed = 4; float con_cursorspeed = 4;
cvar_t *con_notifytime; // seconds cvar_t *con_notifytime; // seconds
#define NUM_CON_TIMES 4 #define NUM_CON_TIMES 4
@ -74,13 +73,14 @@ int con_notifylines; // scan lines to clear for notify lines
qboolean con_debuglog; qboolean con_debuglog;
#define MAXCMDLINE 256 #define MAXCMDLINE 256
extern char key_lines[32][MAXCMDLINE]; extern char key_lines[32][MAXCMDLINE];
extern int edit_line; extern int edit_line;
extern int key_linepos; extern int key_linepos;
qboolean con_initialized; qboolean con_initialized;
void void
Key_ClearTyping (void) Key_ClearTyping (void)
{ {
@ -88,9 +88,7 @@ Key_ClearTyping (void)
key_linepos = 1; key_linepos = 1;
} }
/*
Con_ToggleConsole_f
*/
void void
Con_ToggleConsole_f (void) Con_ToggleConsole_f (void)
{ {
@ -105,9 +103,7 @@ Con_ToggleConsole_f (void)
Con_ClearNotify (); Con_ClearNotify ();
} }
/*
Con_ToggleChat_f
*/
void void
Con_ToggleChat_f (void) Con_ToggleChat_f (void)
{ {
@ -122,9 +118,7 @@ Con_ToggleChat_f (void)
Con_ClearNotify (); Con_ClearNotify ();
} }
/*
Con_Clear_f
*/
void void
Con_Clear_f (void) Con_Clear_f (void)
{ {
@ -136,9 +130,6 @@ Con_Clear_f (void)
} }
/*
Con_ClearNotify
*/
void void
Con_ClearNotify (void) Con_ClearNotify (void)
{ {
@ -149,9 +140,6 @@ Con_ClearNotify (void)
} }
/*
Con_MessageMode_f
*/
void void
Con_MessageMode_f (void) Con_MessageMode_f (void)
{ {
@ -161,9 +149,7 @@ Con_MessageMode_f (void)
key_dest = key_message; key_dest = key_message;
} }
/*
Con_MessageMode2_f
*/
void void
Con_MessageMode2_f (void) Con_MessageMode2_f (void)
{ {
@ -173,9 +159,7 @@ Con_MessageMode2_f (void)
key_dest = key_message; key_dest = key_message;
} }
/*
Con_Resize
*/
void void
Con_Resize (console_t *con) Con_Resize (console_t *con)
{ {
@ -239,9 +223,6 @@ Con_CheckResize (void)
} }
/*
Con_Init
*/
void void
Con_Init (void) Con_Init (void)
{ {
@ -253,9 +234,7 @@ Con_Init (void)
Con_Printf ("Console initialized.\n"); Con_Printf ("Console initialized.\n");
// // register our commands
// register our commands
//
Cmd_AddCommand ("toggleconsole", Con_ToggleConsole_f, Cmd_AddCommand ("toggleconsole", Con_ToggleConsole_f,
"Toggle the console up and down"); "Toggle the console up and down");
Cmd_AddCommand ("togglechat", Con_ToggleChat_f, Cmd_AddCommand ("togglechat", Con_ToggleChat_f,
@ -268,6 +247,7 @@ Con_Init (void)
con_initialized = true; con_initialized = true;
} }
void void
Con_Init_Cvars (void) Con_Init_Cvars (void)
{ {
@ -277,9 +257,6 @@ Con_Init_Cvars (void)
} }
/*
Con_Linefeed
*/
void void
Con_Linefeed (void) Con_Linefeed (void)
{ {
@ -293,6 +270,7 @@ Con_Linefeed (void)
' ', con_linewidth); ' ', con_linewidth);
} }
/* /*
Con_Print Con_Print
@ -324,7 +302,6 @@ Con_Print (char *txt)
} else } else
mask = 0; mask = 0;
while ((c = *txt)) { while ((c = *txt)) {
// count word length // count word length
for (l = 0; l < con_linewidth; l++) for (l = 0; l < con_linewidth; l++)
@ -392,24 +369,23 @@ Con_DrawInput (void)
char temp[MAXCMDLINE]; char temp[MAXCMDLINE];
if (key_dest != key_console && cls.state == ca_active) if (key_dest != key_console && cls.state == ca_active)
return; // don't draw anything (always draw return; // don't draw anything (always draw if not active)
// if not active)
text = strcpy (temp, key_lines[edit_line]); text = strcpy (temp, key_lines[edit_line]);
// fill out remainder with spaces // fill out remainder with spaces
for (i = strlen (text); i < MAXCMDLINE; i++) for (i = strlen (text); i < MAXCMDLINE; i++)
text[i] = ' '; text[i] = ' ';
// add the cursor frame // add the cursor frame
if ((int) (realtime * con_cursorspeed) & 1) if ((int) (realtime * con_cursorspeed) & 1)
text[key_linepos] = 11; text[key_linepos] = 11;
// prestep if horizontally scrolling // prestep if horizontally scrolling
if (key_linepos >= con_linewidth) if (key_linepos >= con_linewidth)
text += 1 + key_linepos - con_linewidth; text += 1 + key_linepos - con_linewidth;
// draw it // draw it
y = con_vislines - 22; y = con_vislines - 22;
for (i = 0; i < con_linewidth; i++) for (i = 0; i < con_linewidth; i++)
@ -453,7 +429,6 @@ Con_DrawNotify (void)
v += 8; v += 8;
} }
if (key_dest == key_message) { if (key_dest == key_message) {
clearnotify = 0; clearnotify = 0;
scr_copytop = 1; scr_copytop = 1;
@ -483,6 +458,7 @@ Con_DrawNotify (void)
con_notifylines = v; con_notifylines = v;
} }
/* /*
Con_DrawConsole Con_DrawConsole
@ -499,18 +475,18 @@ Con_DrawConsole (int lines)
if (lines <= 0) if (lines <= 0)
return; return;
// draw the background // draw the background
Draw_ConsoleBackground (lines); Draw_ConsoleBackground (lines);
// draw the text // draw the text
con_vislines = lines; con_vislines = lines;
// changed to line things up better // changed to line things up better
rows = (lines - 22) >> 3; // rows of text to draw rows = (lines - 22) >> 3; // rows of text to draw
y = lines - 30; y = lines - 30;
// draw from the bottom up // draw from the bottom up
if (con->display != con->current) { if (con->display != con->current) {
// draw arrows to show the buffer is backscrolled // draw arrows to show the buffer is backscrolled
for (x = 0; x < con_linewidth; x += 4) for (x = 0; x < con_linewidth; x += 4)
@ -533,12 +509,53 @@ Con_DrawConsole (int lines)
Draw_Character8 ((x + 1) << 3, y, text[x]); Draw_Character8 ((x + 1) << 3, y, text[x]);
} }
// draw the input prompt, user text, and cursor if desired // draw the input prompt, user text, and cursor if desired
Con_DrawInput (); Con_DrawInput ();
} }
void void
Con_DrawDownload (int lines) Con_DrawDownload (int lines)
{ {
} int i, j, x, y, n;
char *text;
char dlbar[1024];
if (!cls.download)
return;
text = COM_SkipPath(cls.downloadname);
x = con_linewidth - ((con_linewidth * 7) / 40);
y = x - strlen (text) - 8;
i = con_linewidth / 3;
if (strlen (text) > i) {
y = x - i - 11;
strncpy (dlbar, text, i);
dlbar[i] = 0;
strncat (dlbar, "...", sizeof (dlbar) - strlen (dlbar));
} else
strncpy (dlbar, text, sizeof (dlbar));
strncat (dlbar, ": ", sizeof (dlbar) - strlen (dlbar));
i = strlen (dlbar);
dlbar[i++] = '\x80';
// where's the dot go?
if (cls.downloadpercent == 0)
n = 0;
else
n = y * cls.downloadpercent / 100;
for (j = 0; j < y; j++)
if (j == n)
dlbar[i++] = '\x83';
else
dlbar[i++] = '\x81';
dlbar[i++] = '\x82';
dlbar[i] = 0;
snprintf (dlbar + strlen (dlbar), sizeof (dlbar) - strlen (dlbar),
" %02d%%", cls.downloadpercent);
// draw it
y = lines - 22 + 8;
for (i = 0; i < strlen (dlbar); i++)
Draw_Character8 ((i + 1) << 3, y, dlbar[i]);
}

View file

@ -39,8 +39,11 @@
#include "r_local.h" #include "r_local.h"
#include "render.h" #include "render.h"
// player_state_t is the information needed by a player entity
// to do move prediction and to generate a drawable entity /*
player_state_t is the information needed by a player entity
to do move prediction and to generate a drawable entity
*/
typedef struct player_state_s { typedef struct player_state_s {
int messagenum; // all player's won't be updated each frame int messagenum; // all player's won't be updated each frame
@ -68,6 +71,7 @@ typedef struct player_state_s {
#undef MAX_SCOREBOARDNAME #undef MAX_SCOREBOARDNAME
#define MAX_SCOREBOARDNAME 16 #define MAX_SCOREBOARDNAME 16
typedef struct player_info_s typedef struct player_info_s
{ {
int userid; int userid;
@ -102,17 +106,15 @@ typedef struct
// received from server // received from server
double receivedtime; // time message was received, or -1 double receivedtime; // time message was received, or -1
player_state_t playerstate[MAX_CLIENTS]; // message received that reflects performing player_state_t playerstate[MAX_CLIENTS]; // message received that
// the usercmd // reflects performing the
// usercmd
packet_entities_t packet_entities; packet_entities_t packet_entities;
qboolean invalid; // true if the packet_entities delta was invalid qboolean invalid; // true if the packet_entities delta was invalid
} frame_t; } frame_t;
//
// client_state_t should hold all pieces of the client state // client_state_t should hold all pieces of the client state
//
typedef struct typedef struct
{ {
int length; int length;
@ -120,18 +122,17 @@ typedef struct
} lightstyle_t; } lightstyle_t;
#define MAX_EFRAGS 512
#define MAX_DEMOS 8 #define MAX_DEMOS 8
#define MAX_DEMONAME 16 #define MAX_DEMONAME 16
#define MAX_EFRAGS 512
typedef enum { typedef enum {
ca_disconnected, // full screen console with no connection ca_disconnected, // full screen console with no connection
ca_demostart, // starting up a demo ca_demostart, // starting up a demo
ca_connected, // netchan_t established, waiting for svc_serverdata ca_connected, // netchan_t established, waiting for svc_serverdata
ca_onserver, // processing data lists, donwloading, etc ca_onserver, // processing data lists, donwloading, etc
ca_active // everything is in, so frames can be rendered ca_active // everything is in, so frames can be rendered
} cactive_t; } cactive_t;
typedef enum { typedef enum {
@ -142,10 +143,10 @@ typedef enum {
dl_single dl_single
} dltype_t; // download type } dltype_t; // download type
// /*
// the client_static_t structure is persistant through an arbitrary number the client_static_t structure is persistant through an arbitrary number
// of server connections of server connections
// */
typedef struct typedef struct
{ {
// connection information // connection information
@ -161,7 +162,8 @@ typedef struct
int qport; int qport;
QFile *download; // file transfer from server // file transfer from server
QFile *download;
char downloadtempname[MAX_OSPATH]; char downloadtempname[MAX_OSPATH];
char downloadname[MAX_OSPATH]; char downloadname[MAX_OSPATH];
int downloadnumber; int downloadnumber;
@ -189,10 +191,9 @@ typedef struct
extern client_static_t cls; extern client_static_t cls;
// /*
// the client_state_t structure is wiped completely at every the client_state_t structure is wiped completely at every server signon
// server signon */
//
typedef struct typedef struct
{ {
int servercount; // server identification for prespawns int servercount; // server identification for prespawns
@ -224,9 +225,8 @@ typedef struct
cshift_t cshifts[NUM_CSHIFTS]; // color shifts for damage, powerups cshift_t cshifts[NUM_CSHIFTS]; // color shifts for damage, powerups
cshift_t prev_cshifts[NUM_CSHIFTS]; // and content types cshift_t prev_cshifts[NUM_CSHIFTS]; // and content types
// the client maintains its own idea of view angles, which are // the client maintains its own idea of view angles, which are sent to the
// sent to the server each frame. And only reset at level change // server each frame. And only reset at level change and teleport times
// and teleport times
vec3_t viewangles; vec3_t viewangles;
// the client simulates or interpolates movement to get these values // the client simulates or interpolates movement to get these values
@ -252,9 +252,8 @@ typedef struct
int intermission; // don't change view angle, full screen, etc int intermission; // don't change view angle, full screen, etc
int completed_time; // latched ffrom time at intermission start int completed_time; // latched ffrom time at intermission start
// /* information that is static for the entire time connected to a server */
// information that is static for the entire time connected to a server
//
char model_name[MAX_MODELS][MAX_QPATH]; char model_name[MAX_MODELS][MAX_QPATH];
char sound_name[MAX_SOUNDS][MAX_QPATH]; char sound_name[MAX_SOUNDS][MAX_QPATH];
@ -281,9 +280,9 @@ typedef struct
} client_state_t; } client_state_t;
// /*
// cvars cvars
// */
extern struct cvar_s *cl_warncmd; extern struct cvar_s *cl_warncmd;
extern struct cvar_s *cl_upspeed; extern struct cvar_s *cl_upspeed;
extern struct cvar_s *cl_forwardspeed; extern struct cvar_s *cl_forwardspeed;
@ -329,8 +328,6 @@ extern char *server_version; // version of server we connected to
extern double realtime; extern double realtime;
//=============================================================================
void Cvar_Info (struct cvar_s *var); void Cvar_Info (struct cvar_s *var);

View file

@ -61,7 +61,6 @@ int con_totallines; // total lines in console scrollback
float con_cursorspeed = 4; float con_cursorspeed = 4;
cvar_t *con_notifytime; // seconds cvar_t *con_notifytime; // seconds
#define NUM_CON_TIMES 4 #define NUM_CON_TIMES 4
@ -74,11 +73,11 @@ int con_notifylines; // scan lines to clear for notify lines
qboolean con_debuglog; qboolean con_debuglog;
#define MAXCMDLINE 256 #define MAXCMDLINE 256
extern char key_lines[32][MAXCMDLINE]; extern char key_lines[32][MAXCMDLINE];
extern int edit_line; extern int edit_line;
extern int key_linepos; extern int key_linepos;
qboolean con_initialized; qboolean con_initialized;
@ -235,9 +234,7 @@ Con_Init (void)
Con_Printf ("Console initialized.\n"); Con_Printf ("Console initialized.\n");
// // register our commands
// register our commands
//
Cmd_AddCommand ("toggleconsole", Con_ToggleConsole_f, Cmd_AddCommand ("toggleconsole", Con_ToggleConsole_f,
"Toggle the console up and down"); "Toggle the console up and down");
Cmd_AddCommand ("togglechat", Con_ToggleChat_f, Cmd_AddCommand ("togglechat", Con_ToggleChat_f,
@ -305,7 +302,6 @@ Con_Print (char *txt)
} else } else
mask = 0; mask = 0;
while ((c = *txt)) { while ((c = *txt)) {
// count word length // count word length
for (l = 0; l < con_linewidth; l++) for (l = 0; l < con_linewidth; l++)
@ -373,24 +369,23 @@ Con_DrawInput (void)
char temp[MAXCMDLINE]; char temp[MAXCMDLINE];
if (key_dest != key_console && cls.state == ca_active) if (key_dest != key_console && cls.state == ca_active)
return; // don't draw anything (always draw return; // don't draw anything (always draw if not active)
// if not active)
text = strcpy (temp, key_lines[edit_line]); text = strcpy (temp, key_lines[edit_line]);
// fill out remainder with spaces // fill out remainder with spaces
for (i = strlen (text); i < MAXCMDLINE; i++) for (i = strlen (text); i < MAXCMDLINE; i++)
text[i] = ' '; text[i] = ' ';
// add the cursor frame // add the cursor frame
if ((int) (realtime * con_cursorspeed) & 1) if ((int) (realtime * con_cursorspeed) & 1)
text[key_linepos] = 11; text[key_linepos] = 11;
// prestep if horizontally scrolling // prestep if horizontally scrolling
if (key_linepos >= con_linewidth) if (key_linepos >= con_linewidth)
text += 1 + key_linepos - con_linewidth; text += 1 + key_linepos - con_linewidth;
// draw it // draw it
y = con_vislines - 22; y = con_vislines - 22;
for (i = 0; i < con_linewidth; i++) for (i = 0; i < con_linewidth; i++)
@ -434,7 +429,6 @@ Con_DrawNotify (void)
v += 8; v += 8;
} }
if (key_dest == key_message) { if (key_dest == key_message) {
clearnotify = 0; clearnotify = 0;
scr_copytop = 1; scr_copytop = 1;
@ -481,18 +475,18 @@ Con_DrawConsole (int lines)
if (lines <= 0) if (lines <= 0)
return; return;
// draw the background // draw the background
Draw_ConsoleBackground (lines); Draw_ConsoleBackground (lines);
// draw the text // draw the text
con_vislines = lines; con_vislines = lines;
// changed to line things up better // changed to line things up better
rows = (lines - 22) >> 3; // rows of text to draw rows = (lines - 22) >> 3; // rows of text to draw
y = lines - 30; y = lines - 30;
// draw from the bottom up // draw from the bottom up
if (con->display != con->current) { if (con->display != con->current) {
// draw arrows to show the buffer is backscrolled // draw arrows to show the buffer is backscrolled
for (x = 0; x < con_linewidth; x += 4) for (x = 0; x < con_linewidth; x += 4)
@ -515,7 +509,7 @@ Con_DrawConsole (int lines)
Draw_Character8 ((x + 1) << 3, y, text[x]); Draw_Character8 ((x + 1) << 3, y, text[x]);
} }
// draw the input prompt, user text, and cursor if desired // draw the input prompt, user text, and cursor if desired
Con_DrawInput (); Con_DrawInput ();
} }
@ -565,4 +559,3 @@ Con_DrawDownload (int lines)
for (i = 0; i < strlen (dlbar); i++) for (i = 0; i < strlen (dlbar); i++)
Draw_Character8 ((i + 1) << 3, y, dlbar[i]); Draw_Character8 ((i + 1) << 3, y, dlbar[i]);
} }