server can be configured out, rtlights are a bit more responcible.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@538 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
9af4c7df7f
commit
854f5340c1
46 changed files with 454 additions and 146 deletions
|
@ -486,7 +486,9 @@ void CL_Stop_f (void)
|
|||
{
|
||||
if (!cls.demorecording)
|
||||
{
|
||||
#ifndef CLIENTONLY
|
||||
SV_MVDStop_f();
|
||||
#endif
|
||||
Con_Printf ("Not recording a demo.\n");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -578,7 +578,7 @@ void CL_ParsePacketEntities (qboolean delta)
|
|||
newp->num_entities = newindex;
|
||||
}
|
||||
|
||||
#ifdef NQPROT
|
||||
|
||||
entity_state_t *CL_FindOldPacketEntity(int num)
|
||||
{
|
||||
int pnum;
|
||||
|
@ -597,6 +597,7 @@ entity_state_t *CL_FindOldPacketEntity(int num)
|
|||
}
|
||||
return NULL;
|
||||
}
|
||||
#ifdef NQPROT
|
||||
// reset all entity fields (typically used if status changed)
|
||||
#define E5_FULLUPDATE (1<<0)
|
||||
// E5_ORIGIN32=0: short[3] = s->origin[0] * 8, s->origin[1] * 8, s->origin[2] * 8
|
||||
|
|
|
@ -189,7 +189,9 @@ CL_Quit_f
|
|||
*/
|
||||
void CL_Quit_f (void)
|
||||
{
|
||||
#ifndef CLIENTONLY
|
||||
if (!isDedicated)
|
||||
#endif
|
||||
{
|
||||
M_Menu_Quit_f ();
|
||||
return;
|
||||
|
@ -558,7 +560,9 @@ void CLNQ_BeginServerConnect(void)
|
|||
#endif
|
||||
void CL_BeginServerReconnect(void)
|
||||
{
|
||||
#ifndef CLIENTONLY
|
||||
if (isDedicated)
|
||||
#endif
|
||||
{
|
||||
Con_TPrintf (TLC_DEDICATEDCANNOTCONNECT);
|
||||
return;
|
||||
|
@ -859,7 +863,9 @@ void CL_Disconnect (void)
|
|||
#endif
|
||||
CL_StopUpload();
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
if (!isDedicated)
|
||||
#endif
|
||||
SCR_EndLoadingPlaque();
|
||||
}
|
||||
|
||||
|
@ -1383,7 +1389,11 @@ void CL_Startdemos_f (void)
|
|||
for (i=1 ; i<c+1 ; i++)
|
||||
Q_strncpyz (cls.demos[i-1], Cmd_Argv(i), sizeof(cls.demos[0]));
|
||||
|
||||
if (!sv.state && cls.demonum != -1 && cls.demoplayback==DPB_NONE && !media_filmtype && COM_CheckParm("-demos"))
|
||||
if (
|
||||
#ifndef CLIENTONLY
|
||||
!sv.state &&
|
||||
#endif
|
||||
cls.demonum != -1 && cls.demoplayback==DPB_NONE && !media_filmtype && COM_CheckParm("-demos"))
|
||||
{
|
||||
cls.demonum = 0;
|
||||
CL_NextDemo ();
|
||||
|
@ -2482,8 +2492,10 @@ void Host_Frame (float time)
|
|||
// process console commands
|
||||
Cbuf_Execute ();
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
if (isDedicated) //someone changed it.
|
||||
return;
|
||||
#endif
|
||||
|
||||
#ifdef NQPROT
|
||||
NET_Poll();
|
||||
|
@ -2777,7 +2789,7 @@ void Host_Shutdown(void)
|
|||
IN_Shutdown ();
|
||||
if (VID_DeInit)
|
||||
VID_DeInit();
|
||||
#ifndef CLIENT_ONLY
|
||||
#ifndef CLIENTONLY
|
||||
SV_Shutdown();
|
||||
#else
|
||||
NET_Shutdown ();
|
||||
|
@ -2786,3 +2798,9 @@ void Host_Shutdown(void)
|
|||
Cvar_Shutdown();
|
||||
Validation_FlushFileList();
|
||||
}
|
||||
|
||||
#ifdef CLIENTONLY
|
||||
void SV_EndRedirect (void)
|
||||
{
|
||||
}
|
||||
#endif
|
|
@ -1225,8 +1225,9 @@ void CL_ParseServerData (void)
|
|||
{
|
||||
COM_FlushTempoaryPacks();
|
||||
COM_Gamedir(str);
|
||||
#ifndef CLIENTONLY
|
||||
Info_SetValueForStarKey (svs.info, "*gamedir", str, MAX_SERVERINFO_STRING);
|
||||
|
||||
#endif
|
||||
COM_FlushFSCache();
|
||||
}
|
||||
|
||||
|
|
|
@ -1373,6 +1373,11 @@ void SCR_ScreenShot_f (void)
|
|||
if (Cmd_Argc() == 2)
|
||||
{
|
||||
Q_strncpyz(pcxname, Cmd_Argv(1), sizeof(pcxname));
|
||||
if (strstr (pcxname, "..") || strchr(pcxname, ':') || *pcxname == '.' || *pcxname == '/')
|
||||
{
|
||||
Con_Printf("Screenshot name refused\n");
|
||||
return;
|
||||
}
|
||||
COM_DefaultExtension (pcxname, scr_sshot_type.string);
|
||||
}
|
||||
else
|
||||
|
@ -1380,14 +1385,14 @@ void SCR_ScreenShot_f (void)
|
|||
//
|
||||
// find a file name to save it to
|
||||
//
|
||||
sprintf(pcxname,"fte00000.%s", scr_sshot_type.string);
|
||||
sprintf(pcxname,"screenshots/fte00000.%s", scr_sshot_type.string);
|
||||
|
||||
for (i=0 ; i<=100000 ; i++)
|
||||
{
|
||||
pcxname[4] = (i%10000)/1000 + '0';
|
||||
pcxname[5] = (i%1000)/100 + '0';
|
||||
pcxname[6] = (i%100)/10 + '0';
|
||||
pcxname[7] = (i%10) + '0';
|
||||
pcxname[16] = (i%10000)/1000 + '0';
|
||||
pcxname[17] = (i%1000)/100 + '0';
|
||||
pcxname[18] = (i%100)/10 + '0';
|
||||
pcxname[19] = (i%10) + '0';
|
||||
sprintf (checkname, "%s/%s", com_gamedir, pcxname);
|
||||
if (Sys_FileTime(checkname) == -1)
|
||||
break; // file doesn't exist
|
||||
|
|
|
@ -219,6 +219,8 @@ typedef struct dlight_s
|
|||
float channelfade[3];
|
||||
|
||||
struct shadowmesh_s *worldshadowmesh;
|
||||
float dist;
|
||||
struct dlight_s *next;
|
||||
} dlight_t;
|
||||
|
||||
typedef struct
|
||||
|
|
|
@ -205,8 +205,10 @@ M_ToggleMenu_f
|
|||
*/
|
||||
void M_ToggleMenu_f (void)
|
||||
{
|
||||
#ifdef MENU_DAT
|
||||
if (MP_Toggle())
|
||||
return;
|
||||
#endif
|
||||
m_entersound = true;
|
||||
|
||||
if (key_dest == key_menu)
|
||||
|
@ -797,7 +799,9 @@ void M_Menu_Particles_f (void);
|
|||
static qboolean internalmenusregistered;
|
||||
void M_Init_Internal (void)
|
||||
{
|
||||
#ifdef MENU_DAT
|
||||
MP_Shutdown();
|
||||
#endif
|
||||
|
||||
if (internalmenusregistered)
|
||||
return;
|
||||
|
@ -972,9 +976,11 @@ void M_Draw (int uimenu)
|
|||
Plug_Menu_Event (0, (int)(realtime*1000));
|
||||
break;
|
||||
#endif
|
||||
#ifdef MENU_DAT
|
||||
case m_menu_dat:
|
||||
MP_Draw();
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (m_entersound)
|
||||
|
@ -1025,10 +1031,11 @@ void M_Keydown (int key)
|
|||
Plug_Menu_Event (1, key);
|
||||
return;
|
||||
#endif
|
||||
|
||||
#ifdef MENU_DAT
|
||||
case m_menu_dat:
|
||||
MP_Keydown(key);
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1045,9 +1052,11 @@ void M_Keyup (int key)
|
|||
Plug_Menu_Event (2, key);
|
||||
return;
|
||||
#endif
|
||||
#ifdef MENU_DAT
|
||||
case m_menu_dat:
|
||||
MP_Keyup(key);
|
||||
return;
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "quakedef.h"
|
||||
|
||||
#ifdef MENU_DAT
|
||||
|
||||
#ifdef RGLQUAKE
|
||||
#include "glquake.h"
|
||||
#endif
|
||||
|
@ -1482,4 +1484,5 @@ qboolean MP_Toggle(void)
|
|||
inmenuprogs--;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -160,7 +160,9 @@ extern "C" {
|
|||
|
||||
#ifndef CLIENTONLY
|
||||
#include "progs.h"
|
||||
#endif
|
||||
#include "world.h"
|
||||
#ifndef CLIENTONLY
|
||||
//#ifdef Q2SERVER
|
||||
#include "q2game.h"
|
||||
//#endif
|
||||
|
|
|
@ -1275,6 +1275,7 @@ qboolean R_ApplyRenderer (rendererstate_t *newr)
|
|||
{
|
||||
int i, j;
|
||||
extern model_t *loadmodel;
|
||||
extern int host_hunklevel;
|
||||
|
||||
if (newr->bpp == -1)
|
||||
return false;
|
||||
|
@ -1319,7 +1320,9 @@ qboolean R_ApplyRenderer (rendererstate_t *newr)
|
|||
if (qrenderer) //graphics stuff only when not dedicated
|
||||
{
|
||||
qbyte *data;
|
||||
#ifndef CLIENTONLY
|
||||
isDedicated = false;
|
||||
#endif
|
||||
v_gamma.modified = true; //force the gamma to be reset
|
||||
|
||||
Con_Printf("Setting mode %i*%i*%i*%i\n", newr->width, newr->height, newr->bpp, newr->rate);
|
||||
|
@ -1421,6 +1424,9 @@ TRACE(("dbg: R_ApplyRenderer: screen inited\n"));
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef CLIENTONLY
|
||||
Host_Error("Tried setting dedicated mode\n");
|
||||
#else
|
||||
TRACE(("dbg: R_ApplyRenderer: isDedicated = true\n"));
|
||||
isDedicated = true;
|
||||
if (cls.state)
|
||||
|
@ -1432,6 +1438,7 @@ TRACE(("dbg: R_ApplyRenderer: isDedicated = true\n"));
|
|||
}
|
||||
Sys_InitTerminal();
|
||||
Con_PrintToSys();
|
||||
#endif
|
||||
}
|
||||
TRACE(("dbg: R_ApplyRenderer: initing mods\n"));
|
||||
Mod_Init();
|
||||
|
@ -1447,6 +1454,7 @@ TRACE(("dbg: R_ApplyRenderer: initing bulletein boards\n"));
|
|||
R_PreNewMap();
|
||||
}
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
if (sv.worldmodel)
|
||||
{
|
||||
edict_t *ent;
|
||||
|
@ -1514,6 +1522,7 @@ TRACE(("dbg: R_ApplyRenderer: clearing world\n"));
|
|||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#ifdef PLUGINS
|
||||
Plug_ResChanged();
|
||||
#endif
|
||||
|
@ -1616,9 +1625,9 @@ void R_RestartRenderer_f (void)
|
|||
{
|
||||
rendererstate_t oldr;
|
||||
rendererstate_t newr;
|
||||
|
||||
#ifdef MENU_DAT
|
||||
MP_Shutdown();
|
||||
|
||||
#endif
|
||||
memset(&newr, 0, sizeof(newr));
|
||||
|
||||
TRACE(("dbg: R_RestartRenderer_f\n"));
|
||||
|
@ -1717,8 +1726,9 @@ TRACE(("dbg: R_RestartRenderer_f\n"));
|
|||
}
|
||||
|
||||
TRACE(("dbg: R_RestartRenderer_f success\n"));
|
||||
|
||||
#ifdef MENU_DAT
|
||||
MP_Init();
|
||||
#endif
|
||||
}
|
||||
|
||||
void R_SetRenderer_f (void)
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 121
|
||||
#define _APS_NEXT_RESOURCE_VALUE 122
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1005
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
|
|
|
@ -755,7 +755,9 @@ void Sys_SendKeyEvents (void)
|
|||
|
||||
if (!qrenderer)
|
||||
{
|
||||
#ifndef CLIENTONLY
|
||||
SV_GetConsoleCommands ();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -994,6 +996,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
|
|||
/* main window message loop */
|
||||
while (1)
|
||||
{
|
||||
#ifndef CLIENTONLY
|
||||
if (isDedicated)
|
||||
{
|
||||
NET_Sleep(100, false);
|
||||
|
@ -1006,6 +1009,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
|
|||
SV_Frame (time);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
// yield the CPU for a little while when paused, minimized, or not the focus
|
||||
if (((cl.paused && (!ActiveApp && !DDActive)) || Minimized || block_drawing) && !media_filmtype)
|
||||
|
|
|
@ -1230,10 +1230,10 @@ void V_RenderPlayerViews(int plnum)
|
|||
int viewnum;
|
||||
SCR_VRectForPlayer(&r_refdef.vrect, plnum);
|
||||
view_message = &view_frame->playerstate[cl.playernum[plnum]];
|
||||
|
||||
#ifdef NQPROT
|
||||
if (cls.netcon)
|
||||
view_message->weaponframe = cl.stats[0][STAT_WEAPONFRAME];
|
||||
|
||||
#endif
|
||||
cl.simangles[plnum][ROLL] = 0; // FIXME @@@
|
||||
|
||||
|
||||
|
|
|
@ -469,8 +469,10 @@ void Mod_ParseInfoFromEntityLump(char *data) //actually, this should be in the m
|
|||
|
||||
wads[0] = '\0';
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
if (isDedicated) //don't bother
|
||||
return;
|
||||
#endif
|
||||
|
||||
R_SetSky("", 0, r_origin);
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ IDD_DIALOG1 DIALOGEX 0, 0, 67, 40
|
|||
STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_POPUP |
|
||||
WS_VISIBLE
|
||||
EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE
|
||||
FONT 16, "Times New Roman"
|
||||
FONT 16, "Times New Roman", 0, 0, 0x1
|
||||
BEGIN
|
||||
CTEXT "FTE QuakeWorld",IDC_STATIC,0,0,67,21,SS_CENTERIMAGE
|
||||
CTEXT "http://fte.quakesrc.org",IDC_STATIC,0,23,66,17,
|
||||
|
|
|
@ -67,12 +67,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#define MD3MODELS //we DO want to use quake3 alias models. This might be a minimal build, but we still want this.
|
||||
|
||||
#define CLIENTONLY
|
||||
|
||||
#else
|
||||
|
||||
#define SIDEVIEWS 4 //enable secondary/reverse views.
|
||||
#define SP2MODELS //quake2 sprite models
|
||||
#define MD2MODELS //quake2 alias models
|
||||
#define MD3MODELS //quake3 alias models
|
||||
#define ZYMOTICMODELS //zymotic skeletal models.
|
||||
#define HUFFNETWORK //huffman network compression
|
||||
#define HALFLIFEMODELS //halflife model support (experimental)
|
||||
#define DOOMWADS //doom wad/map/sprite support
|
||||
|
@ -99,9 +102,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#define R_XFLIP //allow view to be flipped horizontally
|
||||
#define IN_XFLIP //allow input to be flipped horizontally.
|
||||
#define TEXTEDITOR
|
||||
#define PPL //per pixel lighting (stencil shadowing)
|
||||
|
||||
#define PLUGINS
|
||||
|
||||
#define MENU_DAT //support for menu.dat
|
||||
|
||||
// #define VOICECHAT //experimental
|
||||
|
||||
//these things were moved to plugins.
|
||||
|
|
|
@ -964,6 +964,7 @@ void IPX_CloseSocket (int socket)
|
|||
// sleeps msec or until net socket is ready
|
||||
//stdin can sometimes be a socket. As a result,
|
||||
//we give the option to select it for nice console imput with timeouts.
|
||||
#ifndef CLIENTONLY
|
||||
qboolean NET_Sleep(int msec, qboolean stdinissocket)
|
||||
{
|
||||
struct timeval timeout;
|
||||
|
@ -1004,6 +1005,7 @@ qboolean NET_Sleep(int msec, qboolean stdinissocket)
|
|||
return FD_ISSET(0, &fdset);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
void NET_GetLocalIP6Address (int socket)
|
||||
{
|
||||
|
|
|
@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "quakedef.h"
|
||||
|
||||
extern float pm_stepheight;
|
||||
|
||||
movevars_t movevars;
|
||||
playermove_t pmove;
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ qboolean Q1BSP_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f,
|
|||
}
|
||||
|
||||
if (num < hull->firstclipnode || num > hull->lastclipnode)
|
||||
SV_Error ("Q1BSP_RecursiveHullCheck: bad node number");
|
||||
Host_Error ("Q1BSP_RecursiveHullCheck: bad node number");
|
||||
|
||||
//
|
||||
// find the point distances
|
||||
|
@ -268,7 +268,7 @@ Rendering functions (Client only)
|
|||
|
||||
Server only functions
|
||||
*/
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
|
||||
extern int fatbytes;
|
||||
extern qbyte fatpvs[(MAX_MAP_LEAFS+1)/4];
|
||||
|
@ -386,6 +386,7 @@ void Q1BSP_FindTouchedLeafs(edict_t *ent)
|
|||
Q1BSP_RFindTouchedLeafs (ent, sv.worldmodel->nodes);
|
||||
}
|
||||
|
||||
#endif
|
||||
/*
|
||||
Server only functions
|
||||
|
||||
|
|
|
@ -85,6 +85,7 @@ typedef struct q2trace_s
|
|||
struct edict_s *ent; // not set by CM_*() functions
|
||||
} q2trace_t;
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
|
||||
#define MOVE_NORMAL 0
|
||||
#define MOVE_NOMONSTERS 1
|
||||
|
@ -141,3 +142,5 @@ trace_t SV_Move (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int type, e
|
|||
|
||||
|
||||
edict_t *SV_TestPlayerPosition (edict_t *ent, vec3_t origin);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -405,42 +405,6 @@ SOURCE=..\server\pr_cmds.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\client\pr_menu.c
|
||||
|
||||
!IF "$(CFG)" == "ftequake - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
# ADD CPP /WX
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 Q3Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 Q3Release"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\server\savegame.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
@ -1489,6 +1453,42 @@ SOURCE=..\client\net_master.c
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\client\pr_menu.c
|
||||
|
||||
!IF "$(CFG)" == "ftequake - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 GLDebug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 GLRelease"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 MDebug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 MRelease"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLDebug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 MinGLRelease"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 Debug Dedicated Server"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
# ADD CPP /WX
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 Release Dedicated Server"
|
||||
|
||||
# PROP Exclude_From_Build 1
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 Q3Debug"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ftequake - Win32 Q3Release"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\client\r_bulleten.c
|
||||
|
||||
!IF "$(CFG)" == "ftequake - Win32 Release"
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
#include "shader.h"
|
||||
#include "hash.h"
|
||||
|
||||
#ifdef ZYMOTICMODELS
|
||||
#define SKELETALMODELS
|
||||
#endif
|
||||
|
||||
//FIXME
|
||||
typedef struct
|
||||
{
|
||||
|
@ -95,8 +99,9 @@ typedef struct {
|
|||
|
||||
//frame is an index into this
|
||||
typedef struct {
|
||||
#ifdef SKELETALMODELS
|
||||
qboolean isskeletal;
|
||||
|
||||
#endif
|
||||
int numposes;
|
||||
float rate;
|
||||
int poseofs;
|
||||
|
@ -110,7 +115,7 @@ typedef struct {
|
|||
vec3_t scale_origin;
|
||||
} galiaspose_t;
|
||||
|
||||
|
||||
#ifdef SKELETALMODELS
|
||||
typedef struct {
|
||||
int parent;
|
||||
} galiasbone_t;
|
||||
|
@ -121,6 +126,7 @@ typedef struct {
|
|||
int boneindex;
|
||||
vec4_t org;
|
||||
} galisskeletaltransforms_t;
|
||||
#endif
|
||||
|
||||
//we can't be bothered with animating skins.
|
||||
//We'll load up to four of them but after that you're on your own
|
||||
|
@ -277,6 +283,7 @@ static void R_LerpFrames(mesh_t *mesh, galiaspose_t *p1, galiaspose_t *p2, float
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef SKELETALMODELS
|
||||
static void R_BuildSkeletalMesh(mesh_t *mesh, float *plerp, float **pose, int poses, galiasbone_t *bones, int bonecount, galisskeletaltransforms_t *weights, int numweights)
|
||||
{
|
||||
float bonepose[256][12];
|
||||
|
@ -340,6 +347,7 @@ static void R_BuildSkeletalMesh(mesh_t *mesh, float *plerp, float **pose, int po
|
|||
out[2] += v->org[0] * matrix[8] + v->org[1] * matrix[9] + v->org[2] * matrix[10] + v->org[3] * matrix[11];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void R_GAliasAddDlights(mesh_t *mesh, vec3_t org, vec3_t angles)
|
||||
{
|
||||
|
@ -486,6 +494,7 @@ static qboolean R_GAliasBuildMesh(mesh_t *mesh, galiasinfo_t *inf, int frame1, i
|
|||
//we don't support meshes with one pose skeletal and annother not.
|
||||
//we don't support meshes with one group skeletal and annother not.
|
||||
|
||||
#ifdef SKELETALMODELS
|
||||
if (g1->isskeletal)
|
||||
{
|
||||
int l=0;
|
||||
|
@ -531,6 +540,7 @@ static qboolean R_GAliasBuildMesh(mesh_t *mesh, galiasinfo_t *inf, int frame1, i
|
|||
R_BuildSkeletalMesh(mesh, plerp, pose, l, (galiasbone_t *)((char*)inf+inf->ofsbones), inf->numbones, (galisskeletaltransforms_t *)((char*)inf+inf->ofstransforms), inf->numtransforms);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (g1 == g2) //lerping within group is only done if not changing group
|
||||
{
|
||||
|
@ -2846,7 +2856,7 @@ void GL_LoadQ3Model(model_t *mod, void *buffer)
|
|||
|
||||
|
||||
|
||||
|
||||
#ifdef ZYMOTICMODELS
|
||||
|
||||
|
||||
typedef struct zymlump_s
|
||||
|
@ -3101,4 +3111,6 @@ void GLMod_LoadZymoticModel(model_t *mod, void *buffer)
|
|||
memcpy (mod->cache.data, root, hunktotal);
|
||||
|
||||
Hunk_FreeToLowMark (hunkstart);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -53,9 +53,8 @@ void GL_BindType (int type, int texnum)
|
|||
{
|
||||
if (gl_state.currenttextures[gl_state.currenttmu] == texnum)
|
||||
return;
|
||||
|
||||
gl_state.currenttextures[gl_state.currenttmu] = texnum;
|
||||
|
||||
|
||||
bindTexFunc (type, texnum);
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,9 @@ void Mod_LoadQ2BrushModel (model_t *mod, void *buffer);
|
|||
void Mod_LoadHLModel (model_t *mod, void *buffer);
|
||||
void Mod_LoadAlias3Model (model_t *mod, void *buffer);
|
||||
void Mod_LoadGroupModel (model_t *mod, void *buffer);
|
||||
#ifdef ZYMOTICMODELS
|
||||
void GLMod_LoadZymoticModel(model_t *mod, void *buffer);
|
||||
#endif
|
||||
model_t *GLMod_LoadModel (model_t *mod, qboolean crash);
|
||||
|
||||
#ifdef DOOMWADS
|
||||
|
@ -659,11 +661,11 @@ couldntload:
|
|||
case 29: //q1
|
||||
GLMod_LoadBrushModel (mod, buf);
|
||||
break;
|
||||
|
||||
#ifdef ZYMOTICMODELS
|
||||
case (('O'<<24)+('M'<<16)+('Y'<<8)+'Z'):
|
||||
GLMod_LoadZymoticModel(mod, buf);
|
||||
break;
|
||||
|
||||
#endif
|
||||
default:
|
||||
Con_Printf("Unrecognised model format %i\n", LittleLong(*(unsigned *)buf));
|
||||
goto couldntload;
|
||||
|
@ -2586,15 +2588,18 @@ void GLMod_LoadBrushModel (model_t *mod, void *buffer)
|
|||
Mod_ParseInfoFromEntityLump(mod_base + header->lumps[LUMP_ENTITIES].fileofs);
|
||||
}
|
||||
|
||||
mod->funcs.FatPVS = Q1BSP_FatPVS;
|
||||
mod->funcs.EdictInFatPVS = Q1BSP_EdictInFatPVS;
|
||||
mod->funcs.FindTouchedLeafs_Q1 = Q1BSP_FindTouchedLeafs;
|
||||
mod->funcs.LightPointValues = GLQ1BSP_LightPointValues;
|
||||
mod->funcs.StainNode = Q1BSP_StainNode;
|
||||
mod->funcs.MarkLights = Q1BSP_MarkLights;
|
||||
|
||||
mod->funcs.LeafForPoint = GLMod_LeafForPoint;
|
||||
mod->funcs.LeafPVS = GLMod_LeafnumPVS;
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
mod->funcs.FindTouchedLeafs_Q1 = Q1BSP_FindTouchedLeafs;
|
||||
mod->funcs.EdictInFatPVS = Q1BSP_EdictInFatPVS;
|
||||
mod->funcs.FatPVS = Q1BSP_FatPVS;
|
||||
#endif
|
||||
|
||||
mod->numframes = 2; // regular and alternate animation
|
||||
|
||||
|
|
|
@ -1555,8 +1555,9 @@ void PPL_BaseBModelTextures(entity_t *e)
|
|||
{
|
||||
for (k=0 ; k<MAX_DLIGHTS ; k++)
|
||||
{
|
||||
if ((cl_dlights[k].die < cl.time) ||
|
||||
(!cl_dlights[k].radius))
|
||||
if (!cl_dlights[k].radius)
|
||||
continue;
|
||||
if (cl_dlights[k].nodynamic)
|
||||
continue;
|
||||
|
||||
currentmodel->funcs.MarkLights (&cl_dlights[k], 1<<k,
|
||||
|
@ -1656,6 +1657,7 @@ void PPL_BaseEntTextures(void)
|
|||
currentmodel = cl.worldmodel;
|
||||
}
|
||||
|
||||
#ifdef PPL
|
||||
static void PPL_GenerateLightArrays(msurface_t *surf, vec3_t relativelightorigin, dlight_t *light)
|
||||
{
|
||||
glpoly_t *p;
|
||||
|
@ -1783,7 +1785,7 @@ void PPL_LightTextures(model_t *model, vec3_t modelorigin, dlight_t *light)
|
|||
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
glColorPointer(3, GL_FLOAT, sizeof(surfvertexarray_t), varray_v->stl);
|
||||
if (t->gl_texturenumbumpmap && gl_mtexarbable>2)
|
||||
if (t->gl_texturenumbumpmap && gl_mtexarbable>3)
|
||||
{
|
||||
GL_MBind(GL_TEXTURE0_ARB, t->gl_texturenumbumpmap);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
@ -1796,7 +1798,7 @@ void PPL_LightTextures(model_t *model, vec3_t modelorigin, dlight_t *light)
|
|||
GL_SelectTexture(GL_TEXTURE1_ARB);
|
||||
GL_BindType(GL_TEXTURE_CUBE_MAP_ARB, normalisationCubeMap);
|
||||
glEnable(GL_TEXTURE_CUBE_MAP_ARB);
|
||||
GL_TexEnv(GL_COMBINE_ARB); //normalisation cubemap * normalmap
|
||||
GL_TexEnv(GL_COMBINE_ARB); //normalisation cubemap . normalmap
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_ARB, GL_TEXTURE);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_PREVIOUS_ARB);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_DOT3_RGB_ARB);
|
||||
|
@ -1811,12 +1813,24 @@ void PPL_LightTextures(model_t *model, vec3_t modelorigin, dlight_t *light)
|
|||
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, GL_SRC_COLOR);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_PREVIOUS_ARB);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE);
|
||||
|
||||
GL_MBind(GL_TEXTURE3_ARB, t->gl_texturenum);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(3, GL_FLOAT, sizeof(surfvertexarray_t), varray_v->stw);
|
||||
}
|
||||
else
|
||||
{
|
||||
GL_TexEnv(GL_MODULATE);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
if (gl_mtexarbable>3)
|
||||
{
|
||||
GL_TexEnv(GL_MODULATE);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
GL_SelectTexture(GL_TEXTURE2_ARB);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
}
|
||||
GL_SelectTexture(GL_TEXTURE1_ARB);
|
||||
GL_TexEnv(GL_MODULATE);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
@ -1856,6 +1870,16 @@ void PPL_LightTextures(model_t *model, vec3_t modelorigin, dlight_t *light)
|
|||
}
|
||||
}
|
||||
|
||||
if (gl_mtexarbable>2)
|
||||
{
|
||||
GL_TexEnv(GL_MODULATE);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
GL_SelectTexture(GL_TEXTURE2_ARB);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
}
|
||||
|
||||
GL_TexEnv(GL_MODULATE);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
|
||||
|
@ -1894,7 +1918,7 @@ void PPL_LightBModelTextures(entity_t *e, dlight_t *light)
|
|||
|
||||
glEnableClientState(GL_COLOR_ARRAY);
|
||||
glColorPointer(3, GL_FLOAT, sizeof(surfvertexarray_t), varray_v->stl);
|
||||
if (t->gl_texturenumbumpmap && gl_mtexarbable>2)
|
||||
if (t->gl_texturenumbumpmap && gl_mtexarbable>3)
|
||||
{
|
||||
GL_MBind(GL_TEXTURE0_ARB, t->gl_texturenumbumpmap);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
@ -1922,9 +1946,25 @@ void PPL_LightBModelTextures(entity_t *e, dlight_t *light)
|
|||
glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_ARB, GL_SRC_COLOR);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_ARB, GL_PREVIOUS_ARB);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_ARB, GL_MODULATE);
|
||||
|
||||
GL_MBind(GL_TEXTURE3_ARB, t->gl_texturenum);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
glTexCoordPointer(3, GL_FLOAT, sizeof(surfvertexarray_t), varray_v->stw);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gl_mtexarbable>3)
|
||||
{
|
||||
GL_TexEnv(GL_MODULATE);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
GL_SelectTexture(GL_TEXTURE2_ARB);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
}
|
||||
|
||||
GL_TexEnv(GL_MODULATE);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
qglActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
|
@ -1965,6 +2005,17 @@ void PPL_LightBModelTextures(entity_t *e, dlight_t *light)
|
|||
PPL_FlushArrays();
|
||||
}
|
||||
|
||||
if (gl_mtexarbable>2)
|
||||
{
|
||||
GL_TexEnv(GL_MODULATE);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
|
||||
GL_SelectTexture(GL_TEXTURE2_ARB);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
}
|
||||
|
||||
GL_TexEnv(GL_MODULATE);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
qglClientActiveTextureARB(GL_TEXTURE1_ARB);
|
||||
|
@ -2034,6 +2085,7 @@ void PPL_DrawEntLighting(dlight_t *light)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void PPL_FullBrights(model_t *model)
|
||||
{
|
||||
|
@ -2178,7 +2230,7 @@ void PPL_DrawEntFullBrights(void)
|
|||
|
||||
|
||||
|
||||
|
||||
#ifdef PPL
|
||||
|
||||
|
||||
|
||||
|
@ -3064,6 +3116,35 @@ void PPL_UpdateNodeShadowFrames(qbyte *lvis)
|
|||
#if 1 //DP's stolen code
|
||||
static void GL_Scissor (int x, int y, int width, int height)
|
||||
{
|
||||
#if 0 //visible scissors
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glOrtho (0, glwidth, glheight, 0, -99999, 99999);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
// GL_Set2D();
|
||||
|
||||
glColor4f(1,1,1,1);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
glColorMask( GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE );
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
GL_TexEnv(GL_REPLACE);
|
||||
|
||||
glBegin(GL_LINE_LOOP);
|
||||
glVertex2f(x, y);
|
||||
glVertex2f(x+glwidth, y);
|
||||
glVertex2f(x+glwidth, y+glheight);
|
||||
glVertex2f(x, y+glheight);
|
||||
glEnd();
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPopMatrix();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPopMatrix();
|
||||
#endif
|
||||
qglScissor(x, glheight - (y + height),width,height);
|
||||
}
|
||||
|
||||
|
@ -3281,9 +3362,6 @@ void PPL_AddLight(dlight_t *dl)
|
|||
maxs[1] = dl->origin[1] + dl->radius;
|
||||
maxs[2] = dl->origin[2] + dl->radius;
|
||||
|
||||
if (R_CullBox(mins, maxs))
|
||||
return;
|
||||
|
||||
if (PPL_ScissorForBox(mins, maxs))
|
||||
return; //was culled.
|
||||
|
||||
|
@ -3457,9 +3535,15 @@ void PPL_AddLight(dlight_t *dl)
|
|||
qglDisable(GL_SCISSOR_TEST);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void PPL_DrawWorld (void)
|
||||
{
|
||||
dlight_t *l;
|
||||
#if 0
|
||||
dlight_t *lc, *furthestprev;
|
||||
float furthest;
|
||||
#endif
|
||||
int i;
|
||||
|
||||
vec3_t mins, maxs;
|
||||
|
@ -3483,10 +3567,12 @@ void PPL_DrawWorld (void)
|
|||
// if (qglGetError())
|
||||
// Con_Printf("GL Error on entities\n");
|
||||
|
||||
#ifdef PPL
|
||||
if (r_shadows.value && glStencilFunc)
|
||||
{
|
||||
if (cl.worldmodel->fromgame == fg_quake || cl.worldmodel->fromgame == fg_halflife || cl.worldmodel->fromgame == fg_quake2 /*|| cl.worldmodel->fromgame == fg_quake3*/)
|
||||
{
|
||||
// lc = NULL;
|
||||
for (l = cl_dlights, i=0 ; i<MAX_DLIGHTS ; i++, l++)
|
||||
{
|
||||
if (!l->radius || l->noppl)
|
||||
|
@ -3508,32 +3594,67 @@ void PPL_DrawWorld (void)
|
|||
maxs[2] = l->origin[2] + l->radius;
|
||||
if (R_CullBox(mins, maxs))
|
||||
continue;
|
||||
if (R_CullSphere(l->origin, l->radius))
|
||||
continue;
|
||||
// if (R_CullSphere(l->origin, l->radius*1.1))
|
||||
// continue;
|
||||
|
||||
#if 1
|
||||
if (!maxshadowlights--)
|
||||
break;
|
||||
continue;
|
||||
#else
|
||||
VectorSubtract(l->origin, r_refdef.vieworg, mins)
|
||||
l->dist = Length(mins);
|
||||
VectorNormalize(mins);
|
||||
l->dist*=1-sqrt(DotProduct(vpn, mins)*DotProduct(vpn, mins));
|
||||
|
||||
l->next = lc;
|
||||
lc = l;
|
||||
maxshadowlights--;
|
||||
}
|
||||
while (maxshadowlights<0)//ooer... we exceeded our quota... strip the furthest ones out.
|
||||
{
|
||||
furthest = lc->dist;
|
||||
furthestprev=NULL;
|
||||
for (l = lc; l->next; l = l->next)
|
||||
{
|
||||
if (l->next->dist > furthest)
|
||||
{
|
||||
furthest = l->next->dist;
|
||||
furthestprev = l;
|
||||
}
|
||||
}
|
||||
if (furthestprev)
|
||||
furthestprev->next = furthestprev->next->next;
|
||||
else
|
||||
lc = lc->next;
|
||||
|
||||
maxshadowlights++;
|
||||
}
|
||||
|
||||
for (l = lc; l; l = l->next) //we now have our quotaed list
|
||||
{
|
||||
#endif
|
||||
if(!l->isstatic)
|
||||
{
|
||||
l->color[0]*=2.5;
|
||||
l->color[1]*=2.5;
|
||||
l->color[2]*=2.5;
|
||||
l->color[0]*=2.5;
|
||||
l->color[1]*=2.5;
|
||||
l->color[2]*=2.5;
|
||||
}
|
||||
TRACE(("dbg: calling PPL_AddLight\n"));
|
||||
PPL_AddLight(l);
|
||||
if(!l->isstatic)
|
||||
{
|
||||
l->color[0]/=2.5;
|
||||
l->color[1]/=2.5;
|
||||
l->color[2]/=2.5;
|
||||
l->color[0]/=2.5;
|
||||
l->color[1]/=2.5;
|
||||
l->color[2]/=2.5;
|
||||
}
|
||||
}
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
}
|
||||
|
||||
glDisableClientState(GL_COLOR_ARRAY);
|
||||
}
|
||||
#endif
|
||||
|
||||
// if (qglGetError())
|
||||
// Con_Printf("GL Error on shadow lighting\n");
|
||||
|
|
|
@ -149,7 +149,7 @@ qboolean R_CullBox (vec3_t mins, vec3_t maxs)
|
|||
int i;
|
||||
|
||||
for (i=0 ; i<4 ; i++)
|
||||
if (BoxOnPlaneSide (mins, maxs, &frustum[i]) == 2)
|
||||
if (BOX_ON_PLANE_SIDE (mins, maxs, &frustum[i]) == 2)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ qboolean R_CullSphere (vec3_t org, float radius)
|
|||
for (i=0 ; i<4 ; i++)
|
||||
{
|
||||
d = DotProduct(frustum[i].normal, org)-frustum[i].dist;
|
||||
if (d < -radius)
|
||||
if (d <= -radius)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -387,6 +387,9 @@ void GLR_AddDynamicLights (msurface_t *surf)
|
|||
if ( !(surf->dlightbits & (1<<lnum) ) )
|
||||
continue; // not lit by this light
|
||||
|
||||
if (cl_dlights[lnum].nodynamic)
|
||||
continue;
|
||||
|
||||
rad = cl_dlights[lnum].radius;
|
||||
dist = DotProduct (cl_dlights[lnum].origin, surf->plane->normal) -
|
||||
surf->plane->dist;
|
||||
|
@ -452,6 +455,9 @@ void GLR_AddDynamicLightNorms (msurface_t *surf)
|
|||
if ( !(surf->dlightbits & (1<<lnum) ) )
|
||||
continue; // not lit by this light
|
||||
|
||||
if (cl_dlights[lnum].nodynamic)
|
||||
continue;
|
||||
|
||||
rad = cl_dlights[lnum].radius;
|
||||
dist = DotProduct (cl_dlights[lnum].origin, surf->plane->normal) -
|
||||
surf->plane->dist;
|
||||
|
|
|
@ -263,12 +263,26 @@ void GLSCR_UpdateScreen (void)
|
|||
|
||||
char *GLVID_GetRGBInfo(int prepadbytes, int *truewidth, int *trueheight)
|
||||
{ //returns a BZ_Malloced array
|
||||
extern qboolean gammaworks;
|
||||
int i, c;
|
||||
qbyte *ret = BZ_Malloc(prepadbytes + glwidth*glheight*3);
|
||||
|
||||
glReadPixels (glx, gly, glwidth, glheight, GL_RGB, GL_UNSIGNED_BYTE, ret + prepadbytes);
|
||||
|
||||
*truewidth = glwidth;
|
||||
*trueheight = glheight;
|
||||
|
||||
if (gammaworks)
|
||||
{
|
||||
c = prepadbytes+glwidth*glheight*3;
|
||||
for (i=prepadbytes ; i<c ; i+=3)
|
||||
{
|
||||
extern qbyte gammatable[256];
|
||||
ret[i+0] = gammatable[ret[i+0]];
|
||||
ret[i+1] = gammatable[ret[i+1]];
|
||||
ret[i+2] = gammatable[ret[i+2]];
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "qwsvdef.h"
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
|
||||
static sizebuf_t *writedest;
|
||||
static client_t *cldest;
|
||||
static int majortype;
|
||||
|
@ -2153,3 +2155,4 @@ void NPP_MVDWriteByte(qbyte data, client_t *to, int broadcast) //replacement wri
|
|||
NPP_MVDCheckFlush();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "qwsvdef.h"
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
|
||||
//okay, so these are a quick but easy hack
|
||||
int QC_RegisterFieldVar(struct progfuncs_s *progfuncs, unsigned int type, char *name, int requestedpos, int origionalofs);
|
||||
void ED_Print (struct progfuncs_s *progfuncs, struct edict_s *ed);
|
||||
|
@ -8320,3 +8322,4 @@ void PR_RegisterFields(void) //it's just easier to do it this way.
|
|||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "qwsvdef.h"
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
|
||||
//#ifdef _DEBUG
|
||||
#define NEWSAVEFORMAT
|
||||
//#endif
|
||||
|
@ -1117,3 +1119,4 @@ void SV_Loadgame_f (void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -514,6 +514,9 @@ typedef struct {
|
|||
typedef struct
|
||||
{
|
||||
FILE *file;
|
||||
int tcpsocket;
|
||||
int writedest; //doesn't bother if it's not valid demo_both is safe
|
||||
|
||||
|
||||
demobuf_t *dbuf;
|
||||
dbuffer_t dbuffer;
|
||||
|
|
|
@ -19,6 +19,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
#include "qwsvdef.h"
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
|
||||
qboolean sv_allow_cheats;
|
||||
|
||||
int fp_messages=4, fp_persecond=4, fp_secondsdead=10;
|
||||
|
@ -1583,3 +1585,5 @@ void SV_InitOperatorCommands (void)
|
|||
|
||||
cl_warncmd.value = 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
#include "qwsvdef.h"
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
|
||||
void NPP_MVDWriteByte(qbyte data, client_t *to, int broadcast);
|
||||
|
||||
void SV_New_f (void);
|
||||
|
@ -582,3 +585,4 @@ void SV_Demo_Init(void)
|
|||
// Cmd_AddCommand("svrecord", SV_RecordDemo_f);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "qwsvdef.h"
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
|
||||
void SV_CleanupEnts(void);
|
||||
|
||||
extern qboolean pr_udc_exteffect_enabled;
|
||||
|
@ -2226,3 +2228,4 @@ void SV_CleanupEnts(void)
|
|||
}
|
||||
needcleanup=0;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
|
||||
#include "qwsvdef.h"
|
||||
#ifndef CLIENTONLY
|
||||
extern int total_loading_size, current_loading_size, loading_stage;
|
||||
char *T_GetString(int num);
|
||||
|
||||
|
@ -1002,3 +1003,5 @@ void SV_SpawnServer (char *server, char *startspot, qboolean noents, qboolean us
|
|||
SCR_BeginLoadingPlaque();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -18,6 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
*/
|
||||
#include "qwsvdef.h"
|
||||
#ifndef CLIENTONLY
|
||||
#define Q2EDICT_NUM(i) (q2edict_t*)((char *)ge->edicts+i*ge->edict_size)
|
||||
|
||||
#ifdef _WIN32
|
||||
|
@ -3465,3 +3466,5 @@ void SV_Init (quakeparms_t *parms)
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -21,6 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "qwsvdef.h"
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
|
||||
/*
|
||||
=============
|
||||
SV_CheckBottom
|
||||
|
@ -447,3 +449,4 @@ void SV_MoveToGoal (progfuncs_t *prinst, struct globalvars_s *pr_globals)
|
|||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
*/
|
||||
|
||||
#include "qwsvdef.h"
|
||||
#ifndef CLIENTONLY
|
||||
#include "winquake.h"
|
||||
|
||||
#define Q_strncatz strncat
|
||||
|
@ -838,7 +839,7 @@ void SV_MVDStop (int reason)
|
|||
|
||||
SV_BroadcastPrintf (PRINT_CHAT, "Server recording canceled, demo removed\n");
|
||||
|
||||
// Cvar_SetROM(&serverdemo, "");
|
||||
Cvar_ForceSet(Cvar_Get("serverdemo", "", CVAR_NOSET, ""), "");
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -854,22 +855,33 @@ void SV_MVDStop (int reason)
|
|||
|
||||
SV_MVDWritePackets(demo.parsecount - demo.lastwritten + 1);
|
||||
// finish up
|
||||
if (!demo.disk)
|
||||
|
||||
if (demo.file)
|
||||
{
|
||||
fwrite(svs.demomem, 1, demo.size - demo_size, demo.file);
|
||||
fflush(demo.file);
|
||||
if (!demo.disk)
|
||||
{
|
||||
fwrite(svs.demomem, 1, demo.size - demo_size, demo.file);
|
||||
fflush(demo.file);
|
||||
}
|
||||
|
||||
fclose (demo.file);
|
||||
|
||||
demo.file = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
UDP_CloseSocket(demo.tcpsocket);
|
||||
demo.tcpsocket = 0;
|
||||
}
|
||||
|
||||
fclose (demo.file);
|
||||
|
||||
demo.file = NULL;
|
||||
|
||||
sv.mvdrecording = false;
|
||||
if (!reason)
|
||||
SV_BroadcastPrintf (PRINT_CHAT, "Server recording completed\n");
|
||||
else
|
||||
SV_BroadcastPrintf (PRINT_CHAT, "Server recording stoped\nMax demo size exceeded\n");
|
||||
|
||||
// Cvar_SetROM(&serverdemo, "");
|
||||
Cvar_ForceSet(Cvar_Get("serverdemo", "", CVAR_NOSET, ""), "");
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -984,13 +996,17 @@ static char *SV_PrintTeams(void)
|
|||
if (numcl == 2) // duel
|
||||
{
|
||||
_snprintf(buf, sizeof(buf), "team1 %s\nteam2 %s\n", clients[0]->name, clients[1]->name);
|
||||
} else if (!teamplay.value) // ffa
|
||||
}
|
||||
else if (!teamplay.value) // ffa
|
||||
{
|
||||
_snprintf(buf, sizeof(buf), "players:\n");
|
||||
for (i = 0; i < numcl; i++)
|
||||
_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %s\n", clients[i]->name);
|
||||
} else { // teamplay
|
||||
for (j = 0; j < numt; j++) {
|
||||
}
|
||||
else
|
||||
{ // teamplay
|
||||
for (j = 0; j < numt; j++)
|
||||
{
|
||||
_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "team %s:\n", teams[j]);
|
||||
for (i = 0; i < numcl; i++)
|
||||
if (!strcmp(Info_ValueForKey(clients[i]->userinfo, "team"), teams[j]))
|
||||
|
@ -1004,13 +1020,13 @@ static char *SV_PrintTeams(void)
|
|||
return va("%s",buf);
|
||||
}
|
||||
|
||||
static void SV_MVD_Record (char *name)
|
||||
static qboolean SV_MVD_Record (char *name, int tcpsocket)
|
||||
{
|
||||
sizebuf_t buf;
|
||||
char buf_data[MAX_QWMSGLEN];
|
||||
int n, i;
|
||||
char *s, info[MAX_INFO_STRING], path[MAX_OSPATH];
|
||||
|
||||
|
||||
client_t *player;
|
||||
char *gamedir;
|
||||
int seq = 1;
|
||||
|
@ -1022,56 +1038,66 @@ static void SV_MVD_Record (char *name)
|
|||
demo.recorder.frames[i].entities.max_entities = MAX_MVDPACKET_ENTITIES;
|
||||
demo.recorder.frames[i].entities.entities = demo_entities[i];
|
||||
}
|
||||
|
||||
|
||||
MVDBuffer_Init(&demo.dbuffer, demo.buffer, sizeof(demo.buffer));
|
||||
MVDSetMsgBuf(NULL, &demo.frames[0].buf);
|
||||
|
||||
demo.datagram.maxsize = sizeof(demo.datagram_data);
|
||||
demo.datagram.data = demo.datagram_data;
|
||||
|
||||
demo.file = fopen (name, "wb");
|
||||
if (!demo.file)
|
||||
if (name)
|
||||
{
|
||||
Con_Printf ("ERROR: couldn't open %s\n", name);
|
||||
return;
|
||||
}
|
||||
|
||||
SV_InitRecord();
|
||||
|
||||
s = name + strlen(name);
|
||||
while (*s != '/') s--;
|
||||
Q_strncpyz(demo.name, s+1, sizeof(demo.name));
|
||||
Q_strncpyz(demo.path, sv_demoDir.string, sizeof(demo.path));
|
||||
|
||||
if (!*demo.path)
|
||||
Q_strncpyz(demo.path, ".", MAX_OSPATH);
|
||||
|
||||
SV_BroadcastPrintf (PRINT_CHAT, "Server starts recording (%s):\n%s\n", demo.disk ? "disk" : "memory", demo.name);
|
||||
// Cvar_SetROM(&serverdemo, demo.name);
|
||||
|
||||
Q_strncpyz(path, name, MAX_OSPATH);
|
||||
Q_strncpyz(path + strlen(path) - 3, "txt", MAX_OSPATH - strlen(path) + 3);
|
||||
|
||||
if (sv_demotxt.value)
|
||||
{
|
||||
FILE *f;
|
||||
|
||||
f = fopen (path, "w+t");
|
||||
if (f != NULL)
|
||||
demo.file = fopen (name, "wb");
|
||||
if (!demo.file)
|
||||
{
|
||||
char buf[2000];
|
||||
date_t date;
|
||||
|
||||
SV_TimeOfDay(&date);
|
||||
|
||||
_snprintf(buf, sizeof(buf), "date %s\nmap %s\nteamplay %d\ndeathmatch %d\ntimelimit %d\n%s",date.str, sv.name, (int)teamplay.value, (int)deathmatch.value, (int)timelimit.value, SV_PrintTeams());
|
||||
fwrite(buf, strlen(buf),1,f);
|
||||
fflush(f);
|
||||
fclose(f);
|
||||
Con_Printf ("ERROR: couldn't open %s\n", name);
|
||||
return false;
|
||||
}
|
||||
|
||||
SV_InitRecord();
|
||||
|
||||
s = name + strlen(name);
|
||||
while (*s != '/') s--;
|
||||
Q_strncpyz(demo.name, s+1, sizeof(demo.name));
|
||||
Q_strncpyz(demo.path, sv_demoDir.string, sizeof(demo.path));
|
||||
|
||||
if (!*demo.path)
|
||||
Q_strncpyz(demo.path, ".", MAX_OSPATH);
|
||||
|
||||
SV_BroadcastPrintf (PRINT_CHAT, "Server starts recording (%s):\n%s\n", demo.disk ? "disk" : "memory", demo.name);
|
||||
Cvar_ForceSet(Cvar_Get("serverdemo", "", CVAR_NOSET, ""), demo.name);
|
||||
|
||||
Q_strncpyz(path, name, MAX_OSPATH);
|
||||
Q_strncpyz(path + strlen(path) - 3, "txt", MAX_OSPATH - strlen(path) + 3);
|
||||
|
||||
if (sv_demotxt.value)
|
||||
{
|
||||
FILE *f;
|
||||
|
||||
f = fopen (path, "w+t");
|
||||
if (f != NULL)
|
||||
{
|
||||
char buf[2000];
|
||||
date_t date;
|
||||
|
||||
SV_TimeOfDay(&date);
|
||||
|
||||
_snprintf(buf, sizeof(buf), "date %s\nmap %s\nteamplay %d\ndeathmatch %d\ntimelimit %d\n%s",date.str, sv.name, (int)teamplay.value, (int)deathmatch.value, (int)timelimit.value, SV_PrintTeams());
|
||||
fwrite(buf, strlen(buf),1,f);
|
||||
fflush(f);
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
else
|
||||
Sys_remove(path);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (demo.tcpsocket)
|
||||
return false;
|
||||
SV_BroadcastPrintf (PRINT_CHAT, "Server starts recording to network client\n");
|
||||
demo.tcpsocket = tcpsocket;
|
||||
}
|
||||
else
|
||||
Sys_remove(path);
|
||||
|
||||
sv.mvdrecording = true;
|
||||
demo.pingtime = demo.time = sv.time;
|
||||
|
@ -1327,6 +1353,7 @@ static void SV_MVD_Record (char *name)
|
|||
|
||||
SV_WriteSetMVDMessage();
|
||||
// done
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1485,7 +1512,7 @@ void SV_MVD_Record_f (void)
|
|||
COM_DefaultExtension(name, ".mvd");
|
||||
|
||||
|
||||
SV_MVD_Record (name);
|
||||
SV_MVD_Record (name, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1720,7 +1747,7 @@ void SV_MVDEasyRecord_f (void)
|
|||
} while (f);
|
||||
}
|
||||
|
||||
SV_MVD_Record (name2);
|
||||
SV_MVD_Record (name2, 0);
|
||||
}
|
||||
|
||||
void SV_MVDList_f (void)
|
||||
|
@ -2097,3 +2124,4 @@ void SV_MVDInit(void)
|
|||
Cmd_AddCommand ("rmdemonum", SV_MVDRemoveNum_f);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
// sv_nchan.c, user reliable data stream writes
|
||||
|
||||
#include "qwsvdef.h"
|
||||
#ifndef CLIENTONLY
|
||||
|
||||
// check to see if client block will fit, if not, rotate buffers
|
||||
void ClientReliableCheckBlock(client_t *cl, int maxsize)
|
||||
|
@ -258,3 +259,5 @@ void ClientReliableWrite_ZLib(client_t *cl, void *data, int len)
|
|||
// return i;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
// sv_phys.c
|
||||
|
||||
#include "qwsvdef.h"
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
extern nqglobalvars_t realpr_nqglobal_struct;
|
||||
|
||||
/*
|
||||
|
@ -2053,3 +2053,4 @@ void SV_SetMoveVars(void)
|
|||
movevars.waterfriction = sv_waterfriction.value;
|
||||
movevars.entgravity = 1.0;
|
||||
}
|
||||
#endif
|
|
@ -1,5 +1,7 @@
|
|||
#include "qwsvdef.h"
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
|
||||
#if defined(_WIN32) && !defined(MINGW)
|
||||
#define inline //_inline //fix for stupid VC
|
||||
#endif
|
||||
|
@ -865,3 +867,4 @@ void Rank_Flush (void) //new game dir?
|
|||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -21,6 +21,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "qwsvdef.h"
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
|
||||
#define CHAN_AUTO 0
|
||||
#define CHAN_WEAPON 1
|
||||
#define CHAN_VOICE 2
|
||||
|
@ -1792,3 +1794,4 @@ void SV_SendMessagesToAll (void)
|
|||
SV_SendClientMessages ();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,6 +20,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
// sv_user.c -- server code for moving users
|
||||
|
||||
#include "qwsvdef.h"
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
|
||||
#include <ctype.h>
|
||||
#define Q2EDICT_NUM(i) (q2edict_t*)((char *)ge->edicts+i*ge->edict_size)
|
||||
#define Q2NUM_FOR_EDICT(ent) (((char *)ent - (char *)ge->edicts) / ge->edict_size)
|
||||
|
@ -4814,3 +4817,4 @@ void SV_ClientThink (void)
|
|||
SV_AirMove ();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "qwsvdef.h"
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
|
||||
#define Q2EDICT_NUM(i) (q2edict_t*)((char *)ge->edicts+i*ge->edict_size)
|
||||
|
||||
#ifndef Q2SERVER
|
||||
|
@ -772,4 +774,4 @@ void SVQ2_Ents_Init(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#include "qwsvdef.h"
|
||||
|
||||
#ifndef CLIENTONLY
|
||||
/*
|
||||
|
||||
entities never clip against themselves, or their owner
|
||||
|
@ -1888,3 +1889,4 @@ trace_t SVQ2_Move (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int type,
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue