mirror of
https://git.code.sf.net/p/quake/quakeforge-old
synced 2025-02-16 08:41:42 +00:00
uquake now works! All targets I can test!
I also merged console.[ch] while I was at it..
This commit is contained in:
parent
ad90a0508d
commit
925344be77
93 changed files with 476 additions and 2061 deletions
9
TESTIFY
9
TESTIFY
|
@ -56,6 +56,15 @@ Driver: Mesa 3.1, Software
|
|||
Target: all, (x11/svga)
|
||||
Extra: at 16bpp
|
||||
|
||||
Name: Zephaniah E. Hull.
|
||||
Email: mercury@quakeforge.net
|
||||
Chip: P200MMX
|
||||
Distro: Debian Potato
|
||||
Kernel: 2.3.x
|
||||
Card: 4mb V1
|
||||
Driver: 3dfxgl
|
||||
Target: -3dfx, -svga, -x11, -ggi, -gl (barely).
|
||||
|
||||
Chip: K6-2 350MHz, K6-2 350Mhz, K6-2 266Mhz
|
||||
Distro: n/a
|
||||
Kernel: 2.2, 2.2, 2.0
|
||||
|
|
|
@ -345,7 +345,7 @@ int CDAudio_Init(void)
|
|||
{
|
||||
int i;
|
||||
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
if (cls.state == ca_dedicated)
|
||||
return -1;
|
||||
#endif
|
||||
|
|
|
@ -138,7 +138,7 @@ void CDAudio_Update()
|
|||
|
||||
int CDAudio_Init()
|
||||
{
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
if (cls.state == ca_dedicated)
|
||||
return -1;
|
||||
#endif
|
||||
|
|
|
@ -326,7 +326,7 @@ int CDAudio_Init(void)
|
|||
MCI_SET_PARMS mciSetParms;
|
||||
int n;
|
||||
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
if (cls.state == ca_dedicated)
|
||||
return -1;
|
||||
#endif
|
||||
|
|
|
@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
|
||||
#include "quakedef.h"
|
||||
#include <lib_replace.h>
|
||||
|
||||
static void CD_f(void);
|
||||
|
||||
|
|
|
@ -191,7 +191,7 @@ void Cbuf_Execute (void)
|
|||
}
|
||||
|
||||
// execute the command line
|
||||
Cmd_ExecuteString (line);
|
||||
Cmd_ExecuteString (line, src_command);
|
||||
|
||||
if (cmd_wait)
|
||||
{ // skip out while text still remains in buffer, leaving it
|
||||
|
@ -420,6 +420,7 @@ static int cmd_argc;
|
|||
static char *cmd_argv[MAX_ARGS];
|
||||
static char *cmd_null_string = "";
|
||||
static char *cmd_args = NULL;
|
||||
cmd_source_t cmd_source;
|
||||
|
||||
|
||||
|
||||
|
@ -677,11 +678,12 @@ A complete command line has been parsed, so try to execute it
|
|||
FIXME: lookupnoadd the token to speed search?
|
||||
============
|
||||
*/
|
||||
void Cmd_ExecuteString (char *text)
|
||||
void Cmd_ExecuteString (char *text, cmd_source_t src)
|
||||
{
|
||||
cmd_function_t *cmd;
|
||||
cmdalias_t *a;
|
||||
|
||||
cmd_source = src;
|
||||
Cmd_TokenizeString (text);
|
||||
|
||||
// execute the command line
|
||||
|
|
11
common/cmd.h
11
common/cmd.h
|
@ -69,6 +69,15 @@ then searches for a command or variable that matches the first token.
|
|||
|
||||
typedef void (*xcommand_t) (void);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
src_client, // came in over a net connection as a clc_stringcmd
|
||||
// host_client will be valid during this state.
|
||||
src_command // from the command buffer
|
||||
} cmd_source_t;
|
||||
|
||||
extern cmd_source_t cmd_source;
|
||||
|
||||
void Cmd_Init (void);
|
||||
|
||||
void Cmd_AddCommand (char *cmd_name, xcommand_t function);
|
||||
|
@ -100,7 +109,7 @@ void Cmd_TokenizeString (char *text);
|
|||
// Takes a null terminated string. Does not need to be /n terminated.
|
||||
// breaks the string up into arg tokens.
|
||||
|
||||
void Cmd_ExecuteString (char *text);
|
||||
void Cmd_ExecuteString (char *text, cmd_source_t src);
|
||||
// Parses a single line of text into arguments and tries to execute it
|
||||
// as if it was typed at the console
|
||||
|
||||
|
|
|
@ -31,6 +31,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "cvar.h"
|
||||
#include "screen.h"
|
||||
#include "draw.h"
|
||||
#include <cmd.h>
|
||||
#include <sys.h>
|
||||
|
||||
int con_ormask;
|
||||
console_t con_main;
|
||||
|
@ -594,6 +596,7 @@ void Con_DrawConsole (int lines)
|
|||
Draw_Character ( (x+1)<<3, y, text[x]);
|
||||
}
|
||||
|
||||
#ifdef QUAKEWORLD
|
||||
// draw the download bar
|
||||
// figure out width
|
||||
if (cls.download) {
|
||||
|
@ -636,6 +639,7 @@ void Con_DrawConsole (int lines)
|
|||
for (i = 0; i < strlen(dlbar); i++)
|
||||
Draw_Character ( (i+1)<<3, y, dlbar[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
// draw the input prompt, user text, and cursor if desired
|
|
@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "d_local.h"
|
||||
#include <sys.h>
|
||||
|
||||
int d_vrectx, d_vrecty, d_vrectright_particle, d_vrectbottom_particle;
|
||||
|
||||
|
|
|
@ -28,6 +28,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <wad.h>
|
||||
#include <d_iface.h>
|
||||
#include <sound.h>
|
||||
#include <sys.h>
|
||||
#include <lib_replace.h>
|
||||
#include <console.h>
|
||||
|
||||
typedef struct {
|
||||
vrect_t rect;
|
||||
|
|
|
@ -30,6 +30,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "glquake.h"
|
||||
#include "console.h"
|
||||
#include "sbar.h"
|
||||
#include <sys.h>
|
||||
#include <cmd.h>
|
||||
#include <lib_replace.h>
|
||||
|
||||
extern unsigned char d_15to8table[65536];
|
||||
extern cvar_t crosshair, cl_crossx, cl_crossy, crosshaircolor;
|
||||
|
|
|
@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "model.h"
|
||||
#include "console.h"
|
||||
#include "mathlib.h"
|
||||
#include <sys.h>
|
||||
|
||||
mnode_t *r_pefragtopnode;
|
||||
|
||||
|
|
|
@ -34,6 +34,8 @@
|
|||
#include "console.h"
|
||||
#include "view.h"
|
||||
#include "sound.h"
|
||||
#include <cvar.h>
|
||||
#include <sys.h>
|
||||
|
||||
entity_t r_worldentity;
|
||||
|
||||
|
|
|
@ -26,6 +26,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "glquake.h"
|
||||
#include "cvar.h"
|
||||
#include "console.h"
|
||||
#include <sys.h>
|
||||
#include <lib_replace.h>
|
||||
#include <cmd.h>
|
||||
|
||||
extern void R_InitBubble();
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "quakedef.h"
|
||||
#include "glquake.h"
|
||||
#include "mathlib.h"
|
||||
#include <sys.h>
|
||||
|
||||
int skytexturenum;
|
||||
|
||||
|
|
|
@ -29,6 +29,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "sound.h"
|
||||
#include "keys.h"
|
||||
#include "menu.h"
|
||||
#include <sys.h>
|
||||
#include <lib_replace.h>
|
||||
#include <draw.h>
|
||||
|
||||
#ifndef _EXPERIMENTAL_
|
||||
# undef HAS_DGA
|
||||
|
|
|
@ -29,6 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "console.h"
|
||||
#include "cvar.h"
|
||||
#include "sound.h"
|
||||
#include <lib_replace.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "quakedef.h"
|
||||
#include "glquake.h"
|
||||
#include "mathlib.h"
|
||||
#include <sys.h>
|
||||
|
||||
extern model_t *loadmodel;
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "sys.h"
|
||||
#include "console.h"
|
||||
#include "cvar.h"
|
||||
#include <cmd.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -327,48 +327,28 @@ void Key_Console (int key)
|
|||
case K_MWHEELUP:
|
||||
case KP_PGUP:
|
||||
case K_PGUP:
|
||||
#ifdef QUAKEWORLD
|
||||
con->display -= 2;
|
||||
#else
|
||||
con_backscroll += 2;
|
||||
if (con_backscroll > con_totallines - (vid.height>>3) - 1)
|
||||
con_backscroll = con_totallines - (vid.height>>3) - 1;
|
||||
#endif
|
||||
return;
|
||||
break;
|
||||
|
||||
case K_MWHEELDOWN:
|
||||
case KP_PGDN:
|
||||
case K_PGDN:
|
||||
#ifdef QUAKEWORLD
|
||||
con->display += 2;
|
||||
if (con->display > con->current)
|
||||
con->display = con->current;
|
||||
#else
|
||||
con_backscroll -= 2;
|
||||
if (con_backscroll < 0)
|
||||
con_backscroll = 0;
|
||||
#endif
|
||||
return;
|
||||
break;
|
||||
|
||||
case KP_HOME:
|
||||
case K_HOME:
|
||||
#ifdef QUAKEWORLD
|
||||
con->display = con->current - con_totallines + 10;
|
||||
#else
|
||||
con_backscroll = con_totallines - (vid.height>>3) - 1;
|
||||
#endif
|
||||
return;
|
||||
break;
|
||||
|
||||
case KP_END:
|
||||
case K_END:
|
||||
#ifdef QUAKEWORLD
|
||||
con->display = con->current;
|
||||
#else
|
||||
con_backscroll = 0;
|
||||
#endif
|
||||
return;
|
||||
break;
|
||||
|
||||
|
@ -857,11 +837,7 @@ void Key_Event (int key, qboolean down)
|
|||
if ( (key_dest == key_menu && menubound[key])
|
||||
|| (key_dest == key_console && !consolekeys[key])
|
||||
|| (key_dest == key_game && (
|
||||
#ifdef QUAKEWORLD
|
||||
(cls.state == ca_active)
|
||||
#else
|
||||
!con_forcedup
|
||||
#endif
|
||||
|| !consolekeys[key] ) ) )
|
||||
{
|
||||
kb = keybindings[key];
|
||||
|
|
|
@ -25,10 +25,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
#include "r_local.h"
|
||||
#include "d_local.h"
|
||||
#endif // QUAKEWORLD
|
||||
#endif // UQUAKE
|
||||
|
||||
#if !id386
|
||||
|
||||
|
|
|
@ -26,6 +26,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
# include "quakedef.h"
|
||||
#endif
|
||||
|
||||
#include <qtypes.h>
|
||||
#include <mathlib.h>
|
||||
#include <cvar.h>
|
||||
#include <protocol.h>
|
||||
#include <cmd.h>
|
||||
#include <sys.h>
|
||||
|
||||
#define RETURN_EDICT(e) (((int *)pr_globals)[OFS_RETURN] = EDICT_TO_PROG(e))
|
||||
#define RETURN_STRING(s) (((int *)pr_globals)[OFS_RETURN] = PR_SetString(s))
|
||||
|
||||
|
@ -551,7 +558,7 @@ void PF_random (void)
|
|||
G_FLOAT(OFS_RETURN) = num;
|
||||
}
|
||||
|
||||
#ifndef QUAKEWORLD /* !QUAKEWORLD */
|
||||
#ifdef UQUAKE /* UQUAKE */
|
||||
/*
|
||||
=================
|
||||
PF_particle
|
||||
|
@ -645,7 +652,7 @@ void PF_sound (void)
|
|||
volume = G_FLOAT(OFS_PARM3) * 255;
|
||||
attenuation = G_FLOAT(OFS_PARM4);
|
||||
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
if (volume < 0 || volume > 255)
|
||||
Sys_Error ("SV_StartSound: volume = %i", volume);
|
||||
|
||||
|
@ -1131,7 +1138,7 @@ void PF_precache_model (void)
|
|||
if (!sv.model_precache[i])
|
||||
{
|
||||
sv.model_precache[i] = s;
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
sv.models[i] = Mod_ForName (s, true);
|
||||
#endif
|
||||
return;
|
||||
|
@ -1825,12 +1832,7 @@ void PF_infokey (void)
|
|||
if (!strcmp(key, "ip"))
|
||||
value = strcpy(ov, NET_BaseAdrToString (svs.clients[e1-1].netchan.remote_address));
|
||||
else if (!strcmp(key, "ping")) {
|
||||
#ifndef QUAKEWORLD
|
||||
int ping = SV_CalcPing (&svs.clients[e1-1]);
|
||||
snprintf(ov, sizeof(ov), "%d", ping);
|
||||
#else
|
||||
snprintf(ov, sizeof(ov), "%d", svs.clients[e1-1].ping);
|
||||
#endif
|
||||
value = ov;
|
||||
} else
|
||||
value = Info_ValueForKey (svs.clients[e1-1].userinfo, key);
|
||||
|
|
|
@ -28,6 +28,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "quakedef.h"
|
||||
#endif
|
||||
|
||||
#include <qtypes.h>
|
||||
#include <lib_replace.h>
|
||||
#include <mathlib.h>
|
||||
#include <sys.h>
|
||||
#include <cmd.h>
|
||||
#include <crc.h>
|
||||
#include <cvar.h>
|
||||
|
||||
dprograms_t *progs;
|
||||
dfunction_t *pr_functions;
|
||||
char *pr_strings;
|
||||
|
|
|
@ -26,10 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "quakedef.h"
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
||||
*/
|
||||
#include <sys.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
|
|
@ -37,7 +37,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define MAX_EDICTS 768
|
||||
#define MAX_LIGHTSTYLES 64
|
||||
#define MAX_DATAGRAM 1450
|
||||
#define MAX_MSGLEN 1450
|
||||
//#define MAX_MSGLEN 1450
|
||||
#define MAX_MSGLEN 8000
|
||||
|
||||
#define clc_stringcmd 4
|
||||
|
||||
|
|
|
@ -160,6 +160,7 @@ typedef struct
|
|||
// to decay light values and smooth step ups
|
||||
|
||||
qboolean onground;
|
||||
qboolean inwater;
|
||||
float viewheight;
|
||||
float idealpitch;
|
||||
int maxclients;
|
||||
|
|
|
@ -24,6 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "quakedef.h"
|
||||
#include "r_local.h"
|
||||
#include <mathlib.h>
|
||||
#include <sys.h>
|
||||
#include <console.h>
|
||||
|
||||
#define LIGHT_MIN 5 // lowest light value we'll allow, to avoid the
|
||||
// need for inner-loop light clamping
|
||||
|
|
|
@ -24,6 +24,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "quakedef.h"
|
||||
#include "r_local.h"
|
||||
#include <mathlib.h>
|
||||
#include <sys.h>
|
||||
#include <console.h>
|
||||
|
||||
//
|
||||
// current entity info
|
||||
|
|
|
@ -28,6 +28,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <screen.h>
|
||||
#include <view.h>
|
||||
#include <sound.h>
|
||||
#include <cmd.h>
|
||||
#include <sys.h>
|
||||
#include <console.h>
|
||||
|
||||
//#define PASSAGES
|
||||
|
||||
|
@ -103,11 +106,11 @@ int r_polycount;
|
|||
int r_drawnpolycount;
|
||||
int r_wholepolycount;
|
||||
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
#define VIEWMODNAME_LENGTH 256
|
||||
char viewmodname[VIEWMODNAME_LENGTH+1];
|
||||
int modcount;
|
||||
#endif // !QUAKEWORLD
|
||||
#endif // UQUAKE
|
||||
|
||||
int *pfrustum_indexes[4];
|
||||
int r_frustum_indexes[4*6];
|
||||
|
@ -127,10 +130,10 @@ float dp_time1, dp_time2, db_time1, db_time2, rw_time1, rw_time2;
|
|||
float se_time1, se_time2, de_time1, de_time2, dv_time1, dv_time2;
|
||||
|
||||
void R_MarkLeaves (void);
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
void R_InitParticles (void);
|
||||
void R_DrawParticles (void);
|
||||
#endif // !QUAKEWORLD
|
||||
#endif // UQUAKE
|
||||
|
||||
cvar_t r_draworder = {"r_draworder","0"};
|
||||
cvar_t r_speeds = {"r_speeds","0"};
|
||||
|
@ -332,9 +335,9 @@ void R_NewMap (void)
|
|||
|
||||
r_dowarpold = false;
|
||||
r_viewchanged = false;
|
||||
#if !defined(QUAKEWORLD) && defined(PASSAGES)
|
||||
#if defined(UQUAKE) && defined(PASSAGES)
|
||||
CreatePassages ();
|
||||
#endif // !QUAKEWORLD && PASSAGES
|
||||
#endif // UQUAKE && PASSAGES
|
||||
}
|
||||
|
||||
|
||||
|
@ -599,7 +602,7 @@ void R_DrawEntitiesOnList (void)
|
|||
#else
|
||||
currententity = cl_visedicts[i];
|
||||
|
||||
if (currententity == &cl_entities[cl.viewentity])
|
||||
if (currententity == &cl_entities[cl.playernum + 1])
|
||||
continue; // don't draw the player
|
||||
#endif // QUAKEWORLD
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "r_local.h"
|
||||
#include <mathlib.h>
|
||||
#include <cvars.h>
|
||||
#include <sys.h>
|
||||
|
||||
drawsurf_t r_drawsurf;
|
||||
|
||||
|
|
|
@ -30,6 +30,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "draw.h"
|
||||
#include "sbar.h"
|
||||
#include "screen.h"
|
||||
#include "cmd.h"
|
||||
#include <protocol.h>
|
||||
|
||||
int sb_updates; // if >= vid.numpages, no update needed
|
||||
|
||||
|
@ -60,7 +62,7 @@ qboolean sb_showteamscores;
|
|||
|
||||
int sb_lines; // scan lines to draw
|
||||
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
qpic_t *rsb_invbar[2];
|
||||
qpic_t *rsb_weapons[5];
|
||||
qpic_t *rsb_items[2];
|
||||
|
@ -268,7 +270,7 @@ void Sbar_Init (void)
|
|||
sb_ibar = Draw_PicFromWad ("ibar");
|
||||
sb_scorebar = Draw_PicFromWad ("scorebar");
|
||||
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
if (hipnotic) //MED 01/04/97 added new hipnotic weapons
|
||||
{
|
||||
hsb_weapons[0][0] = Draw_PicFromWad ("inv_laser");
|
||||
|
@ -318,7 +320,7 @@ void Sbar_Init (void)
|
|||
rsb_ammo[1] = Draw_PicFromWad ("r_ammomulti");
|
||||
rsb_ammo[2] = Draw_PicFromWad ("r_ammoplasma");
|
||||
}
|
||||
#endif // !QUAKEWORLD
|
||||
#endif // UQUAKE
|
||||
}
|
||||
|
||||
|
||||
|
@ -333,7 +335,7 @@ Sbar_DrawPic
|
|||
*/
|
||||
void Sbar_DrawPic (int x, int y, qpic_t *pic)
|
||||
{
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
if ((cl_sbar.value && !cl.gametype == GAME_DEATHMATCH)
|
||||
&& (hipnotic || rogue))
|
||||
Draw_Pic (x + ((vid.width - 320)>>1),
|
||||
|
@ -352,7 +354,7 @@ JACK: Draws a portion of the picture in the status bar.
|
|||
void Sbar_DrawSubPic(int x, int y, qpic_t *pic,
|
||||
int srcx, int srcy, int width, int height)
|
||||
{
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
if ((cl_sbar.value && !cl.gametype == GAME_DEATHMATCH)
|
||||
&& (hipnotic || rogue))
|
||||
Draw_SubPic (x + ((vid.width - 320)>>1),
|
||||
|
@ -372,7 +374,7 @@ Sbar_DrawTransPic
|
|||
*/
|
||||
void Sbar_DrawTransPic (int x, int y, qpic_t *pic)
|
||||
{
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
if ((cl_sbar.value && !cl.gametype == GAME_DEATHMATCH)
|
||||
&& (hipnotic || rogue))
|
||||
Draw_TransPic (x + ((vid.width - 320)>>1),
|
||||
|
@ -391,7 +393,7 @@ Draws one solid graphics character
|
|||
*/
|
||||
void Sbar_DrawCharacter (int x, int y, int num)
|
||||
{
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
if ((cl_sbar.value && !cl.gametype == GAME_DEATHMATCH)
|
||||
&& (hipnotic || rogue))
|
||||
Draw_Character (x + ((vid.width - 320)>>1) + 4,
|
||||
|
@ -408,7 +410,7 @@ Sbar_DrawString
|
|||
*/
|
||||
void Sbar_DrawString (int x, int y, char *str)
|
||||
{
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
if ((cl_sbar.value && !cl.gametype == GAME_DEATHMATCH)
|
||||
&& (hipnotic || rogue))
|
||||
Draw_String (x + ((vid.width - 320)>>1),
|
||||
|
@ -486,8 +488,6 @@ void Sbar_DrawNum (int x, int y, int num, int digits, int color)
|
|||
//=============================================================================
|
||||
|
||||
#ifdef QUAKEWORLD
|
||||
//ZOID: this should be MAX_CLIENTS, not MAX_SCOREBOARD!!
|
||||
//int fragsort[MAX_SCOREBOARD];
|
||||
int fragsort[MAX_CLIENTS];
|
||||
int scoreboardlines;
|
||||
typedef struct {
|
||||
|
@ -675,7 +675,7 @@ void Sbar_SoloScoreboard (void)
|
|||
snprintf(str, sizeof(str),"Time :%3i:%i%i", minutes, tens, units);
|
||||
Sbar_DrawString (184, 4, str);
|
||||
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
// draw level name
|
||||
l = strlen (cl.levelname);
|
||||
Sbar_DrawString (232 - l*4, 12, cl.levelname);
|
||||
|
@ -689,7 +689,7 @@ Sbar_DrawScoreboard
|
|||
*/
|
||||
void Sbar_DrawScoreboard (void)
|
||||
{
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
Sbar_SoloScoreboard ();
|
||||
if (cl.gametype == GAME_DEATHMATCH)
|
||||
Sbar_DeathmatchOverlay (0);
|
||||
|
@ -715,7 +715,7 @@ void Sbar_DrawInventory (void)
|
|||
headsup = !(cl_sbar.value || scr_viewsize.value<100);
|
||||
hudswap = cl_hudswap.value; // Get that nasty float out :)
|
||||
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
if (hipnotic)
|
||||
headsup = false;
|
||||
|
||||
|
@ -762,7 +762,7 @@ void Sbar_DrawInventory (void)
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
// hipnotic weapons
|
||||
if (hipnotic) {
|
||||
|
||||
|
@ -850,7 +850,7 @@ void Sbar_DrawInventory (void)
|
|||
sb_updates = 0;
|
||||
}
|
||||
else {
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
//MED 01/04/97 changed keys
|
||||
if (!hipnotic || (i>1)) {
|
||||
Sbar_DrawPic (192 + i*16, -16, sb_items[i]);
|
||||
|
@ -862,7 +862,7 @@ void Sbar_DrawInventory (void)
|
|||
if (time && time > cl.time - 2)
|
||||
sb_updates = 0;
|
||||
}
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
// hipnotic items
|
||||
if (hipnotic) {
|
||||
for (i=0 ; i<2 ; i++) {
|
||||
|
@ -910,7 +910,7 @@ void Sbar_DrawInventory (void)
|
|||
sb_updates = 0;
|
||||
}
|
||||
}
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -990,11 +990,7 @@ void Sbar_DrawFrags (void)
|
|||
Sbar_DrawCharacter ( (x + 2) * 8 , -24, num[1]);
|
||||
Sbar_DrawCharacter ( (x + 3) * 8 , -24, num[2]);
|
||||
|
||||
#ifdef QUAKEWORLD
|
||||
if (k == cl.playernum) {
|
||||
#else
|
||||
if (k == cl.viewentity - 1) {
|
||||
#endif
|
||||
Sbar_DrawCharacter ( x * 8 + 2, -24, 16);
|
||||
Sbar_DrawCharacter ( (x + 4) * 8 -4, -24, 17);
|
||||
}
|
||||
|
@ -1014,7 +1010,7 @@ void Sbar_DrawFace (void)
|
|||
{
|
||||
int f, anim;
|
||||
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
// PGM 01/19/97 - team color drawing
|
||||
// PGM 03/02/97 - fixed so color swatch only appears in CTF modes
|
||||
if (rogue &&
|
||||
|
@ -1026,7 +1022,7 @@ void Sbar_DrawFace (void)
|
|||
char num[12];
|
||||
scoreboard_t *s;
|
||||
|
||||
s = &cl.scores[cl.viewentity - 1];
|
||||
s = &cl.scores[cl.playernum];
|
||||
// draw background
|
||||
top = s->colors & 0xf0;
|
||||
bottom = (s->colors & 15)<<4;
|
||||
|
@ -1110,7 +1106,7 @@ void Sbar_DrawNormal (void)
|
|||
if (cl_sbar.value || scr_viewsize.value<100)
|
||||
Sbar_DrawPic (0, 0, sb_sbar);
|
||||
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
if (hipnotic) {
|
||||
if (Sbar_Items() & IT_KEY1)
|
||||
Sbar_DrawPic (209, 3, sb_items[0]);
|
||||
|
@ -1124,7 +1120,7 @@ void Sbar_DrawNormal (void)
|
|||
Sbar_DrawNum (24, 0, 666, 3, 1);
|
||||
Sbar_DrawPic (0, 0, draw_disc);
|
||||
} else {
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
if (rogue) {
|
||||
Sbar_DrawNum (24, 0, cl.stats[STAT_ARMOR], 3,
|
||||
cl.stats[STAT_ARMOR] <= 25);
|
||||
|
@ -1144,7 +1140,7 @@ void Sbar_DrawNormal (void)
|
|||
Sbar_DrawPic (0, 0, sb_armor[1]);
|
||||
else if (Sbar_Items() & IT_ARMOR1)
|
||||
Sbar_DrawPic (0, 0, sb_armor[0]);
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -1157,7 +1153,7 @@ void Sbar_DrawNormal (void)
|
|||
, cl.stats[STAT_HEALTH] <= 25);
|
||||
|
||||
// ammo icon
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
if (rogue) {
|
||||
if (Sbar_Items() & RIT_SHELLS)
|
||||
Sbar_DrawPic (224, 0, sb_ammo[0]);
|
||||
|
@ -1183,7 +1179,7 @@ void Sbar_DrawNormal (void)
|
|||
Sbar_DrawPic (224, 0, sb_ammo[2]);
|
||||
else if (Sbar_Items() & IT_CELLS)
|
||||
Sbar_DrawPic (224, 0, sb_ammo[3]);
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
}
|
||||
#endif // !QUAKEWORLD
|
||||
Sbar_DrawNum (248, 0, cl.stats[STAT_AMMO], 3
|
||||
|
@ -1210,7 +1206,7 @@ void Sbar_Draw (void)
|
|||
if (!headsup && sb_lines && vid.width > 320)
|
||||
Draw_TileClear (0, vid.height - sb_lines, vid.width, sb_lines);
|
||||
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
if (sb_lines > 24)
|
||||
{
|
||||
Sbar_DrawInventory ();
|
||||
|
@ -1795,7 +1791,7 @@ void Sbar_DeathmatchOverlay (int start)
|
|||
Draw_Character ( x+16 , y, num[1]);
|
||||
Draw_Character ( x+24 , y, num[2]);
|
||||
|
||||
if (k == cl.viewentity - 1)
|
||||
if (k == cl.playernum)
|
||||
Draw_Character ( x - 8, y, 12);
|
||||
|
||||
#if 0
|
||||
|
@ -1856,7 +1852,7 @@ void Sbar_MiniDeathmatchOverlay (void)
|
|||
|
||||
//find us
|
||||
for (i = 0; i < scoreboardlines; i++)
|
||||
if (fragsort[i] == cl.viewentity - 1)
|
||||
if (fragsort[i] == cl.playernum)
|
||||
break;
|
||||
|
||||
if (i == scoreboardlines) // we're not there
|
||||
|
@ -1894,7 +1890,7 @@ void Sbar_MiniDeathmatchOverlay (void)
|
|||
Draw_Character ( x+16 , y, num[1]);
|
||||
Draw_Character ( x+24 , y, num[2]);
|
||||
|
||||
if (k == cl.viewentity - 1) {
|
||||
if (k == cl.playernum) {
|
||||
Draw_Character ( x, y, 16);
|
||||
Draw_Character ( x + 32, y, 17);
|
||||
}
|
||||
|
@ -1932,7 +1928,7 @@ Sbar_IntermissionOverlay
|
|||
*/
|
||||
void Sbar_IntermissionOverlay (void)
|
||||
{
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
qpic_t *pic;
|
||||
int dig;
|
||||
int num;
|
||||
|
|
|
@ -33,6 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "sys.h"
|
||||
#include "common_quakedef.h"
|
||||
#include "qargs.h"
|
||||
#include <console.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "winquake.h"
|
||||
|
|
|
@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "string.h"
|
||||
#include "quakefs.h"
|
||||
#include "sys.h"
|
||||
#include <console.h>
|
||||
|
||||
int cache_full_cycle;
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "qtypes.h"
|
||||
#include "sound.h"
|
||||
#include "qargs.h"
|
||||
#include <console.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -46,8 +46,9 @@
|
|||
#include "qtypes.h"
|
||||
#include "sys.h"
|
||||
#include "common.h"
|
||||
#include <lib_replace.h>
|
||||
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
qboolean isDedicated;
|
||||
#endif
|
||||
|
||||
|
@ -230,7 +231,7 @@ void floating_point_exception_handler(int whatever) {
|
|||
|
||||
char *Sys_ConsoleInput(void) {
|
||||
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
static char text[256];
|
||||
fd_set fdset;
|
||||
int len;
|
||||
|
@ -272,7 +273,7 @@ int main (int c, char **v) {
|
|||
double time, oldtime, newtime;
|
||||
quakeparms_t parms;
|
||||
int j;
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
extern int vcrFile;
|
||||
extern int recording;
|
||||
#endif
|
||||
|
@ -318,7 +319,7 @@ int main (int c, char **v) {
|
|||
newtime = Sys_DoubleTime ();
|
||||
time = newtime - oldtime;
|
||||
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
if (cls.state == ca_dedicated) { // play vcrfiles at max speed
|
||||
if (time < sys_ticrate.value && (vcrFile == -1 || recording) ) {
|
||||
usleep(1);
|
||||
|
|
|
@ -35,6 +35,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <keys.h>
|
||||
#include <cvar.h>
|
||||
#include <menu.h>
|
||||
#include <sys.h>
|
||||
#include <lib_replace.h>
|
||||
#include <draw.h>
|
||||
#include <console.h>
|
||||
|
||||
viddef_t vid; // global video state
|
||||
unsigned short d_8to16table[256];
|
||||
|
|
|
@ -997,7 +997,7 @@ GetEvent(void)
|
|||
mouse_in_window = false;
|
||||
break;
|
||||
/* Host_Quit_f only available in uquake */
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
case ClientMessage:
|
||||
if (x_event.xclient.data.l[0] == aWMDelete) Host_Quit_f();
|
||||
break;
|
||||
|
|
|
@ -27,6 +27,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "d_local.h"
|
||||
#include <sound.h>
|
||||
#include <cvar.h>
|
||||
#include <lib_replace.h>
|
||||
#include <cmd.h>
|
||||
#include <sys.h>
|
||||
#include <console.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_UNISTD_H
|
||||
|
|
|
@ -49,6 +49,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <keys.h>
|
||||
#include <cvar.h>
|
||||
#include <menu.h>
|
||||
#include <sys.h>
|
||||
#include <cmd.h>
|
||||
#include <lib_replace.h>
|
||||
#include <draw.h>
|
||||
#include <console.h>
|
||||
|
||||
cvar_t _windowed_mouse = {"_windowed_mouse","0", true};
|
||||
cvar_t m_filter = {"m_filter","0", true};
|
||||
|
@ -967,7 +972,7 @@ GetEvent(void)
|
|||
mouse_in_window = false;
|
||||
break;
|
||||
/* Host_Quit_f only available in uquake */
|
||||
#ifndef QUAKEWORLD
|
||||
#ifdef UQUAKE
|
||||
case ClientMessage:
|
||||
if (x_event.xclient.data.l[0] == aWMDelete) Host_Quit_f();
|
||||
break;
|
||||
|
|
|
@ -1240,7 +1240,7 @@ void CL_ParseServerMessage (void)
|
|||
break;
|
||||
|
||||
case svc_sellscreen:
|
||||
Cmd_ExecuteString ("help");
|
||||
Cmd_ExecuteString ("help", src_command);
|
||||
break;
|
||||
|
||||
case svc_smallkick:
|
||||
|
|
|
@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <mathlib.h>
|
||||
#include <common.h>
|
||||
#include <console.h>
|
||||
#include <crc.h>
|
||||
|
||||
model_t *loadmodel;
|
||||
char loadname[32]; // for hunk tags
|
||||
|
|
|
@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "quakedef.h"
|
||||
#include "r_local.h"
|
||||
#include <mathlib.h>
|
||||
#include <console.h>
|
||||
|
||||
mnode_t *r_pefragtopnode;
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#define ON_EPSILON 0.1 // point on plane side epsilon
|
||||
|
||||
#define MAX_MSGLEN 1450 // max length of a reliable message
|
||||
//#define MAX_MSGLEN 1450 // max length of a reliable message
|
||||
#define MAX_DATAGRAM 1450 // max length of unreliable message
|
||||
|
||||
//
|
||||
|
|
|
@ -35,14 +35,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "quakedef.h"
|
||||
#endif
|
||||
|
||||
#define MAX_NUM_ARGVS 50
|
||||
#define NUM_SAFE_ARGVS 6
|
||||
|
||||
|
||||
qboolean com_modified; // set true if using non-id files
|
||||
|
||||
qboolean msg_suppress_1 = 0;
|
||||
|
||||
void COM_InitFilesystem (void);
|
||||
void COM_Path_f (void);
|
||||
|
||||
|
|
|
@ -768,7 +768,7 @@ void SVC_RemoteCommand (void)
|
|||
strcat (remaining, " ");
|
||||
}
|
||||
|
||||
Cmd_ExecuteString (remaining);
|
||||
Cmd_ExecuteString (remaining, src_command);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1708,7 +1708,7 @@ void SV_Init (quakeparms_t *parms)
|
|||
|
||||
// if a map wasn't specified on the command line, spawn start.map
|
||||
if (sv.state == ss_dead)
|
||||
Cmd_ExecuteString ("map start");
|
||||
Cmd_ExecuteString ("map start", src_command);
|
||||
if (sv.state == ss_dead)
|
||||
SV_Error ("Couldn't spawn a server");
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ PROJECT_ODIR = ..
|
|||
SRC_DIR = @srcdir@
|
||||
COMMON_DIR = $(PROJECT_DIR)/common
|
||||
COMMON_ODIR = $(PROJECT_ODIR)/common
|
||||
BIN_PREFIX = quake
|
||||
BIN_PREFIX = uquake
|
||||
|
||||
DESTDIR =
|
||||
|
||||
|
@ -17,9 +17,10 @@ exec_prefix = @exec_prefix@
|
|||
bindir = @bindir@
|
||||
mandir = @mandir@
|
||||
|
||||
BUILD_DIR = $(PROJECT_ODIR)/targets/uquake
|
||||
TARGET_DIR = $(PROJECT_ODIR)/targets
|
||||
BUILD_DIR = $(TARGET_DIR)/uquake
|
||||
|
||||
LDFLAGS = @LDFLAGS@ @SOUND_LIBS@ @NET_LIBS@ -lm
|
||||
LDFLAGS = @LDFLAGS@ @NET_LIBS@ -lm
|
||||
LIBS = @LIBS@
|
||||
CC = @CC@
|
||||
INTEL_ARCH = @INTEL_ARCH@
|
||||
|
@ -123,7 +124,6 @@ CL_ADDITIONAL_GENERAL_SRC = sys_dosa.s math.s
|
|||
SWREND_SRC_PLAT = d_draw.s d_draw16.s d_parta.s d_polysa.s d_scana.s \
|
||||
d_spr8.s d_varsa.s r_aclipa.s r_aliasa.s \
|
||||
r_drawa.s r_edgea.s r_varsa.s surf16.s surf8.s
|
||||
XTRA_SND_SRC = snd_mixa.s
|
||||
else
|
||||
|
||||
# Source files for non-Intel platforms
|
||||
|
@ -135,29 +135,6 @@ endif
|
|||
|
||||
CD_AUDIO_SRC = cd_wrapper.c
|
||||
|
||||
# Sound source
|
||||
|
||||
SND_STYLE = @SND_STYLE@
|
||||
SND_SRC = snd_null.c
|
||||
|
||||
ifeq ($(SND_STYLE),ALSA)
|
||||
SND_SRC = snd_dma.c snd_alsa.c
|
||||
endif
|
||||
ifeq ($(SND_STYLE),OSS)
|
||||
SND_SRC = snd_dma.c snd_oss.c
|
||||
endif
|
||||
ifeq ($(SND_STYLE),Solaris)
|
||||
SND_SRC = snd_dma.c snd_sun.c
|
||||
endif
|
||||
ifeq ($(SND_STYLE),MME)
|
||||
SND_SRC = snd_dma.c snd_mme.c
|
||||
endif
|
||||
ifeq ($(SND_STYLE),Windows)
|
||||
SND_SRC = snd_dma.c snd_win.c
|
||||
endif
|
||||
|
||||
SND_SRC += snd_mem.c snd_mix.c $(XTRA_SND_SRC)
|
||||
|
||||
SYS_SRC = sys_common.c @SYS_SRC@
|
||||
|
||||
# Networking source files
|
||||
|
@ -176,7 +153,7 @@ UQ_NET_SRC = net_dgrm.c net_loop.c net_main.c net_vcr.c $(NET_SRC)
|
|||
# Common source files
|
||||
|
||||
MISC_SRC = common.c crc.c cvar.c cmd.c mathlib.c register_check.c \
|
||||
wad.c zone.c cvars.c
|
||||
wad.c zone.c cvars.c lib_replace.c qendian.c quakefs.c
|
||||
|
||||
# GL renderer source
|
||||
|
||||
|
@ -205,7 +182,7 @@ SRV_PR_SRC = pr_cmds.c pr_edict.c pr_exec.c
|
|||
|
||||
# Source common to QW/UQuake
|
||||
CL_COMMON_SRC = $(MISC_SRC) $(CL_GUI_SRC) $(CL_SRC) \
|
||||
$(CL_ADDITIONAL_GENERAL_SRC) $(SND_SRC) r_part.c
|
||||
$(CL_ADDITIONAL_GENERAL_SRC) r_part.c
|
||||
|
||||
|
||||
########################################################################
|
||||
|
@ -300,7 +277,8 @@ ifneq ($(X11QUAKE),)
|
|||
ALL_X11_SRC = $(CD_AUDIO_SRC) $(SW_REND_SRC) @X11_VID_SRC@ model.c
|
||||
ALL_X11_OBJS = $(patsubst %,$(BUILD_DIR)/soft/%,$(addsuffix .@OBJEXT@,\
|
||||
$(basename $(ALL_X11_SRC) .c .s))) \
|
||||
$(BUILD_DIR)/common_lib.a
|
||||
$(BUILD_DIR)/common_lib.a \
|
||||
$(TARGET_DIR)/sound_lib.a
|
||||
|
||||
X11_CFLAGS = -DX11 @X_CFLAGS@
|
||||
X11_LDFLAGS = @X_LIBS@ -lX11 @X11_SHM_LIB@ @X_EXTRA_LIBS@
|
||||
|
@ -328,7 +306,8 @@ ALL_SVGA_SRC = $(CD_AUDIO_SRC) $(SW_REND_SRC) \
|
|||
vid_svgalib.c in_svgalib.c d_copy.s model.c
|
||||
ALL_SVGA_OBJS = $(patsubst %,$(BUILD_DIR)/soft/%,$(addsuffix .@OBJEXT@,\
|
||||
$(basename $(ALL_SVGA_SRC) .c .s))) \
|
||||
$(BUILD_DIR)/common_lib.a
|
||||
$(BUILD_DIR)/common_lib.a \
|
||||
$(TARGET_DIR)/sound_lib.a
|
||||
|
||||
SVGA_CFLAGS = @SVGA_CFLAGS@
|
||||
SVGA_LDFLAGS = @SVGA_LIBS@
|
||||
|
@ -357,7 +336,8 @@ ALL_GGI_SRC = $(CD_AUDIO_SRC) $(SW_REND_SRC) vid_ggi.c\
|
|||
model.c
|
||||
ALL_GGI_OBJS = $(patsubst %,$(BUILD_DIR)/soft/%,$(addsuffix .@OBJEXT@,\
|
||||
$(basename $(ALL_GGI_SRC) .c .s))) \
|
||||
$(BUILD_DIR)/common_lib.a
|
||||
$(BUILD_DIR)/common_lib.a \
|
||||
$(TARGET_DIR)/sound_lib.a
|
||||
|
||||
GGI_SRC = vid_ggi.c
|
||||
GGI_CFLAGS = -DGGI @GGI_CFLAGS@
|
||||
|
@ -381,7 +361,8 @@ ALL_SDL_SRC = $(SW_REND_SRC) $(SDL_SRC) vid_sdl.c cd_sdl.c\
|
|||
model.c
|
||||
ALL_SDL_OBJS = $(patsubst %,$(BUILD_DIR)/soft/%,$(addsuffix .@OBJEXT@,\
|
||||
$(basename $(ALL_SDL_SRC) .c .s))) \
|
||||
$(BUILD_DIR)/common_lib.a
|
||||
$(BUILD_DIR)/common_lib.a \
|
||||
$(TARGET_DIR)/sound_lib.a
|
||||
|
||||
SDL_CFLAGS = @SDL_CFLAGS@ -DSDL
|
||||
SDL_LDFLAGS = @SDL_LIBS@
|
||||
|
@ -409,7 +390,8 @@ ALL_MGL_SRC = $(CD_AUDIO_SRC) $(SW_REND_SRC) \
|
|||
vid_win.c in_win.c conproc.c model.c
|
||||
ALL_MGL_OBJS = $(patsubst %,$(BUILD_DIR)/soft/%,$(addsuffix .@OBJEXT@,\
|
||||
$(basename $(ALL_MGL_SRC) .c .s))) \
|
||||
$(BUILD_DIR)/common_lib.a
|
||||
$(BUILD_DIR)/common_lib.a \
|
||||
$(TARGET_DIR)/sound_lib.a
|
||||
|
||||
MGL_CFLAGS = @MGL_CFLAGS@ -DMGL
|
||||
MGL_LDFLAGS = @MGL_LIBS@
|
||||
|
@ -438,7 +420,8 @@ ALL_VGA_SRC = $(CD_AUDIO_SRC) $(SW_REND_SRC) $(DOS_NET_SRC) \
|
|||
d_copy.s model.c
|
||||
ALL_VGA_OBJS = $(patsubst %,$(BUILD_DIR)/soft/%,$(addsuffix .@OBJEXT@,\
|
||||
$(basename $(ALL_VGA_SRC) .c .s))) \
|
||||
$(BUILD_DIR)/common_lib.a
|
||||
$(BUILD_DIR)/common_lib.a \
|
||||
$(TARGET_DIR)/sound_lib.a
|
||||
|
||||
VGA_CFLAGS = @VGA_CFLAGS@ -DVGA
|
||||
VGA_LDFLAGS = @VGA_LIBS@
|
||||
|
@ -464,7 +447,8 @@ ALL_GL_SRC = $(CD_AUDIO_SRC) $(GL_REND_SRC) \
|
|||
gl_vidglx.c dga_check.c
|
||||
ALL_GL_OBJS = $(patsubst %,$(BUILD_DIR)/gl/%,$(addsuffix .@OBJEXT@,\
|
||||
$(basename $(ALL_GL_SRC) .c .s))) \
|
||||
$(BUILD_DIR)/common_lib.a
|
||||
$(BUILD_DIR)/common_lib.a \
|
||||
$(TARGET_DIR)/sound_lib.a
|
||||
|
||||
GL_CFLAGS = -DGLQUAKE @OGL_CFLAGS@
|
||||
GL_LDFLAGS = $(X11_LDFLAGS) @OGL_LIBS@ @DGA_LIBS@ @DYN_LIBS@
|
||||
|
@ -491,7 +475,8 @@ ALL_TDFX_SRC = $(CD_AUDIO_SRC) $(GL_REND_SRC) \
|
|||
gl_vidlinux_3dfx.c in_svgalib.c
|
||||
ALL_TDFX_OBJS = $(patsubst %,$(BUILD_DIR)/gl/%,$(addsuffix .@OBJEXT@,\
|
||||
$(basename $(ALL_TDFX_SRC) .c .s))) \
|
||||
$(BUILD_DIR)/common_lib.a
|
||||
$(BUILD_DIR)/common_lib.a \
|
||||
$(TARGET_DIR)/sound_lib.a
|
||||
|
||||
TDFX_CFLAGS = -DGLQUAKE @OGL_CFLAGS@ @GLIDE_CFLAGS@
|
||||
TDFX_LDFLAGS = @SVGA_LIBS@ @TDFXGL_LIBS@
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
*/
|
||||
|
||||
#include "quakedef.h"
|
||||
#include <cvar.h>
|
||||
#include <mathlib.h>
|
||||
|
||||
cvar_t cl_chasecam = {"cl_chasecam", "0", true};
|
||||
cvar_t cl_chasecam_up = {"cl_chasecam_up", "16", true};
|
||||
|
|
|
@ -19,7 +19,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
*/
|
||||
|
||||
#include <qtypes.h>
|
||||
#include "quakedef.h"
|
||||
#include <net.h>
|
||||
#include <sys.h>
|
||||
#include <mathlib.h>
|
||||
#include <cmd.h>
|
||||
#include <console.h>
|
||||
#include <protocol.h>
|
||||
|
||||
void CL_FinishTimeDemo (void);
|
||||
|
||||
|
@ -216,7 +223,7 @@ void CL_Record_f (void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (c == 2 && cls.state == ca_connected)
|
||||
if (c == 2 && cls.state >= ca_connected)
|
||||
{
|
||||
Con_Printf("Can not record - already connected to server\nClient demo recording must be started before connecting\n");
|
||||
return;
|
||||
|
|
|
@ -22,7 +22,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
// Quake is a trademark of Id Software, Inc., (c) 1996 Id Software, Inc. All
|
||||
// rights reserved.
|
||||
|
||||
#include <qtypes.h>
|
||||
#include "quakedef.h"
|
||||
#include <mathlib.h>
|
||||
#include <lib_replace.h>
|
||||
#include <cmd.h>
|
||||
#include <console.h>
|
||||
#include <net.h>
|
||||
#include <protocol.h>
|
||||
|
||||
/*
|
||||
===============================================================================
|
||||
|
|
|
@ -21,6 +21,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
// cl_main.c -- client main loop
|
||||
|
||||
#include "quakedef.h"
|
||||
#include <qtypes.h>
|
||||
#include <qstructs.h>
|
||||
#include <sound.h>
|
||||
#include <net.h>
|
||||
#include <console.h>
|
||||
#include <screen.h>
|
||||
#include <mathlib.h>
|
||||
#include <cmd.h>
|
||||
#include <protocol.h>
|
||||
#include <cvar.h>
|
||||
#include <input.h>
|
||||
|
||||
// we need to declare some mouse variables here, because the menu system
|
||||
// references them even when on a unix system.
|
||||
|
@ -111,7 +122,7 @@ void CL_Disconnect (void)
|
|||
// if running a local server, shut it down
|
||||
if (cls.demoplayback)
|
||||
CL_StopPlayback ();
|
||||
else if (cls.state == ca_connected)
|
||||
else if (cls.state >= ca_connected)
|
||||
{
|
||||
if (cls.demorecording)
|
||||
CL_Stop_f ();
|
||||
|
@ -187,6 +198,7 @@ Con_DPrintf ("CL_SignonReply: %i\n", cls.signon);
|
|||
case 1:
|
||||
MSG_WriteByte (&cls.message, clc_stringcmd);
|
||||
MSG_WriteString (&cls.message, "prespawn");
|
||||
cls.state = ca_onserver;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
|
@ -209,6 +221,7 @@ Con_DPrintf ("CL_SignonReply: %i\n", cls.signon);
|
|||
|
||||
case 4:
|
||||
SCR_EndLoadingPlaque (); // allow normal screen updates
|
||||
cls.state = ca_active;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -611,7 +624,7 @@ void CL_RelinkEntities (void)
|
|||
|
||||
ent->forcelink = false;
|
||||
|
||||
if (i == cl.viewentity && !cl_chasecam.value)
|
||||
if (i == cl.playernum + 1 && !cl_chasecam.value)
|
||||
continue;
|
||||
|
||||
#ifdef QUAKE2
|
||||
|
@ -652,7 +665,7 @@ int CL_ReadFromServer (void)
|
|||
|
||||
cl.last_received_message = realtime;
|
||||
CL_ParseServerMessage ();
|
||||
} while (ret && cls.state == ca_connected);
|
||||
} while (ret && cls.state >= ca_connected);
|
||||
|
||||
if (cl_shownet.value)
|
||||
Con_Printf ("\n");
|
||||
|
@ -675,7 +688,7 @@ void CL_SendCmd (void)
|
|||
{
|
||||
usercmd_t cmd;
|
||||
|
||||
if (cls.state != ca_connected)
|
||||
if (cls.state < ca_connected)
|
||||
return;
|
||||
|
||||
if (cls.signon == SIGNONS)
|
||||
|
|
|
@ -20,6 +20,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
// cl_parse.c -- parse a message received from the server
|
||||
|
||||
#include "quakedef.h"
|
||||
#include <protocol.h>
|
||||
#include <sound.h>
|
||||
#include <net.h>
|
||||
#include <sys.h>
|
||||
#include <console.h>
|
||||
#include <sbar.h>
|
||||
#include <mathlib.h>
|
||||
#include <cdaudio.h>
|
||||
#include <screen.h>
|
||||
#include <lib_replace.h>
|
||||
#include <cmd.h>
|
||||
|
||||
void CL_ParseUpdate (int bits);
|
||||
|
||||
|
@ -330,7 +341,7 @@ void CL_ParseBaseline (entity_t *ent)
|
|||
ent->baseline.modelindex = MSG_ReadByte ();
|
||||
ent->baseline.frame = MSG_ReadByte ();
|
||||
ent->baseline.colormap = MSG_ReadByte();
|
||||
ent->baseline.skin = MSG_ReadByte();
|
||||
ent->baseline.skinnum = MSG_ReadByte();
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
ent->baseline.origin[i] = MSG_ReadCoord ();
|
||||
|
@ -363,10 +374,12 @@ void CL_ParseClientdata (int bits)
|
|||
VectorCopy (cl.mvelocity[0], cl.mvelocity[1]);
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
if (bits & (SU_PUNCH1<<i) )
|
||||
cl.punchangle[i] = MSG_ReadChar();
|
||||
else
|
||||
cl.punchangle[i] = 0;
|
||||
if (bits & (SU_PUNCH1<<i) ) {
|
||||
if (PITCH == i)
|
||||
cl.punchangle = MSG_ReadChar();
|
||||
else
|
||||
MSG_ReadChar();
|
||||
}
|
||||
if (bits & (SU_VELOCITY1<<i) )
|
||||
cl.mvelocity[0][i] = MSG_ReadChar()*16;
|
||||
else
|
||||
|
@ -479,7 +492,7 @@ void CL_ParseStatic (void)
|
|||
ent->model = cl.model_precache[ent->baseline.modelindex];
|
||||
ent->frame = ent->baseline.frame;
|
||||
ent->colormap = vid.colormap;
|
||||
ent->skinnum = ent->baseline.skin;
|
||||
ent->skinnum = ent->baseline.skinnum;
|
||||
ent->effects = ent->baseline.effects;
|
||||
|
||||
VectorCopy (ent->baseline.origin, ent->origin);
|
||||
|
@ -614,7 +627,8 @@ void CL_ParseServerMessage (void)
|
|||
break;
|
||||
|
||||
case svc_setview:
|
||||
cl.viewentity = MSG_ReadShort ();
|
||||
cl.playernum = MSG_ReadShort ();
|
||||
cl.playernum--;
|
||||
break;
|
||||
|
||||
case svc_lightstyle:
|
||||
|
@ -725,7 +739,8 @@ void CL_ParseServerMessage (void)
|
|||
|
||||
case svc_cdtrack:
|
||||
cl.cdtrack = MSG_ReadByte ();
|
||||
cl.looptrack = MSG_ReadByte ();
|
||||
//cl.looptrack = MSG_ReadByte ();
|
||||
MSG_ReadByte ();
|
||||
if ( (cls.demoplayback || cls.demorecording) && (cls.forcetrack != -1) )
|
||||
CDAudio_Play ((byte)cls.forcetrack, true);
|
||||
else
|
||||
|
|
|
@ -20,6 +20,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
// cl_tent.c -- client side temporary entities
|
||||
|
||||
#include "quakedef.h"
|
||||
#include <qtypes.h>
|
||||
#include <sound.h>
|
||||
#include <mathlib.h>
|
||||
#include <protocol.h>
|
||||
#include <console.h>
|
||||
#include <sys.h>
|
||||
|
||||
int num_temp_entities;
|
||||
entity_t cl_temp_entities[MAX_TEMP_ENTITIES];
|
||||
|
@ -341,9 +347,9 @@ void CL_UpdateTEnts (void)
|
|||
continue;
|
||||
|
||||
// if coming from the player, update the start position
|
||||
if (b->entity == cl.viewentity)
|
||||
if (b->entity == cl.playernum + 1)
|
||||
{
|
||||
VectorCopy (cl_entities[cl.viewentity].origin, b->start);
|
||||
VectorCopy (cl_entities[cl.playernum + 1].origin, b->start);
|
||||
}
|
||||
|
||||
// calculate pitch and yaw
|
||||
|
|
|
@ -102,7 +102,9 @@ typedef struct
|
|||
typedef enum {
|
||||
ca_dedicated, // a dedicated server with no ability to start a client
|
||||
ca_disconnected, // full screen console with no connection
|
||||
ca_connected // valid netcon, talking to a server
|
||||
ca_connected, // valid netcon, talking to a server
|
||||
ca_onserver, // processing data lists, etc
|
||||
ca_active // everything is in, so frames can be rendered
|
||||
} cactive_t;
|
||||
|
||||
//
|
||||
|
@ -143,6 +145,8 @@ typedef struct
|
|||
extern client_static_t cls;
|
||||
|
||||
|
||||
#include <qstructs.h>
|
||||
|
||||
//
|
||||
// cvars
|
||||
//
|
||||
|
|
662
uquake/console.c
662
uquake/console.c
|
@ -1,662 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
Portions Copyright (C) 1999,2000 Nelson Rush.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// console.c
|
||||
|
||||
#include "qtypes.h"
|
||||
#include "quakedef.h"
|
||||
#include "console.h"
|
||||
#include "keys.h"
|
||||
#include "lib_replace.h"
|
||||
#include "client.h"
|
||||
#include "cvar.h"
|
||||
#include "screen.h"
|
||||
#include "draw.h"
|
||||
#include "cmd.h"
|
||||
#include "sound.h"
|
||||
#include "sys.h"
|
||||
|
||||
#ifdef NeXT
|
||||
#include <libc.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
|
||||
int con_linewidth;
|
||||
|
||||
float con_cursorspeed = 4;
|
||||
|
||||
#define CON_TEXTSIZE 16384
|
||||
|
||||
qboolean con_forcedup; // because no entities to refresh
|
||||
|
||||
int con_totallines; // total lines in console scrollback
|
||||
int con_backscroll; // lines up from bottom to display
|
||||
int con_current; // where next message will be printed
|
||||
int con_x; // offset in current line for next print
|
||||
char *con_text=0;
|
||||
|
||||
cvar_t con_notifytime = {"con_notifytime","3"}; //seconds
|
||||
|
||||
#define NUM_CON_TIMES 4
|
||||
float con_times[NUM_CON_TIMES]; // realtime time the line was generated
|
||||
// for transparent notify lines
|
||||
|
||||
int con_vislines;
|
||||
|
||||
qboolean con_debuglog;
|
||||
|
||||
#define MAXCMDLINE 256
|
||||
extern char key_lines[32][MAXCMDLINE];
|
||||
extern int edit_line;
|
||||
extern int key_linepos;
|
||||
|
||||
|
||||
qboolean con_initialized;
|
||||
|
||||
int con_notifylines; // scan lines to clear for notify lines
|
||||
|
||||
extern void M_Menu_Main_f (void);
|
||||
|
||||
/*
|
||||
================
|
||||
Con_ToggleConsole_f
|
||||
================
|
||||
*/
|
||||
void Con_ToggleConsole_f (void)
|
||||
{
|
||||
if (key_dest == key_console)
|
||||
{
|
||||
if (cls.state == ca_connected)
|
||||
{
|
||||
key_dest = key_game;
|
||||
key_lines[edit_line][1] = 0; // clear any typing
|
||||
key_linepos = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
M_Menu_Main_f ();
|
||||
}
|
||||
}
|
||||
else
|
||||
key_dest = key_console;
|
||||
|
||||
SCR_EndLoadingPlaque ();
|
||||
memset (con_times, 0, sizeof(con_times));
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
Con_Clear_f
|
||||
================
|
||||
*/
|
||||
void Con_Clear_f (void)
|
||||
{
|
||||
if (con_text)
|
||||
Q_memset (con_text, ' ', CON_TEXTSIZE);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
Con_ClearNotify
|
||||
================
|
||||
*/
|
||||
void Con_ClearNotify (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0 ; i<NUM_CON_TIMES ; i++)
|
||||
con_times[i] = 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
Con_MessageMode_f
|
||||
================
|
||||
*/
|
||||
extern qboolean chat_team;
|
||||
|
||||
void Con_MessageMode_f (void)
|
||||
{
|
||||
key_dest = key_message;
|
||||
chat_team = false;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
Con_MessageMode2_f
|
||||
================
|
||||
*/
|
||||
void Con_MessageMode2_f (void)
|
||||
{
|
||||
key_dest = key_message;
|
||||
chat_team = true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
Con_CheckResize
|
||||
|
||||
If the line width has changed, reformat the buffer.
|
||||
================
|
||||
*/
|
||||
void Con_CheckResize (void)
|
||||
{
|
||||
int i, j, width, oldwidth, oldtotallines, numlines, numchars;
|
||||
char tbuf[CON_TEXTSIZE];
|
||||
|
||||
width = (vid.width >> 3) - 2;
|
||||
|
||||
if (width == con_linewidth)
|
||||
return;
|
||||
|
||||
if (width < 1) // video hasn't been initialized yet
|
||||
{
|
||||
width = 38;
|
||||
con_linewidth = width;
|
||||
con_totallines = CON_TEXTSIZE / con_linewidth;
|
||||
Q_memset (con_text, ' ', CON_TEXTSIZE);
|
||||
}
|
||||
else
|
||||
{
|
||||
oldwidth = con_linewidth;
|
||||
con_linewidth = width;
|
||||
oldtotallines = con_totallines;
|
||||
con_totallines = CON_TEXTSIZE / con_linewidth;
|
||||
numlines = oldtotallines;
|
||||
|
||||
if (con_totallines < numlines)
|
||||
numlines = con_totallines;
|
||||
|
||||
numchars = oldwidth;
|
||||
|
||||
if (con_linewidth < numchars)
|
||||
numchars = con_linewidth;
|
||||
|
||||
Q_memcpy (tbuf, con_text, CON_TEXTSIZE);
|
||||
Q_memset (con_text, ' ', CON_TEXTSIZE);
|
||||
|
||||
for (i=0 ; i<numlines ; i++)
|
||||
{
|
||||
for (j=0 ; j<numchars ; j++)
|
||||
{
|
||||
con_text[(con_totallines - 1 - i) * con_linewidth + j] =
|
||||
tbuf[((con_current - i + oldtotallines) %
|
||||
oldtotallines) * oldwidth + j];
|
||||
}
|
||||
}
|
||||
|
||||
Con_ClearNotify ();
|
||||
}
|
||||
|
||||
con_backscroll = 0;
|
||||
con_current = con_totallines - 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
Con_Init
|
||||
================
|
||||
*/
|
||||
void Con_Init (void)
|
||||
{
|
||||
#define MAXGAMEDIRLEN 1000
|
||||
char temp[MAXGAMEDIRLEN+1];
|
||||
char *t2 = "/qconsole.log";
|
||||
|
||||
con_debuglog = COM_CheckParm("-condebug");
|
||||
|
||||
if (con_debuglog)
|
||||
{
|
||||
if (strlen (com_gamedir) < (MAXGAMEDIRLEN - strlen (t2)))
|
||||
{
|
||||
snprintf(temp, sizeof(temp), "%s%s", com_gamedir, t2);
|
||||
unlink (temp);
|
||||
}
|
||||
}
|
||||
|
||||
con_text = Hunk_AllocName (CON_TEXTSIZE, "context");
|
||||
Q_memset (con_text, ' ', CON_TEXTSIZE);
|
||||
con_linewidth = -1;
|
||||
Con_CheckResize ();
|
||||
|
||||
Con_Printf ("Console initialized.\n");
|
||||
|
||||
//
|
||||
// register our commands
|
||||
//
|
||||
Cvar_RegisterVariable (&con_notifytime);
|
||||
|
||||
Cmd_AddCommand ("toggleconsole", Con_ToggleConsole_f);
|
||||
Cmd_AddCommand ("messagemode", Con_MessageMode_f);
|
||||
Cmd_AddCommand ("messagemode2", Con_MessageMode2_f);
|
||||
Cmd_AddCommand ("clear", Con_Clear_f);
|
||||
con_initialized = true;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
Con_Linefeed
|
||||
===============
|
||||
*/
|
||||
void Con_Linefeed (void)
|
||||
{
|
||||
con_x = 0;
|
||||
con_current++;
|
||||
Q_memset (&con_text[(con_current%con_totallines)*con_linewidth]
|
||||
, ' ', con_linewidth);
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
Con_Print
|
||||
|
||||
Handles cursor positioning, line wrapping, etc
|
||||
All console printing must go through this in order to be logged to disk
|
||||
If no console is visible, the notify window will pop up.
|
||||
================
|
||||
*/
|
||||
void Con_Print (char *txt)
|
||||
{
|
||||
int y;
|
||||
int c, l;
|
||||
static int cr;
|
||||
int mask;
|
||||
|
||||
con_backscroll = 0;
|
||||
|
||||
if (txt[0] == 1)
|
||||
{
|
||||
mask = 128; // go to colored text
|
||||
S_LocalSound ("misc/talk.wav");
|
||||
// play talk wav
|
||||
txt++;
|
||||
}
|
||||
else if (txt[0] == 2)
|
||||
{
|
||||
mask = 128; // go to colored text
|
||||
txt++;
|
||||
}
|
||||
else
|
||||
mask = 0;
|
||||
|
||||
|
||||
while ( (c = *txt) )
|
||||
{
|
||||
// count word length
|
||||
for (l=0 ; l< con_linewidth ; l++)
|
||||
if ( txt[l] <= ' ')
|
||||
break;
|
||||
|
||||
// word wrap
|
||||
if (l != con_linewidth && (con_x + l > con_linewidth) )
|
||||
con_x = 0;
|
||||
|
||||
txt++;
|
||||
|
||||
if (cr)
|
||||
{
|
||||
con_current--;
|
||||
cr = false;
|
||||
}
|
||||
|
||||
|
||||
if (!con_x)
|
||||
{
|
||||
Con_Linefeed ();
|
||||
// mark time for transparent overlay
|
||||
if (con_current >= 0)
|
||||
con_times[con_current % NUM_CON_TIMES] = realtime;
|
||||
}
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case '\n':
|
||||
con_x = 0;
|
||||
break;
|
||||
|
||||
case '\r':
|
||||
con_x = 0;
|
||||
cr = 1;
|
||||
break;
|
||||
|
||||
default: // display character and advance
|
||||
y = con_current % con_totallines;
|
||||
con_text[y*con_linewidth+con_x] = c | mask;
|
||||
con_x++;
|
||||
if (con_x >= con_linewidth)
|
||||
con_x = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
Con_DebugLog
|
||||
================
|
||||
*/
|
||||
void Con_DebugLog(char *file, char *fmt, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
static char data[1024];
|
||||
int fd;
|
||||
|
||||
va_start(argptr, fmt);
|
||||
vsnprintf(data, sizeof(data), fmt, argptr);
|
||||
va_end(argptr);
|
||||
fd = open(file, O_WRONLY | O_CREAT | O_APPEND, 0666);
|
||||
write(fd, data, strlen(data));
|
||||
close(fd);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
Con_Printf
|
||||
|
||||
Handles cursor positioning, line wrapping, etc
|
||||
================
|
||||
*/
|
||||
#define MAXPRINTMSG 4096
|
||||
|
||||
void Con_Printf (char *fmt, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
char msg[MAXPRINTMSG];
|
||||
static qboolean inupdate;
|
||||
|
||||
va_start (argptr, fmt);
|
||||
vsnprintf (msg, sizeof(msg), fmt, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
// also echo to debugging console
|
||||
Sys_Printf ("%s", msg); // also echo to debugging console
|
||||
|
||||
// log all messages to file
|
||||
if (con_debuglog)
|
||||
Con_DebugLog(va("%s/qconsole.log",com_gamedir), "%s", msg);
|
||||
|
||||
if (!con_initialized)
|
||||
return;
|
||||
|
||||
if (cls.state == ca_dedicated)
|
||||
return; // no graphics mode
|
||||
|
||||
// write it to the scrollable buffer
|
||||
Con_Print (msg);
|
||||
|
||||
// update the screen if the console is displayed
|
||||
if (cls.signon != SIGNONS && !scr_disabled_for_loading )
|
||||
{
|
||||
// protect against infinite loop if something in SCR_UpdateScreen calls
|
||||
// Con_Printd
|
||||
if (!inupdate)
|
||||
{
|
||||
inupdate = true;
|
||||
SCR_UpdateScreen ();
|
||||
inupdate = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
Con_DPrintf
|
||||
|
||||
A Con_Printf that only shows up if the "developer" cvar is set
|
||||
================
|
||||
*/
|
||||
void Con_DPrintf (char *fmt, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
char msg[MAXPRINTMSG];
|
||||
|
||||
if (!developer.value)
|
||||
return; // don't confuse non-developers with techie stuff...
|
||||
|
||||
va_start (argptr, fmt);
|
||||
vsnprintf (msg, sizeof(msg), fmt, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
Con_Printf ("%s", msg);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
Con_SafePrintf
|
||||
|
||||
Okay to call even when the screen can't be updated
|
||||
==================
|
||||
*/
|
||||
void Con_SafePrintf (char *fmt, ...)
|
||||
{
|
||||
va_list argptr;
|
||||
char msg[1024];
|
||||
int temp;
|
||||
|
||||
va_start (argptr, fmt);
|
||||
vsnprintf (msg, sizeof(msg), fmt, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
temp = scr_disabled_for_loading;
|
||||
scr_disabled_for_loading = true;
|
||||
Con_Printf ("%s", msg);
|
||||
scr_disabled_for_loading = temp;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
DRAWING
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
Con_DrawInput
|
||||
|
||||
The input line scrolls horizontally if typing goes beyond the right edge
|
||||
================
|
||||
*/
|
||||
void Con_DrawInput (void)
|
||||
{
|
||||
int y;
|
||||
int i;
|
||||
char *text;
|
||||
|
||||
if (key_dest != key_console && !con_forcedup)
|
||||
return; // don't draw anything
|
||||
|
||||
text = key_lines[edit_line];
|
||||
|
||||
// add the cursor frame
|
||||
text[key_linepos] = 10+((int)(realtime*con_cursorspeed)&1);
|
||||
|
||||
// fill out remainder with spaces
|
||||
for (i=key_linepos+1 ; i< con_linewidth ; i++)
|
||||
text[i] = ' ';
|
||||
|
||||
// prestep if horizontally scrolling
|
||||
if (key_linepos >= con_linewidth)
|
||||
text += 1 + key_linepos - con_linewidth;
|
||||
|
||||
// draw it
|
||||
y = con_vislines-16;
|
||||
|
||||
for (i=0 ; i<con_linewidth ; i++)
|
||||
Draw_Character ( (i+1)<<3, con_vislines - 16, text[i]);
|
||||
|
||||
// remove cursor
|
||||
key_lines[edit_line][key_linepos] = 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
Con_DrawNotify
|
||||
|
||||
Draws the last few lines of output transparently over the game top
|
||||
================
|
||||
*/
|
||||
void Con_DrawNotify (void)
|
||||
{
|
||||
int x, v;
|
||||
char *text;
|
||||
int i;
|
||||
float time;
|
||||
extern char chat_buffer[];
|
||||
|
||||
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 = realtime - time;
|
||||
if (time > con_notifytime.value)
|
||||
continue;
|
||||
text = con_text + (i % con_totallines)*con_linewidth;
|
||||
|
||||
clearnotify = 0;
|
||||
scr_copytop = 1;
|
||||
|
||||
for (x = 0 ; x < con_linewidth ; x++)
|
||||
Draw_Character ( (x+1)<<3, v, text[x]);
|
||||
|
||||
v += 8;
|
||||
}
|
||||
|
||||
|
||||
if (key_dest == key_message)
|
||||
{
|
||||
clearnotify = 0;
|
||||
scr_copytop = 1;
|
||||
|
||||
x = 0;
|
||||
|
||||
Draw_String (8, v, "say:");
|
||||
while(chat_buffer[x])
|
||||
{
|
||||
Draw_Character ( (x+5)<<3, v, chat_buffer[x]);
|
||||
x++;
|
||||
}
|
||||
Draw_Character ( (x+5)<<3, v, 10+((int)(realtime*con_cursorspeed)&1));
|
||||
v += 8;
|
||||
}
|
||||
|
||||
if (v > con_notifylines)
|
||||
con_notifylines = v;
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
Con_DrawConsole
|
||||
|
||||
Draws the console with the solid background
|
||||
The typing input line at the bottom should only be drawn if typing is allowed
|
||||
================
|
||||
*/
|
||||
void Con_DrawConsole (int lines, qboolean drawinput)
|
||||
{
|
||||
int i, x, y;
|
||||
int rows;
|
||||
char *text;
|
||||
int j;
|
||||
|
||||
if (lines <= 0)
|
||||
return;
|
||||
|
||||
// draw the background
|
||||
Draw_ConsoleBackground (lines);
|
||||
|
||||
// draw the text
|
||||
con_vislines = lines;
|
||||
|
||||
rows = (lines-16)>>3; // rows of text to draw
|
||||
y = lines - 16 - (rows<<3); // may start slightly negative
|
||||
|
||||
for (i= con_current - rows + 1 ; i<=con_current ; i++, y+=8 )
|
||||
{
|
||||
j = i - con_backscroll;
|
||||
if (j<0)
|
||||
j = 0;
|
||||
text = con_text + (j % con_totallines)*con_linewidth;
|
||||
|
||||
for (x=0 ; x<con_linewidth ; x++)
|
||||
Draw_Character ( (x+1)<<3, y, text[x]);
|
||||
}
|
||||
|
||||
// draw the input prompt, user text, and cursor if desired
|
||||
if (drawinput)
|
||||
Con_DrawInput ();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
Con_NotifyBox
|
||||
==================
|
||||
*/
|
||||
void Con_NotifyBox (char *text)
|
||||
{
|
||||
double t1, t2;
|
||||
|
||||
// during startup for sound / cd warnings
|
||||
Con_Printf("\n\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n");
|
||||
|
||||
Con_Printf (text);
|
||||
|
||||
Con_Printf ("Press a key.\n");
|
||||
Con_Printf("\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n");
|
||||
|
||||
key_count = -2; // wait for a key down and up
|
||||
key_dest = key_console;
|
||||
|
||||
do
|
||||
{
|
||||
t1 = Sys_DoubleTime ();
|
||||
SCR_UpdateScreen ();
|
||||
Sys_SendKeyEvents ();
|
||||
t2 = Sys_DoubleTime ();
|
||||
realtime += t2-t1; // make the cursor blink
|
||||
} while (key_count < 0);
|
||||
|
||||
Con_Printf ("\n");
|
||||
key_dest = key_game;
|
||||
realtime = 0; // put the cursor back to invisible
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
//
|
||||
// console
|
||||
//
|
||||
extern int con_totallines;
|
||||
extern int con_backscroll;
|
||||
extern qboolean con_forcedup; // because no entities to refresh
|
||||
extern qboolean con_initialized;
|
||||
extern byte *con_chars;
|
||||
extern int con_notifylines; // scan lines to clear for notify lines
|
||||
|
||||
void Con_DrawCharacter (int cx, int line, int num);
|
||||
|
||||
void Con_CheckResize (void);
|
||||
void Con_Init (void);
|
||||
void Con_DrawConsole (int lines, qboolean drawinput);
|
||||
void Con_Print (char *txt);
|
||||
void Con_Printf (char *fmt, ...);
|
||||
void Con_DPrintf (char *fmt, ...);
|
||||
void Con_SafePrintf (char *fmt, ...);
|
||||
void Con_Clear_f (void);
|
||||
void Con_DrawNotify (void);
|
||||
void Con_ClearNotify (void);
|
||||
void Con_ToggleConsole_f (void);
|
||||
|
||||
void Con_NotifyBox (char *text); // during startup for sound / cd warnings
|
||||
|
|
@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "d_local.h"
|
||||
#include <mathlib.h>
|
||||
|
||||
static int miplevel;
|
||||
|
||||
|
|
|
@ -22,6 +22,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "quakedef.h"
|
||||
#include "d_local.h"
|
||||
#include "r_local.h"
|
||||
#include <console.h>
|
||||
#include <sys.h>
|
||||
#include <lib_replace.h>
|
||||
|
||||
float surfscale;
|
||||
qboolean r_cache_thrash; // set if surface cache is thrashing
|
||||
|
|
|
@ -21,6 +21,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "glquake.h"
|
||||
#include <protocol.h>
|
||||
#include <sys.h>
|
||||
#include <mathlib.h>
|
||||
|
||||
entity_t *CL_EntityNum (int num);
|
||||
|
||||
/*
|
||||
|
@ -123,7 +127,7 @@ if (bits&(1<<i))
|
|||
if (bits & U_SKIN)
|
||||
skin = MSG_ReadByte();
|
||||
else
|
||||
skin = ent->baseline.skin;
|
||||
skin = ent->baseline.skinnum;
|
||||
if (skin != ent->skinnum) {
|
||||
ent->skinnum = skin;
|
||||
if (num > 0 && num <= cl.maxclients)
|
||||
|
|
|
@ -25,6 +25,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "glquake.h"
|
||||
#include <qtypes.h>
|
||||
#include <cvar.h>
|
||||
#include <sys.h>
|
||||
#include <mathlib.h>
|
||||
#include <lib_replace.h>
|
||||
#include <console.h>
|
||||
#include <d_iface.h>
|
||||
|
||||
model_t *loadmodel;
|
||||
char loadname[32]; // for hunk tags
|
||||
|
|
|
@ -21,6 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "glquake.h"
|
||||
#include <mathlib.h>
|
||||
#include <view.h>
|
||||
|
||||
int r_dlightframecount;
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "quakedef.h"
|
||||
#include "glquake.h"
|
||||
#include "r_local.h"
|
||||
#include <mathlib.h>
|
||||
|
||||
extern particle_t *active_particles, *free_particles;
|
||||
extern int ramp1[8], ramp2[8], ramp3[8];
|
||||
|
|
|
@ -25,6 +25,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "glquake.h"
|
||||
#include <qtypes.h>
|
||||
#include <sys.h>
|
||||
#include <cvar.h>
|
||||
#include <keys.h>
|
||||
#include <draw.h>
|
||||
#include <sbar.h>
|
||||
#include <cmd.h>
|
||||
#include <console.h>
|
||||
#include <sound.h>
|
||||
#include <screen.h>
|
||||
#include <menu.h>
|
||||
|
||||
#include <time.h>
|
||||
|
||||
|
@ -552,9 +563,7 @@ void SCR_SetUpToDrawConsole (void)
|
|||
return; // never a console with loading plaque
|
||||
|
||||
// decide on the height of the console
|
||||
con_forcedup = !cl.worldmodel || cls.signon != SIGNONS;
|
||||
|
||||
if (con_forcedup)
|
||||
if (cls.state != ca_active)
|
||||
{
|
||||
scr_conlines = vid.height; // full screen
|
||||
scr_con_current = scr_conlines;
|
||||
|
@ -599,7 +608,7 @@ void SCR_DrawConsole (void)
|
|||
if (scr_con_current)
|
||||
{
|
||||
scr_copyeverything = 1;
|
||||
Con_DrawConsole (scr_con_current, true);
|
||||
Con_DrawConsole (scr_con_current);
|
||||
clearconsole = 0;
|
||||
}
|
||||
else
|
||||
|
@ -693,7 +702,7 @@ void SCR_BeginLoadingPlaque (void)
|
|||
{
|
||||
S_StopAllSounds (true);
|
||||
|
||||
if (cls.state != ca_connected)
|
||||
if (cls.state < ca_connected)
|
||||
return;
|
||||
if (cls.signon != SIGNONS)
|
||||
return;
|
||||
|
|
|
@ -21,6 +21,26 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "r_local.h"
|
||||
#include <qtypes.h>
|
||||
#include <console.h>
|
||||
#include <lib_replace.h>
|
||||
#include <cvar.h>
|
||||
#include <sys.h>
|
||||
#include <sound.h>
|
||||
#include <keys.h>
|
||||
#include <view.h>
|
||||
#include <render.h>
|
||||
#include <net.h>
|
||||
#include <menu.h>
|
||||
#include <sbar.h>
|
||||
#include <cdaudio.h>
|
||||
#include <cmd.h>
|
||||
#include <input.h>
|
||||
#include <draw.h>
|
||||
#include <screen.h>
|
||||
#include <wad.h>
|
||||
#include <protocol.h>
|
||||
#include <mathlib.h>
|
||||
|
||||
/*
|
||||
|
||||
|
@ -426,7 +446,7 @@ void Host_ShutdownServer(qboolean crash)
|
|||
sv.active = false;
|
||||
|
||||
// stop all client sounds immediately
|
||||
if (cls.state == ca_connected)
|
||||
if (cls.state >= ca_connected)
|
||||
CL_Disconnect ();
|
||||
|
||||
// flush any pending messages - like the score!!!
|
||||
|
@ -698,7 +718,7 @@ void _Host_Frame (float time)
|
|||
host_time += host_frametime;
|
||||
|
||||
// fetch results from server
|
||||
if (cls.state == ca_connected)
|
||||
if (cls.state >= ca_connected)
|
||||
{
|
||||
CL_ReadFromServer ();
|
||||
}
|
||||
|
|
|
@ -20,6 +20,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
|
||||
#include "quakedef.h"
|
||||
#include <qtypes.h>
|
||||
#include <cvar.h>
|
||||
#include <net.h>
|
||||
#include <cmd.h>
|
||||
#include <keys.h>
|
||||
#include <console.h>
|
||||
#include <sys.h>
|
||||
#include <screen.h>
|
||||
#include <lib_replace.h>
|
||||
#include <protocol.h>
|
||||
|
||||
extern cvar_t pausable;
|
||||
|
||||
|
@ -932,7 +942,7 @@ void Host_Name_f (void)
|
|||
if (Q_strcmp(cl_name.string, newName) == 0)
|
||||
return;
|
||||
Cvar_Set ("_cl_name", newName);
|
||||
if (cls.state == ca_connected)
|
||||
if (cls.state >= ca_connected)
|
||||
Cmd_ForwardToServer ();
|
||||
return;
|
||||
}
|
||||
|
@ -1132,7 +1142,7 @@ void Host_Color_f(void)
|
|||
if (cmd_source == src_command)
|
||||
{
|
||||
Cvar_SetValue ("_cl_color", playercolor);
|
||||
if (cls.state == ca_connected)
|
||||
if (cls.state >= ca_connected)
|
||||
Cmd_ForwardToServer ();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1,319 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
Portions Copyright (C) 1999,2000 Nelson Rush.
|
||||
Copyright (C) 1999,2000 contributors of the QuakeForge project
|
||||
Please see the file "AUTHORS" for a list of contributors
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// common.c -- misc functions used in client and server
|
||||
|
||||
/*
|
||||
============================================================================
|
||||
|
||||
LIBRARY REPLACEMENT FUNCTIONS
|
||||
|
||||
============================================================================
|
||||
*/
|
||||
|
||||
void Q_memset (void *dest, int fill, int count)
|
||||
{
|
||||
int i;
|
||||
|
||||
if ( (((long)dest | count) & 3) == 0)
|
||||
{
|
||||
count >>= 2;
|
||||
fill = fill | (fill<<8) | (fill<<16) | (fill<<24);
|
||||
for (i=0 ; i<count ; i++)
|
||||
((int *)dest)[i] = fill;
|
||||
}
|
||||
else
|
||||
for (i=0 ; i<count ; i++)
|
||||
((byte *)dest)[i] = fill;
|
||||
}
|
||||
|
||||
void Q_memcpy (void *dest, void *src, int count)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (( ( (long)dest | (long)src | count) & 3) == 0 )
|
||||
{
|
||||
count>>=2;
|
||||
for (i=0 ; i<count ; i++)
|
||||
((int *)dest)[i] = ((int *)src)[i];
|
||||
}
|
||||
else
|
||||
for (i=0 ; i<count ; i++)
|
||||
((byte *)dest)[i] = ((byte *)src)[i];
|
||||
}
|
||||
|
||||
int Q_memcmp (void *m1, void *m2, int count)
|
||||
{
|
||||
while(count)
|
||||
{
|
||||
count--;
|
||||
if (((byte *)m1)[count] != ((byte *)m2)[count])
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Q_strcpy (char *dest, char *src)
|
||||
{
|
||||
while (*src)
|
||||
{
|
||||
*dest++ = *src++;
|
||||
}
|
||||
*dest++ = 0;
|
||||
}
|
||||
|
||||
void Q_strncpy (char *dest, char *src, int count)
|
||||
{
|
||||
while (*src && count--)
|
||||
{
|
||||
*dest++ = *src++;
|
||||
}
|
||||
if (count)
|
||||
*dest++ = 0;
|
||||
}
|
||||
|
||||
int Q_strlen (char *str)
|
||||
{
|
||||
int count;
|
||||
|
||||
count = 0;
|
||||
while (str[count])
|
||||
count++;
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
char *Q_strrchr(char *s, char c)
|
||||
{
|
||||
int len = Q_strlen(s);
|
||||
s += len;
|
||||
while (len--)
|
||||
if (*--s == c) return s;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Q_strcat (char *dest, char *src)
|
||||
{
|
||||
dest += Q_strlen(dest);
|
||||
Q_strcpy (dest, src);
|
||||
}
|
||||
|
||||
int Q_strcmp (char *s1, char *s2)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
if (*s1 != *s2)
|
||||
return -1; // strings not equal
|
||||
if (!*s1)
|
||||
return 0; // strings are equal
|
||||
s1++;
|
||||
s2++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int Q_strncmp (char *s1, char *s2, int count)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
if (!count--)
|
||||
return 0;
|
||||
if (*s1 != *s2)
|
||||
return -1; // strings not equal
|
||||
if (!*s1)
|
||||
return 0; // strings are equal
|
||||
s1++;
|
||||
s2++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int Q_strncasecmp (char *s1, char *s2, int n)
|
||||
{
|
||||
int c1, c2;
|
||||
|
||||
while (1)
|
||||
{
|
||||
c1 = *s1++;
|
||||
c2 = *s2++;
|
||||
|
||||
if (!n--)
|
||||
return 0; // strings are equal until end point
|
||||
|
||||
if (c1 != c2)
|
||||
{
|
||||
if (c1 >= 'a' && c1 <= 'z')
|
||||
c1 -= ('a' - 'A');
|
||||
if (c2 >= 'a' && c2 <= 'z')
|
||||
c2 -= ('a' - 'A');
|
||||
if (c1 != c2)
|
||||
return -1; // strings not equal
|
||||
}
|
||||
if (!c1)
|
||||
return 0; // strings are equal
|
||||
// s1++;
|
||||
// s2++;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
int Q_strcasecmp (char *s1, char *s2)
|
||||
{
|
||||
return Q_strncasecmp (s1, s2, 99999);
|
||||
}
|
||||
|
||||
int Q_atoi (char *str)
|
||||
{
|
||||
int val;
|
||||
int sign;
|
||||
int c;
|
||||
|
||||
if (*str == '-')
|
||||
{
|
||||
sign = -1;
|
||||
str++;
|
||||
}
|
||||
else
|
||||
sign = 1;
|
||||
|
||||
val = 0;
|
||||
|
||||
//
|
||||
// check for hex
|
||||
//
|
||||
if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X') )
|
||||
{
|
||||
str += 2;
|
||||
while (1)
|
||||
{
|
||||
c = *str++;
|
||||
if (c >= '0' && c <= '9')
|
||||
val = (val<<4) + c - '0';
|
||||
else if (c >= 'a' && c <= 'f')
|
||||
val = (val<<4) + c - 'a' + 10;
|
||||
else if (c >= 'A' && c <= 'F')
|
||||
val = (val<<4) + c - 'A' + 10;
|
||||
else
|
||||
return val*sign;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// check for character
|
||||
//
|
||||
if (str[0] == '\'')
|
||||
{
|
||||
return sign * str[1];
|
||||
}
|
||||
|
||||
//
|
||||
// assume decimal
|
||||
//
|
||||
while (1)
|
||||
{
|
||||
c = *str++;
|
||||
if (c <'0' || c > '9')
|
||||
return val*sign;
|
||||
val = val*10 + c - '0';
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
float Q_atof (char *str)
|
||||
{
|
||||
double val;
|
||||
int sign;
|
||||
int c;
|
||||
int decimal, total;
|
||||
|
||||
if (*str == '-')
|
||||
{
|
||||
sign = -1;
|
||||
str++;
|
||||
}
|
||||
else
|
||||
sign = 1;
|
||||
|
||||
val = 0;
|
||||
|
||||
//
|
||||
// check for hex
|
||||
//
|
||||
if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X') )
|
||||
{
|
||||
str += 2;
|
||||
while (1)
|
||||
{
|
||||
c = *str++;
|
||||
if (c >= '0' && c <= '9')
|
||||
val = (val*16) + c - '0';
|
||||
else if (c >= 'a' && c <= 'f')
|
||||
val = (val*16) + c - 'a' + 10;
|
||||
else if (c >= 'A' && c <= 'F')
|
||||
val = (val*16) + c - 'A' + 10;
|
||||
else
|
||||
return val*sign;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// check for character
|
||||
//
|
||||
if (str[0] == '\'')
|
||||
{
|
||||
return sign * str[1];
|
||||
}
|
||||
|
||||
//
|
||||
// assume decimal
|
||||
//
|
||||
decimal = -1;
|
||||
total = 0;
|
||||
while (1)
|
||||
{
|
||||
c = *str++;
|
||||
if (c == '.')
|
||||
{
|
||||
decimal = total;
|
||||
continue;
|
||||
}
|
||||
if (c <'0' || c > '9')
|
||||
break;
|
||||
val = val*10 + c - '0';
|
||||
total++;
|
||||
}
|
||||
|
||||
if (decimal == -1)
|
||||
return val*sign;
|
||||
while (total > decimal)
|
||||
{
|
||||
val /= 10;
|
||||
total--;
|
||||
}
|
||||
|
||||
return val*sign;
|
||||
}
|
|
@ -20,7 +20,25 @@ along with this program; if not, write to the Free Software
|
|||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
#include "quakedef.h"
|
||||
#include <qtypes.h>
|
||||
#include <keys.h>
|
||||
#include <draw.h>
|
||||
#include <vid.h>
|
||||
#include <render.h>
|
||||
#include <console.h>
|
||||
#include <client.h>
|
||||
#include <wad.h>
|
||||
#include <server.h>
|
||||
#include <sound.h>
|
||||
#include <screen.h>
|
||||
#include <cmd.h>
|
||||
#include <quakedef.h>
|
||||
#include <net.h>
|
||||
#include <menu.h>
|
||||
#include <lib_replace.h>
|
||||
#include <sys.h>
|
||||
#include <cvar.h>
|
||||
#include <view.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "winquake.h"
|
||||
|
|
|
@ -25,6 +25,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "r_local.h"
|
||||
#include <lib_replace.h>
|
||||
#include <sys.h>
|
||||
#include <mathlib.h>
|
||||
#include <console.h>
|
||||
|
||||
model_t *loadmodel;
|
||||
char loadname[32]; // for hunk tags
|
||||
|
|
|
@ -19,6 +19,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
// net.h -- quake's interface to the networking layer
|
||||
|
||||
#ifndef _NET_H
|
||||
#define _NET_H
|
||||
|
||||
struct qsockaddr
|
||||
{
|
||||
short sa_family;
|
||||
|
@ -316,3 +319,5 @@ extern qboolean slistSilent;
|
|||
extern qboolean slistLocal;
|
||||
|
||||
void NET_Slist_f (void);
|
||||
|
||||
#endif // _NET_H
|
||||
|
|
|
@ -55,6 +55,14 @@ unsigned long inet_addr(const char *cp);
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "net_dgrm.h"
|
||||
#include <qtypes.h>
|
||||
#include <cmd.h>
|
||||
#include <lib_replace.h>
|
||||
#include <console.h>
|
||||
#include <sys.h>
|
||||
#include <cvar.h>
|
||||
#include <screen.h>
|
||||
#include <keys.h>
|
||||
|
||||
// these two macros are to make the code more readable
|
||||
#define sfunc net_landrivers[sock->landriver]
|
||||
|
@ -125,6 +133,7 @@ void NET_Ban_f (void)
|
|||
print = SV_ClientPrintf;
|
||||
}
|
||||
|
||||
|
||||
switch (Cmd_Argc ())
|
||||
{
|
||||
case 1:
|
||||
|
|
|
@ -20,6 +20,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
// net_dgrm.h
|
||||
|
||||
|
||||
#ifndef _NET_DGRM_H
|
||||
#define _NET_DGRM_H
|
||||
|
||||
#include <qtypes.h>
|
||||
#include <net.h>
|
||||
|
||||
int Datagram_Init (void);
|
||||
void Datagram_Listen (qboolean state);
|
||||
void Datagram_SearchForHosts (qboolean xmit);
|
||||
|
@ -32,3 +38,5 @@ qboolean Datagram_CanSendMessage (qsocket_t *sock);
|
|||
qboolean Datagram_CanSendUnreliableMessage (qsocket_t *sock);
|
||||
void Datagram_Close (qsocket_t *sock);
|
||||
void Datagram_Shutdown (void);
|
||||
|
||||
#endif // _NET_DGRM_H
|
||||
|
|
|
@ -21,6 +21,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "net_loop.h"
|
||||
#include <lib_replace.h>
|
||||
#include <sys.h>
|
||||
#include <console.h>
|
||||
|
||||
qboolean localconnectpending = false;
|
||||
qsocket_t *loop_client = NULL;
|
||||
|
|
|
@ -19,6 +19,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
// net_loop.h
|
||||
|
||||
#ifndef _NET_LOOP_H
|
||||
#define _NET_LOOP_H
|
||||
|
||||
#include <qtypes.h>
|
||||
#include <net.h>
|
||||
|
||||
int Loop_Init (void);
|
||||
void Loop_Listen (qboolean state);
|
||||
void Loop_SearchForHosts (qboolean xmit);
|
||||
|
@ -31,3 +37,5 @@ qboolean Loop_CanSendMessage (qsocket_t *sock);
|
|||
qboolean Loop_CanSendUnreliableMessage (qsocket_t *sock);
|
||||
void Loop_Close (qsocket_t *sock);
|
||||
void Loop_Shutdown (void);
|
||||
|
||||
#endif // _NET_LOOP_H
|
||||
|
|
|
@ -21,6 +21,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "net_vcr.h"
|
||||
#include <qtypes.h>
|
||||
#include <net.h>
|
||||
#include <sys.h>
|
||||
#include <lib_replace.h>
|
||||
#include <cvar.h>
|
||||
#include <cmd.h>
|
||||
#include <console.h>
|
||||
|
||||
qsocket_t *net_activeSockets = NULL;
|
||||
qsocket_t *net_freeSockets = NULL;
|
||||
|
|
|
@ -22,6 +22,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
// net_udp.c
|
||||
|
||||
#include "quakedef.h"
|
||||
#include <qtypes.h>
|
||||
#include <lib_replace.h>
|
||||
#include <sys.h>
|
||||
#include <cvar.h>
|
||||
#include <net.h>
|
||||
#include <console.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
|
|
@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "net_vcr.h"
|
||||
#include <sys.h>
|
||||
|
||||
extern int vcrFile;
|
||||
|
||||
|
|
|
@ -19,6 +19,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
// net_vcr.h
|
||||
|
||||
#ifndef _NET_VCR_H
|
||||
#define _NET_VCR_H
|
||||
|
||||
#include <qtypes.h>
|
||||
#include <net.h>
|
||||
|
||||
#define VCR_OP_CONNECT 1
|
||||
#define VCR_OP_GETMESSAGE 2
|
||||
#define VCR_OP_SENDMESSAGE 3
|
||||
|
@ -35,3 +41,5 @@ int VCR_SendMessage (qsocket_t *sock, sizebuf_t *data);
|
|||
qboolean VCR_CanSendMessage (qsocket_t *sock);
|
||||
void VCR_Close (qsocket_t *sock);
|
||||
void VCR_Shutdown (void);
|
||||
|
||||
#endif // _NET_VCR_H
|
||||
|
|
|
@ -165,14 +165,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define TE_IMPLOSION 14
|
||||
#define TE_RAILTRAIL 15
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
vec3_t origin;
|
||||
vec3_t angles;
|
||||
int modelindex;
|
||||
int frame;
|
||||
int colormap;
|
||||
int skin;
|
||||
int effects;
|
||||
} entity_state_t;
|
||||
|
|
840
uquake/quakefs.c
840
uquake/quakefs.c
|
@ -1,840 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
Portions Copyright (C) 1999,2000 Nelson Rush.
|
||||
Copyright (C) 1999,2000 contributors of the QuakeForge project
|
||||
Please see the file "AUTHORS" for a list of contributors
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// common.c -- misc functions used in client and server
|
||||
|
||||
/*
|
||||
All of Quake's data access is through a hierchal file system, but the contents of the file system can be transparently merged from several sources.
|
||||
|
||||
The "base directory" is the path to the directory holding the quake.exe and all game directories. The sys_* files pass this to host_init in quakeparms_t->basedir. This can be overridden with the "-basedir" command line parm to allow code debugging in a different directory. The base directory is
|
||||
only used during filesystem initialization.
|
||||
|
||||
The "game directory" is the first tree on the search path and directory that all generated files (savegames, screenshots, demos, config files) will be saved to. This can be overridden with the "-game" command line parameter. The game directory can never be changed while quake is executing. This is a precacution against having a malicious server instruct clients to write files over areas they shouldn't.
|
||||
|
||||
The "cache directory" is only used during development to save network bandwidth, especially over ISDN / T1 lines. If there is a cache directory
|
||||
specified, when a file is found by the normal search path, it will be mirrored
|
||||
into the cache directory, then opened there.
|
||||
|
||||
|
||||
|
||||
FIXME:
|
||||
The file "parms.txt" will be read out of the game directory and appended to the current command line arguments to allow different games to initialize startup parms differently. This could be used to add a "-sspeed 22050" for the high quality sound edition. Because they are added at the end, they will not override an explicit setting on the original command line.
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
QUAKE FILESYSTEM
|
||||
|
||||
=============================================================================
|
||||
*/
|
||||
|
||||
/* Begin Generations */
|
||||
#ifdef _EXPERIMENTAL_
|
||||
#include "unzip.h"
|
||||
#endif
|
||||
|
||||
typedef unsigned char byte_t;
|
||||
|
||||
#ifndef _AIX
|
||||
typedef unsigned int uint_t;
|
||||
typedef unsigned short ushort_t;
|
||||
#endif
|
||||
/* End Generations */
|
||||
|
||||
int com_filesize;
|
||||
|
||||
|
||||
//
|
||||
// in memory
|
||||
//
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[MAX_QPATH];
|
||||
int filepos, filelen;
|
||||
} packfile_t;
|
||||
|
||||
typedef struct pack_s
|
||||
{
|
||||
char filename[MAX_OSPATH];
|
||||
int handle;
|
||||
int numfiles;
|
||||
packfile_t *files;
|
||||
} pack_t;
|
||||
|
||||
//
|
||||
// on disk
|
||||
//
|
||||
typedef struct
|
||||
{
|
||||
char name[56];
|
||||
int filepos, filelen;
|
||||
} dpackfile_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char id[4];
|
||||
int dirofs;
|
||||
int dirlen;
|
||||
} dpackheader_t;
|
||||
|
||||
#define MAX_FILES_IN_PACK 2048
|
||||
|
||||
char com_cachedir[MAX_OSPATH];
|
||||
char com_gamedir[MAX_OSPATH];
|
||||
|
||||
typedef struct searchpath_s
|
||||
{
|
||||
char filename[MAX_OSPATH];
|
||||
pack_t *pack; // only one of filename / pack will be used
|
||||
struct searchpath_s *next;
|
||||
} searchpath_t;
|
||||
|
||||
searchpath_t *com_searchpaths;
|
||||
|
||||
/*
|
||||
============
|
||||
COM_Path_f
|
||||
|
||||
============
|
||||
*/
|
||||
void COM_Path_f (void)
|
||||
{
|
||||
searchpath_t *s;
|
||||
|
||||
Con_Printf ("Current search path:\n");
|
||||
for (s=com_searchpaths ; s ; s=s->next)
|
||||
{
|
||||
if (s->pack)
|
||||
{
|
||||
Con_Printf ("%s (%i files)\n", s->pack->filename, s->pack->numfiles);
|
||||
}
|
||||
else
|
||||
Con_Printf ("%s\n", s->filename);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
COM_WriteFile
|
||||
|
||||
The filename will be prefixed by the current game directory
|
||||
============
|
||||
*/
|
||||
void COM_WriteFile (char *filename, void *data, int len)
|
||||
{
|
||||
int handle;
|
||||
char name[MAX_OSPATH];
|
||||
|
||||
snprintf(name, sizeof(name), "%s/%s", com_gamedir, filename);
|
||||
|
||||
handle = Sys_FileOpenWrite (name);
|
||||
if (handle == -1)
|
||||
{
|
||||
Sys_Printf ("COM_WriteFile: failed on %s\n", name);
|
||||
return;
|
||||
}
|
||||
|
||||
Sys_Printf ("COM_WriteFile: %s\n", name);
|
||||
Sys_FileWrite (handle, data, len);
|
||||
Sys_FileClose (handle);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
============
|
||||
COM_CreatePath
|
||||
|
||||
Only used for CopyFile
|
||||
============
|
||||
*/
|
||||
void COM_CreatePath (char *path)
|
||||
{
|
||||
char *ofs;
|
||||
|
||||
for (ofs = path+1 ; *ofs ; ofs++)
|
||||
{
|
||||
if (*ofs == '/')
|
||||
{ // create the directory
|
||||
*ofs = 0;
|
||||
Sys_mkdir (path);
|
||||
*ofs = '/';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===========
|
||||
COM_CopyFile
|
||||
|
||||
Copies a file over from the net to the local cache, creating any directories
|
||||
needed. This is for the convenience of developers using ISDN from home.
|
||||
===========
|
||||
*/
|
||||
void COM_CopyFile (char *netpath, char *cachepath)
|
||||
{
|
||||
int in, out;
|
||||
int remaining, count;
|
||||
char buf[4096];
|
||||
|
||||
remaining = Sys_FileOpenRead (netpath, &in);
|
||||
COM_CreatePath (cachepath); // create directories up to the cache file
|
||||
out = Sys_FileOpenWrite (cachepath);
|
||||
|
||||
while (remaining)
|
||||
{
|
||||
if (remaining < sizeof(buf))
|
||||
count = remaining;
|
||||
else
|
||||
count = sizeof(buf);
|
||||
Sys_FileRead (in, buf, count);
|
||||
Sys_FileWrite (out, buf, count);
|
||||
remaining -= count;
|
||||
}
|
||||
|
||||
Sys_FileClose (in);
|
||||
Sys_FileClose (out);
|
||||
}
|
||||
|
||||
/*
|
||||
===========
|
||||
COM_FindFile
|
||||
|
||||
Finds the file in the search path.
|
||||
Sets com_filesize and one of handle or file
|
||||
===========
|
||||
*/
|
||||
int COM_FindFile (char *filename, int *handle, FILE **file)
|
||||
{
|
||||
searchpath_t *search;
|
||||
char netpath[MAX_OSPATH];
|
||||
char cachepath[MAX_OSPATH];
|
||||
pack_t *pak;
|
||||
int i;
|
||||
int findtime, cachetime;
|
||||
|
||||
if (file && handle)
|
||||
Sys_Error ("COM_FindFile: both handle and file set");
|
||||
if (!file && !handle)
|
||||
Sys_Error ("COM_FindFile: neither handle or file set");
|
||||
|
||||
//
|
||||
// search through the path, one element at a time
|
||||
//
|
||||
search = com_searchpaths;
|
||||
if (proghack)
|
||||
{ // gross hack to use quake 1 progs with quake 2 maps
|
||||
if (!strcmp(filename, "progs.dat"))
|
||||
search = search->next;
|
||||
}
|
||||
|
||||
for ( ; search ; search = search->next)
|
||||
{
|
||||
// is the element a pak file?
|
||||
if (search->pack)
|
||||
{
|
||||
// look through all the pak file elements
|
||||
pak = search->pack;
|
||||
for (i=0 ; i<pak->numfiles ; i++)
|
||||
if (!strcmp (pak->files[i].name, filename))
|
||||
{ // found it!
|
||||
if(developer.value)
|
||||
Sys_Printf ("PackFile: %s : %s\n",pak->filename, filename);
|
||||
if (handle)
|
||||
{
|
||||
*handle = pak->handle;
|
||||
Sys_FileSeek (pak->handle, pak->files[i].filepos);
|
||||
}
|
||||
else
|
||||
{ // open a new file on the pakfile
|
||||
*file = fopen (pak->filename, "rb");
|
||||
if (*file)
|
||||
fseek (*file, pak->files[i].filepos, SEEK_SET);
|
||||
}
|
||||
com_filesize = pak->files[i].filelen;
|
||||
return com_filesize;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// check a file in the directory tree
|
||||
snprintf(netpath, sizeof(netpath), "%s/%s",search->filename, filename);
|
||||
|
||||
findtime = Sys_FileTime (netpath);
|
||||
if (findtime == -1)
|
||||
continue;
|
||||
|
||||
// see if the file needs to be updated in the cache
|
||||
if (!com_cachedir[0])
|
||||
strcpy (cachepath, netpath);
|
||||
else
|
||||
{
|
||||
#if defined(_WIN32)
|
||||
if ((strlen(netpath) < 2) || (netpath[1] != ':'))
|
||||
snprintf(cachepath, sizeof(cachepath),"%s%s", com_cachedir, netpath);
|
||||
else
|
||||
snprintf(cachepath, sizeof(cachepath),"%s%s", com_cachedir, netpath+2);
|
||||
#else
|
||||
snprintf(cachepath, sizeof(cachepath),"%s%s", com_cachedir, netpath);
|
||||
#endif
|
||||
|
||||
cachetime = Sys_FileTime (cachepath);
|
||||
|
||||
if (cachetime < findtime)
|
||||
COM_CopyFile (netpath, cachepath);
|
||||
strcpy (netpath, cachepath);
|
||||
}
|
||||
|
||||
if(developer.value)
|
||||
Sys_Printf ("FindFile: %s\n",netpath);
|
||||
com_filesize = Sys_FileOpenRead (netpath, &i);
|
||||
if (handle)
|
||||
*handle = i;
|
||||
else
|
||||
{
|
||||
Sys_FileClose (i);
|
||||
*file = fopen (netpath, "rb");
|
||||
}
|
||||
return com_filesize;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Sys_Printf ("FindFile: can't find %s\n", filename);
|
||||
|
||||
if (handle)
|
||||
*handle = -1;
|
||||
else
|
||||
*file = NULL;
|
||||
com_filesize = -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===========
|
||||
COM_OpenFile
|
||||
|
||||
filename never has a leading slash, but may contain directory walks
|
||||
returns a handle and a length
|
||||
it may actually be inside a pak file
|
||||
===========
|
||||
*/
|
||||
int COM_OpenFile (char *filename, int *handle)
|
||||
{
|
||||
return COM_FindFile (filename, handle, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
===========
|
||||
COM_FOpenFile
|
||||
|
||||
If the requested file is inside a packfile, a new FILE * will be opened
|
||||
into the file.
|
||||
===========
|
||||
*/
|
||||
int COM_FOpenFile (char *filename, FILE **file)
|
||||
{
|
||||
return COM_FindFile (filename, NULL, file);
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
COM_CloseFile
|
||||
|
||||
If it is a pak file handle, don't really close it
|
||||
============
|
||||
*/
|
||||
void COM_CloseFile (int h)
|
||||
{
|
||||
searchpath_t *s;
|
||||
|
||||
for (s = com_searchpaths ; s ; s=s->next)
|
||||
if (s->pack && s->pack->handle == h)
|
||||
return;
|
||||
|
||||
Sys_FileClose (h);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
============
|
||||
COM_LoadFile
|
||||
|
||||
Filename are reletive to the quake directory.
|
||||
Allways appends a 0 byte.
|
||||
============
|
||||
*/
|
||||
cache_user_t *loadcache;
|
||||
byte *loadbuf;
|
||||
int loadsize;
|
||||
byte *COM_LoadFile (char *path, int usehunk)
|
||||
{
|
||||
int h;
|
||||
byte *buf;
|
||||
char base[32];
|
||||
int len;
|
||||
|
||||
buf = NULL; // quiet compiler warning
|
||||
|
||||
// look for it in the filesystem or pack files
|
||||
len = COM_OpenFile (path, &h);
|
||||
if (h == -1)
|
||||
return NULL;
|
||||
|
||||
// extract the filename base name for hunk tag
|
||||
COM_FileBase (path, base);
|
||||
|
||||
if (usehunk == 1)
|
||||
buf = Hunk_AllocName (len+1, base);
|
||||
else if (usehunk == 2)
|
||||
buf = Hunk_TempAlloc (len+1);
|
||||
else if (usehunk == 0)
|
||||
buf = Z_Malloc (len+1);
|
||||
else if (usehunk == 3)
|
||||
buf = Cache_Alloc (loadcache, len+1, base);
|
||||
else if (usehunk == 4)
|
||||
{
|
||||
if (len+1 > loadsize)
|
||||
buf = Hunk_TempAlloc (len+1);
|
||||
else
|
||||
buf = loadbuf;
|
||||
}
|
||||
else
|
||||
Sys_Error ("COM_LoadFile: bad usehunk");
|
||||
|
||||
if (!buf)
|
||||
Sys_Error ("COM_LoadFile: not enough space for %s", path);
|
||||
|
||||
((byte *)buf)[len] = 0;
|
||||
|
||||
Draw_BeginDisc ();
|
||||
Sys_FileRead (h, buf, len);
|
||||
COM_CloseFile (h);
|
||||
Draw_EndDisc ();
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
byte *COM_LoadHunkFile (char *path)
|
||||
{
|
||||
return COM_LoadFile (path, 1);
|
||||
}
|
||||
|
||||
byte *COM_LoadTempFile (char *path)
|
||||
{
|
||||
return COM_LoadFile (path, 2);
|
||||
}
|
||||
|
||||
void COM_LoadCacheFile (char *path, struct cache_user_s *cu)
|
||||
{
|
||||
loadcache = cu;
|
||||
COM_LoadFile (path, 3);
|
||||
}
|
||||
|
||||
// uses temp hunk if larger than bufsize
|
||||
byte *COM_LoadStackFile (char *path, void *buffer, int bufsize)
|
||||
{
|
||||
byte *buf;
|
||||
|
||||
loadbuf = (byte *)buffer;
|
||||
loadsize = bufsize;
|
||||
buf = COM_LoadFile (path, 4);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
COM_LoadPackFile
|
||||
|
||||
Takes an explicit (not game tree related) path to a pak file.
|
||||
|
||||
Loads the header and directory, adding the files at the beginning
|
||||
of the list so they override previous pack files.
|
||||
=================
|
||||
*/
|
||||
pack_t *COM_LoadPackFile (char *packfile)
|
||||
{
|
||||
dpackheader_t header;
|
||||
int i;
|
||||
packfile_t *newfiles;
|
||||
int numpackfiles;
|
||||
pack_t *pack;
|
||||
int packhandle;
|
||||
dpackfile_t info[MAX_FILES_IN_PACK];
|
||||
unsigned short crc;
|
||||
|
||||
if (Sys_FileOpenRead (packfile, &packhandle) == -1)
|
||||
{
|
||||
// Con_Printf ("Couldn't open %s\n", packfile);
|
||||
return NULL;
|
||||
}
|
||||
Sys_FileRead (packhandle, (void *)&header, sizeof(header));
|
||||
if (header.id[0] != 'P' || header.id[1] != 'A'
|
||||
|| header.id[2] != 'C' || header.id[3] != 'K')
|
||||
Sys_Error ("%s is not a packfile", packfile);
|
||||
header.dirofs = LittleLong (header.dirofs);
|
||||
header.dirlen = LittleLong (header.dirlen);
|
||||
|
||||
numpackfiles = header.dirlen / sizeof(dpackfile_t);
|
||||
|
||||
if (numpackfiles > MAX_FILES_IN_PACK)
|
||||
Sys_Error ("%s has %i files", packfile, numpackfiles);
|
||||
|
||||
if (numpackfiles != PAK0_COUNT)
|
||||
com_modified = true; // not the original file
|
||||
|
||||
newfiles = Hunk_AllocName (numpackfiles * sizeof(packfile_t), "packfile");
|
||||
|
||||
Sys_FileSeek (packhandle, header.dirofs);
|
||||
Sys_FileRead (packhandle, (void *)info, header.dirlen);
|
||||
|
||||
// crc the directory to check for modifications
|
||||
CRC_Init (&crc);
|
||||
for (i=0 ; i<header.dirlen ; i++)
|
||||
CRC_ProcessByte (&crc, ((byte *)info)[i]);
|
||||
if (crc != PAK0_CRC)
|
||||
com_modified = true;
|
||||
|
||||
// parse the directory
|
||||
for (i=0 ; i<numpackfiles ; i++)
|
||||
{
|
||||
strcpy (newfiles[i].name, info[i].name);
|
||||
newfiles[i].filepos = LittleLong(info[i].filepos);
|
||||
newfiles[i].filelen = LittleLong(info[i].filelen);
|
||||
}
|
||||
|
||||
pack = Hunk_Alloc (sizeof (pack_t));
|
||||
strcpy (pack->filename, packfile);
|
||||
pack->handle = packhandle;
|
||||
pack->numfiles = numpackfiles;
|
||||
pack->files = newfiles;
|
||||
|
||||
Con_Printf ("Added packfile %s (%i files)\n", packfile, numpackfiles);
|
||||
return pack;
|
||||
}
|
||||
|
||||
int
|
||||
COM_pak3_checkfile(unzFile *pak, const char *path)
|
||||
{
|
||||
int status;
|
||||
|
||||
status = unzLocateFile(pak, path, 2);
|
||||
return (status == UNZ_OK);
|
||||
}
|
||||
|
||||
void
|
||||
COM_pak3_closepak(unzFile *pak)
|
||||
{
|
||||
if (pak)
|
||||
unzClose(pak);
|
||||
pak = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
COM_pak3_close(unzFile *pak)
|
||||
{
|
||||
unzCloseCurrentFile(pak);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
COM_pak3_read(unzFile *pak, void *buf, uint_t size, uint_t nmemb)
|
||||
{
|
||||
int len;
|
||||
|
||||
len = unzReadCurrentFile(pak, buf, size * nmemb);
|
||||
return len / size;
|
||||
}
|
||||
|
||||
int
|
||||
COM_pak3_open(unzFile *pak, const char *path)
|
||||
{
|
||||
if (unzLocateFile(pak, path, 2) != UNZ_OK)
|
||||
return 0;
|
||||
if (unzOpenCurrentFile(pak) != UNZ_OK)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint_t
|
||||
COM_pak3_getlen(unzFile *pak)
|
||||
{
|
||||
unz_file_info info;
|
||||
|
||||
if (unzGetCurrentFileInfo(pak, &info, NULL, 0, NULL, 0, NULL, 0)
|
||||
!= UNZ_OK)
|
||||
return 0;
|
||||
return info.uncompressed_size;
|
||||
}
|
||||
|
||||
uint_t
|
||||
COM_pak3_readfile(unzFile *pak, const char *path, uint_t bufsize, byte_t *buf)
|
||||
{
|
||||
uint_t len;
|
||||
|
||||
if (!COM_pak3_open(pak,path))
|
||||
return 0;
|
||||
|
||||
if ((len = COM_pak3_getlen(pak)) != 0)
|
||||
{
|
||||
if (COM_pak3_read(pak, (void*)buf, 1, len) != len)
|
||||
len = 0;
|
||||
}
|
||||
COM_pak3_close(pak);
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
// Todo: Make This work! :)
|
||||
#if defined _EXPERIMENTAL_ && GENERATIONS
|
||||
pack_t *COM_LoadQ3PackFile (char *packfile)
|
||||
{
|
||||
|
||||
int i;
|
||||
packfile_t *newfiles;
|
||||
float numpackfiles;
|
||||
unzFile *pak;
|
||||
pack_t *pack_old;
|
||||
int status;
|
||||
// int packhandle;
|
||||
dpackfile_t info[MAX_FILES_IN_PACK];
|
||||
// unz_file_info fileInfo;
|
||||
char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1];
|
||||
// int err;
|
||||
|
||||
pak = unzOpen(packfile);
|
||||
|
||||
// numpackfiles = header.dirlen / sizeof(dpackfile_t);
|
||||
// numpackfiles = COM_pak3_getlen(*pak)/sizeof(unzFile);
|
||||
numpackfiles = 0;
|
||||
//= COM_pak3_getlen(pak)/sizeof(unzFile);
|
||||
Con_Printf ("Assigned Numpackfiles\n");
|
||||
|
||||
if (!pak)
|
||||
return NULL;
|
||||
|
||||
newfiles = Hunk_AllocName (numpackfiles * sizeof(unzFile), "packfile");
|
||||
|
||||
status=unzGoToFirstFile(pak);
|
||||
|
||||
while(status == UNZ_OK) {
|
||||
unzGetCurrentFileInfo(pak,NULL,&szCurrentFileName,64,NULL,0,NULL,0);
|
||||
|
||||
if(strcmp(newfiles[i].name, szCurrentFileName)==0)
|
||||
break;
|
||||
|
||||
strcpy (newfiles[i].name, szCurrentFileName);
|
||||
Con_Printf ("strcpy'ed %s into newfiles[%i].name Ok\n",szCurrentFileName, i);
|
||||
|
||||
newfiles[i].filepos = LittleLong(unztell(pak));
|
||||
// newfiles[i].filelen = LittleLong(COM_pak3_readfile(pak,packfile,64,64));
|
||||
|
||||
Con_Printf ("Added File\n");
|
||||
status=unzGoToNextFile(pak);
|
||||
++numpackfiles;
|
||||
++i;
|
||||
}
|
||||
|
||||
Con_Printf ("Added files in %s to game data Ok\n", packfile);
|
||||
|
||||
pack_old = Hunk_Alloc (sizeof (pack_t));
|
||||
strcpy (pack_old->filename, packfile);
|
||||
//pack_old->handle = unzGetLocalExtrafield(packfile, NULL, NULL);
|
||||
pack_old->numfiles = numpackfiles;
|
||||
pack_old->files = newfiles;
|
||||
|
||||
Con_Printf ("Added packfile %s (%.0f files)\n", packfile, numpackfiles);
|
||||
|
||||
COM_pak3_close(pak);
|
||||
return pack_old;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
COM_AddGameDirectory
|
||||
|
||||
Sets com_gamedir, adds the directory to the head of the path,
|
||||
then loads and adds pak1.pak pak2.pak ...
|
||||
================
|
||||
*/
|
||||
void COM_AddGameDirectory (char *dir)
|
||||
{
|
||||
int i;
|
||||
searchpath_t *search;
|
||||
pack_t *pak;
|
||||
char pakfile[MAX_OSPATH];
|
||||
|
||||
strcpy (com_gamedir, dir);
|
||||
|
||||
//
|
||||
// add the directory to the search path
|
||||
//
|
||||
search = Hunk_Alloc (sizeof(searchpath_t));
|
||||
strcpy (search->filename, dir);
|
||||
search->next = com_searchpaths;
|
||||
com_searchpaths = search;
|
||||
|
||||
//
|
||||
// add any pak files in the format pak0.pak pak1.pak, ...
|
||||
//
|
||||
for (i=0 ; ; i++)
|
||||
{
|
||||
snprintf(pakfile, sizeof(pakfile), "%s/pak%i.pak", dir, i);
|
||||
pak = COM_LoadPackFile (pakfile);
|
||||
if (!pak)
|
||||
break;
|
||||
search = Hunk_Alloc (sizeof(searchpath_t));
|
||||
search->pack = pak;
|
||||
search->next = com_searchpaths;
|
||||
com_searchpaths = search;
|
||||
}
|
||||
|
||||
//
|
||||
// add the contents of the parms.txt file to the end of the command line
|
||||
//
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
================
|
||||
COM_InitFilesystem
|
||||
================
|
||||
*/
|
||||
void COM_InitFilesystem (void)
|
||||
{
|
||||
int i, j, len;
|
||||
char basedir[MAX_OSPATH];
|
||||
searchpath_t *search;
|
||||
char * p;
|
||||
char * games;
|
||||
|
||||
//
|
||||
// -basedir <path>
|
||||
// Overrides the system supplied base directory (under GAMENAME)
|
||||
//
|
||||
i = COM_CheckParm ("-basedir");
|
||||
if (i && i < com_argc-1)
|
||||
strcpy (basedir, com_argv[i+1]);
|
||||
else
|
||||
strcpy (basedir, host_parms.basedir);
|
||||
|
||||
j = strlen (basedir);
|
||||
|
||||
if (j > 0)
|
||||
{
|
||||
if ((basedir[j-1] == '\\') || (basedir[j-1] == '/'))
|
||||
basedir[j-1] = 0;
|
||||
}
|
||||
|
||||
//
|
||||
// -cachedir <path>
|
||||
// Overrides the system supplied cache directory (NULL or /qcache)
|
||||
// -cachedir - will disable caching.
|
||||
//
|
||||
i = COM_CheckParm ("-cachedir");
|
||||
if (i && i < com_argc-1)
|
||||
{
|
||||
if (com_argv[i+1][0] == '-')
|
||||
com_cachedir[0] = 0;
|
||||
else
|
||||
strcpy (com_cachedir, com_argv[i+1]);
|
||||
}
|
||||
else if (host_parms.cachedir)
|
||||
strcpy (com_cachedir, host_parms.cachedir);
|
||||
else
|
||||
com_cachedir[0] = 0;
|
||||
|
||||
//
|
||||
// start up with GAMENAME by default
|
||||
//
|
||||
COM_AddGameDirectory (va("%s/"GAMENAME, basedir) );
|
||||
|
||||
if (COM_CheckParm ("-rogue"))
|
||||
COM_AddGameDirectory (va("%s/rogue", basedir) );
|
||||
if (COM_CheckParm ("-hipnotic"))
|
||||
COM_AddGameDirectory (va("%s/hipnotic", basedir) );
|
||||
|
||||
//
|
||||
// -game <gamedir>
|
||||
// Adds basedir/gamedir as an override game
|
||||
//
|
||||
i = COM_CheckParm ("-game");
|
||||
if (i && i < com_argc-1)
|
||||
{
|
||||
com_modified = true;
|
||||
|
||||
len = strlen(com_argv[i+1]) + 1;
|
||||
games = (char *)malloc(len);
|
||||
strcpy(games, com_argv[i+1]);
|
||||
|
||||
for (p = strtok(games, ",");
|
||||
p != NULL;
|
||||
p = strtok(NULL, ",")) {
|
||||
COM_AddGameDirectory (va("%s/%s", basedir, p));
|
||||
}
|
||||
|
||||
free(games);
|
||||
|
||||
// COM_AddGameDirectory (va("%s/%s", basedir, com_argv[i+1]));
|
||||
}
|
||||
|
||||
//
|
||||
// -path <dir or packfile> [<dir or packfile>] ...
|
||||
// Fully specifies the exact serach path, overriding the generated one
|
||||
//
|
||||
i = COM_CheckParm ("-path");
|
||||
if (i)
|
||||
{
|
||||
com_modified = true;
|
||||
com_searchpaths = NULL;
|
||||
while (++i < com_argc)
|
||||
{
|
||||
if (!com_argv[i] || com_argv[i][0] == '+' || com_argv[i][0] == '-')
|
||||
break;
|
||||
|
||||
search = Hunk_Alloc (sizeof(searchpath_t));
|
||||
if ( !strcmp(COM_FileExtension(com_argv[i]), "pak") )
|
||||
{
|
||||
search->pack = COM_LoadPackFile (com_argv[i]);
|
||||
if (!search->pack)
|
||||
Sys_Error ("Couldn't load packfile: %s", com_argv[i]);
|
||||
}
|
||||
else
|
||||
strcpy (search->filename, com_argv[i]);
|
||||
search->next = com_searchpaths;
|
||||
com_searchpaths = search;
|
||||
}
|
||||
}
|
||||
|
||||
if (COM_CheckParm ("-proghack"))
|
||||
proghack = true;
|
||||
}
|
||||
|
||||
|
|
@ -21,6 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "r_local.h"
|
||||
#include <sound.h>
|
||||
#include <cvars.h>
|
||||
|
||||
#if 0
|
||||
// FIXME
|
||||
|
|
|
@ -21,6 +21,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "r_local.h"
|
||||
#include <console.h>
|
||||
#include <mathlib.h>
|
||||
#include <sys.h>
|
||||
|
||||
mnode_t *r_pefragtopnode;
|
||||
|
||||
|
|
|
@ -21,6 +21,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "r_local.h"
|
||||
#include <mathlib.h>
|
||||
#include <sys.h>
|
||||
#include <console.h>
|
||||
#include <cvar.h>
|
||||
#include <cvars.h>
|
||||
#include <view.h>
|
||||
#include <sbar.h>
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -21,6 +21,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "r_local.h"
|
||||
#include <mathlib.h>
|
||||
#include <lib_replace.h>
|
||||
#include <console.h>
|
||||
|
||||
#define MAX_PARTICLES 2048 // default max # of particles at one
|
||||
// time
|
||||
|
|
|
@ -21,6 +21,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "r_local.h"
|
||||
#include <mathlib.h>
|
||||
#include <lib_replace.h>
|
||||
#include <console.h>
|
||||
#include <sys.h>
|
||||
|
||||
static int clip_current;
|
||||
static vec5_t clip_verts[2][MAXWORKINGVERTS];
|
||||
|
|
|
@ -24,6 +24,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "r_local.h"
|
||||
#include <qtypes.h>
|
||||
#include <wad.h>
|
||||
#include <draw.h>
|
||||
#include <cvar.h>
|
||||
#include <sbar.h>
|
||||
#include <keys.h>
|
||||
#include <sys.h>
|
||||
#include <console.h>
|
||||
#include <cmd.h>
|
||||
#include <sound.h>
|
||||
#include <screen.h>
|
||||
#include <lib_replace.h>
|
||||
#include <menu.h>
|
||||
#include <view.h>
|
||||
|
||||
#include <time.h>
|
||||
|
||||
|
@ -542,9 +556,7 @@ void SCR_SetUpToDrawConsole (void)
|
|||
return; // never a console with loading plaque
|
||||
|
||||
// decide on the height of the console
|
||||
con_forcedup = !cl.worldmodel || cls.signon != SIGNONS;
|
||||
|
||||
if (con_forcedup)
|
||||
if (cls.state != ca_active)
|
||||
{
|
||||
scr_conlines = vid.height; // full screen
|
||||
scr_con_current = scr_conlines;
|
||||
|
@ -593,7 +605,7 @@ void SCR_DrawConsole (void)
|
|||
if (scr_con_current)
|
||||
{
|
||||
scr_copyeverything = 1;
|
||||
Con_DrawConsole (scr_con_current, true);
|
||||
Con_DrawConsole (scr_con_current);
|
||||
clearconsole = 0;
|
||||
}
|
||||
else
|
||||
|
@ -752,7 +764,7 @@ void SCR_BeginLoadingPlaque (void)
|
|||
{
|
||||
S_StopAllSounds (true);
|
||||
|
||||
if (cls.state != ca_connected)
|
||||
if (cls.state < ca_connected)
|
||||
return;
|
||||
if (cls.signon != SIGNONS)
|
||||
return;
|
||||
|
|
|
@ -19,6 +19,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
// server.h
|
||||
|
||||
#ifndef _SERVER_H
|
||||
#define _SERVER_H
|
||||
|
||||
#include <qtypes.h>
|
||||
#include <progs.h>
|
||||
#include <setjmp.h>
|
||||
|
@ -259,3 +262,5 @@ void SV_SpawnServer (char *server, char *startspot);
|
|||
#else
|
||||
void SV_SpawnServer (char *server);
|
||||
#endif
|
||||
|
||||
#endif // _SERVER_H
|
||||
|
|
|
@ -21,6 +21,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
// sv_main.c -- server main program
|
||||
|
||||
#include "quakedef.h"
|
||||
#include <qtypes.h>
|
||||
#include <cvar.h>
|
||||
#include <protocol.h>
|
||||
#include <sys.h>
|
||||
#include <console.h>
|
||||
#include <sound.h>
|
||||
#include <lib_replace.h>
|
||||
#include <mathlib.h>
|
||||
#include <net.h>
|
||||
#include <cmd.h>
|
||||
|
||||
server_t sv;
|
||||
server_static_t svs;
|
||||
|
@ -490,7 +500,7 @@ void SV_WriteEntitiesToClient (edict_t *clent, sizebuf_t *msg)
|
|||
if (ent->baseline.colormap != ent->v.colormap)
|
||||
bits |= U_COLORMAP;
|
||||
|
||||
if (ent->baseline.skin != ent->v.skin)
|
||||
if (ent->baseline.skinnum != ent->v.skin)
|
||||
bits |= U_SKIN;
|
||||
|
||||
if (ent->baseline.frame != ent->v.frame)
|
||||
|
@ -940,7 +950,7 @@ void SV_CreateBaseline (void)
|
|||
VectorCopy (svent->v.origin, svent->baseline.origin);
|
||||
VectorCopy (svent->v.angles, svent->baseline.angles);
|
||||
svent->baseline.frame = svent->v.frame;
|
||||
svent->baseline.skin = svent->v.skin;
|
||||
svent->baseline.skinnum = svent->v.skin;
|
||||
if (entnum > 0 && entnum <= svs.maxclients)
|
||||
{
|
||||
svent->baseline.colormap = entnum;
|
||||
|
@ -962,7 +972,7 @@ void SV_CreateBaseline (void)
|
|||
MSG_WriteByte (&sv.signon, svent->baseline.modelindex);
|
||||
MSG_WriteByte (&sv.signon, svent->baseline.frame);
|
||||
MSG_WriteByte (&sv.signon, svent->baseline.colormap);
|
||||
MSG_WriteByte (&sv.signon, svent->baseline.skin);
|
||||
MSG_WriteByte (&sv.signon, svent->baseline.skinnum);
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
MSG_WriteCoord(&sv.signon, svent->baseline.origin[i]);
|
||||
|
|
|
@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
// sv_move.c -- monster movement
|
||||
|
||||
#include "quakedef.h"
|
||||
#include <mathlib.h>
|
||||
|
||||
#define STEPSIZE 18
|
||||
|
||||
|
|
|
@ -20,6 +20,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
// sv_phys.c
|
||||
|
||||
#include "quakedef.h"
|
||||
#include <qtypes.h>
|
||||
#include <console.h>
|
||||
#include <mathlib.h>
|
||||
#include <sys.h>
|
||||
|
||||
/*
|
||||
|
||||
|
|
|
@ -20,6 +20,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
// sv_user.c -- server code for moving users
|
||||
|
||||
#include "quakedef.h"
|
||||
#include <qtypes.h>
|
||||
#include <mathlib.h>
|
||||
#include <lib_replace.h>
|
||||
#include <view.h>
|
||||
#include <sys.h>
|
||||
#include <net.h>
|
||||
#include <console.h>
|
||||
#include <cmd.h>
|
||||
#include <keys.h>
|
||||
#include <protocol.h>
|
||||
|
||||
edict_t *sv_player;
|
||||
|
||||
|
|
|
@ -20,6 +20,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
// cl_parse.c -- parse a message received from the server
|
||||
|
||||
#include "quakedef.h"
|
||||
#include <protocol.h>
|
||||
#include <mathlib.h>
|
||||
#include <sys.h>
|
||||
|
||||
entity_t *CL_EntityNum (int num);
|
||||
|
||||
|
@ -119,7 +122,7 @@ if (bits&(1<<i))
|
|||
if (bits & U_SKIN)
|
||||
ent->skinnum = MSG_ReadByte();
|
||||
else
|
||||
ent->skinnum = ent->baseline.skin;
|
||||
ent->skinnum = ent->baseline.skinnum;
|
||||
|
||||
if (bits & U_EFFECTS)
|
||||
ent->effects = MSG_ReadByte();
|
||||
|
|
|
@ -22,6 +22,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "quakedef.h"
|
||||
#include "r_local.h"
|
||||
#include "draw.h" /* For Draw_Crosshair() */
|
||||
#include <mathlib.h>
|
||||
#include <qtypes.h>
|
||||
#include <qstructs.h>
|
||||
#include <cmd.h>
|
||||
#include <screen.h>
|
||||
#include <console.h>
|
||||
#include <cvar.h>
|
||||
|
||||
/*
|
||||
|
||||
|
@ -359,7 +366,7 @@ void V_ParseDamage (void)
|
|||
//
|
||||
// calculate view angle kicks
|
||||
//
|
||||
ent = &cl_entities[cl.viewentity];
|
||||
ent = &cl_entities[cl.playernum + 1];
|
||||
|
||||
VectorSubtract (from, ent->origin, from);
|
||||
VectorNormalize (from);
|
||||
|
@ -597,7 +604,7 @@ void V_BoundOffsets (void)
|
|||
{
|
||||
entity_t *ent;
|
||||
|
||||
ent = &cl_entities[cl.viewentity];
|
||||
ent = &cl_entities[cl.playernum + 1];
|
||||
|
||||
// absolutely bound refresh reletive to entity clipping hull
|
||||
// so the view can never be inside a solid wall
|
||||
|
@ -642,7 +649,7 @@ void V_CalcViewRoll (void)
|
|||
{
|
||||
float side;
|
||||
|
||||
side = V_CalcRoll (cl_entities[cl.viewentity].angles, cl.velocity);
|
||||
side = V_CalcRoll (cl_entities[cl.playernum + 1].angles, cl.velocity);
|
||||
r_refdef.viewangles[ROLL] += side;
|
||||
|
||||
if (v_dmg_time > 0)
|
||||
|
@ -673,7 +680,7 @@ void V_CalcIntermissionRefdef (void)
|
|||
float old;
|
||||
|
||||
// ent is the player model (visible when out of body)
|
||||
ent = &cl_entities[cl.viewentity];
|
||||
ent = &cl_entities[cl.playernum + 1];
|
||||
// view is the weapon model (only visible from inside body)
|
||||
view = &cl.viewent;
|
||||
|
||||
|
@ -706,7 +713,7 @@ void V_CalcRefdef (void)
|
|||
V_DriftPitch ();
|
||||
|
||||
// ent is the player model (visible when out of body)
|
||||
ent = &cl_entities[cl.viewentity];
|
||||
ent = &cl_entities[cl.playernum + 1];
|
||||
// view is the weapon model (only visible from inside body)
|
||||
view = &cl.viewent;
|
||||
|
||||
|
@ -788,7 +795,7 @@ void V_CalcRefdef (void)
|
|||
view->colormap = vid.colormap;
|
||||
|
||||
// set up the refresh position
|
||||
VectorAdd (r_refdef.viewangles, cl.punchangle, r_refdef.viewangles);
|
||||
r_refdef.viewangles[PITCH] += cl.punchangle;
|
||||
|
||||
// smooth out stair step ups
|
||||
if (cl.onground && ent->origin[2] - oldz > 0)
|
||||
|
@ -827,7 +834,7 @@ extern vrect_t scr_vrect;
|
|||
|
||||
void V_RenderView (void)
|
||||
{
|
||||
if (con_forcedup)
|
||||
if (cls.state != ca_active)
|
||||
return;
|
||||
|
||||
// don't allow cheats in multiplayer
|
||||
|
|
|
@ -20,6 +20,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
// world.c -- world query functions
|
||||
|
||||
#include "quakedef.h"
|
||||
#include <qtypes.h>
|
||||
#include <sys.h>
|
||||
#include <mathlib.h>
|
||||
#include <console.h>
|
||||
|
||||
/*
|
||||
|
||||
|
|
Loading…
Reference in a new issue