mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 14:42:13 +00:00
Fixed some stuff. Cygwin stuff compiles now, so maybe linux will too. I've not tested it though cos cygwin uses software gl rendering, and I'm impatient. Also boosted NUM_SPAWN_PARMS a little, so saved games will break.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3408 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
5a649378f5
commit
4c37c34c13
21 changed files with 117 additions and 34 deletions
|
@ -344,6 +344,7 @@ GLQUAKE_OBJS = \
|
|||
gl_draw.o \
|
||||
gl_model.o \
|
||||
gl_ngraph.o \
|
||||
gl_backend.o \
|
||||
gl_rlight.o \
|
||||
gl_rmain.o \
|
||||
gl_rmisc.o \
|
||||
|
@ -351,13 +352,12 @@ GLQUAKE_OBJS = \
|
|||
gl_heightmap.o \
|
||||
gl_rsurf.o \
|
||||
ltface.o \
|
||||
r_2d.o \
|
||||
gl_screen.o \
|
||||
gl_bloom.o \
|
||||
gl_vbo.o \
|
||||
gl_shadow.o \
|
||||
gl_shader.o \
|
||||
gl_warp.o \
|
||||
gl_ppl.o \
|
||||
gl_vidcommon.o \
|
||||
gl_hlmdl.o
|
||||
|
||||
|
|
|
@ -2642,7 +2642,7 @@ void CL_UpdateBeams (void)
|
|||
|
||||
if (b->endtime < cl.time)
|
||||
{
|
||||
if (!sv.paused)
|
||||
if (!cl.paused)
|
||||
{ /*don't let lightning decay while paused*/
|
||||
P_DelinkTrailstate(&b->trailstate);
|
||||
P_DelinkTrailstate(&b->emitstate);
|
||||
|
|
|
@ -162,6 +162,8 @@ extern "C" {
|
|||
#include "cdaudio.h"
|
||||
#include "pmove.h"
|
||||
|
||||
#include "progtype.h"
|
||||
#include "progdefs.h"
|
||||
#ifndef CLIENTONLY
|
||||
#include "progs.h"
|
||||
#endif
|
||||
|
|
|
@ -234,6 +234,7 @@ enum uploadfmt
|
|||
TF_TRANS8, /*8bit quake-palette image, index 255=transparent*/
|
||||
TF_TRANS8_FULLBRIGHT, /*fullbright 8 - fullbright texels have alpha 255, everything else 0*/
|
||||
TF_HEIGHT8, /*image data is greyscale, convert to a normalmap and load that, uploaded alpha contains the original heights*/
|
||||
TF_HEIGHT8PAL, /*source data is palette values rather than actual heights, generate a fallback heightmap*/
|
||||
TF_H2_T7G1, /*8bit data, odd indexes give greyscale transparence*/
|
||||
TF_H2_TRANS8_0, /*8bit data, 0 is transparent, not 255*/
|
||||
TF_H2_T4A4 /*8bit data, weird packing*/
|
||||
|
@ -331,6 +332,7 @@ int R_LoadTexture(char *name, int width, int height, void *data, void *palette,
|
|||
#define R_LoadTexture8(id,w,h,d,f,t) R_LoadTexture(id,w,h,t?TF_TRANS8:TF_SOLID8,d,f)
|
||||
#define R_LoadTexture32(id,w,h,d,f) R_LoadTexture(id,w,h,TF_RGBA32,d,f)
|
||||
#define R_LoadTextureFB(id,w,h,d,f) R_LoadTexture(id,w,h,TF_TRANS8_FULLBRIGHT,d,f)
|
||||
#define R_LoadTexture8BumpPal(id,w,h,d,f) R_LoadTexture(id,w,h,TF_HEIGHT8PAL,d,f)
|
||||
#define R_LoadTexture8Bump(id,w,h,d,f) R_LoadTexture(id,w,h,TF_HEIGHT8,d,f)
|
||||
|
||||
/*it seems a little excessive to have to include glquake (and windows headers), just to load some textures/shaders for the backend*/
|
||||
|
|
|
@ -406,7 +406,7 @@ void Sys_CloseLibrary(dllhandle_t *lib)
|
|||
{
|
||||
dlclose((void*)lib);
|
||||
}
|
||||
dllhandle_t *Sys_LoadLibrary(char *name, dllfunction_t *funcs)
|
||||
dllhandle_t *Sys_LoadLibrary(const char *name, dllfunction_t *funcs)
|
||||
{
|
||||
int i;
|
||||
dllhandle_t lib;
|
||||
|
|
|
@ -123,9 +123,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
|
||||
#define PSET_CLASSIC
|
||||
|
||||
#ifndef SERVERONLY //don't be stupid, stupid.
|
||||
#define CLIENTONLY
|
||||
#endif
|
||||
#ifndef SERVERONLY //don't be stupid, stupid.
|
||||
#ifndef CLIENTONLY
|
||||
#define CLIENTONLY
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#define SIDEVIEWS 4 //enable secondary/reverse views.
|
||||
#define SP2MODELS //quake2 sprite models
|
||||
|
|
|
@ -2016,7 +2016,7 @@ static void *Q1_LoadSkins_GL (daliasskintype_t *pskintype, unsigned int skintran
|
|||
if (gl_bump.ival)
|
||||
{
|
||||
snprintf(skinname, sizeof(skinname), "%s__%i_bump", loadname, i);
|
||||
bumptexture = R_LoadTexture8Bump(skinname, outskin->skinwidth, outskin->skinheight, saved, IF_NOGAMMA, 1.0);
|
||||
bumptexture = R_LoadTexture8BumpPal(skinname, outskin->skinwidth, outskin->skinheight, saved, IF_NOGAMMA);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1073,7 +1073,7 @@ texture_t *Mod_LoadWall(char *name)
|
|||
oin = (qbyte *)wal+wal->offsets[0];
|
||||
for (j = 0; j < wal->width*wal->height; j++)
|
||||
in[j] = (d_q28to24table[oin[j]*3+0] + d_q28to24table[oin[j]*3+1] + d_q28to24table[oin[j]*3+2])/3;
|
||||
tn.bump = R_LoadTexture8Bump (va("%s_bump", wal->name), tex->width, tex->height, in, true, r_shadow_bumpscale_basetexture.value);
|
||||
tn.bump = R_LoadTexture8BumpPal (va("%s_bump", wal->name), tex->width, tex->height, in, true);
|
||||
|
||||
BZ_Free(wal);
|
||||
|
||||
|
|
|
@ -27756,6 +27756,82 @@
|
|||
<Filter
|
||||
Name="nonwin"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\gl\gl_vidlinuxglx.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="MinGLDebug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="D3DDebug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="MinGLRelease|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="GLDebug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release Dedicated Server|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="MRelease|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug Dedicated Server|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="MDebug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="GLRelease|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\client\in_macos.c"
|
||||
>
|
||||
|
|
|
@ -740,7 +740,7 @@ static texid_t Shader_TextureForPass(const shaderpass_t *pass)
|
|||
|
||||
case T_GEN_VIDEOMAP:
|
||||
#ifdef NOMEDIA
|
||||
return shaderstate.curtexnums?shaderstate.curtexnums->base:0;
|
||||
return shaderstate.curtexnums?shaderstate.curtexnums->base:r_nulltex;
|
||||
#else
|
||||
return Media_UpdateForShader(pass->cin);
|
||||
#endif
|
||||
|
|
|
@ -97,6 +97,7 @@ texid_t GL_LoadTextureFmt (char *name, int width, int height, enum uploadfmt fmt
|
|||
case TF_SOLID8:
|
||||
return GL_LoadTexture(name, width, height, data, flags, 0);
|
||||
|
||||
case TF_HEIGHT8PAL:
|
||||
case TF_HEIGHT8:
|
||||
return GL_LoadTexture8Bump(name, width, height, data, flags, r_shadow_bumpscale_basetexture.value);
|
||||
|
||||
|
|
|
@ -1123,7 +1123,7 @@ TRACE(("dbg: RMod_LoadTextures: inittexturedescs\n"));
|
|||
for (j = 0; j < pixels; j++)
|
||||
base[j] = (host_basepal[base[j]*3] + host_basepal[base[j]*3+1] + host_basepal[base[j]*3+2]) / 3;
|
||||
|
||||
tn.bump = R_LoadTexture8Bump(altname, tx->width, tx->height, base, true, r_shadow_bumpscale_basetexture.value); //normalise it and then bump it.
|
||||
tn.bump = R_LoadTexture8BumpPal(altname, tx->width, tx->height, base, true); //normalise it and then bump it.
|
||||
}
|
||||
|
||||
//don't do any complex quake 8bit -> glossmap. It would likly look a little ugly...
|
||||
|
@ -1309,7 +1309,7 @@ void RMod_NowLoadExternal(void)
|
|||
*heightmap++ = (data[j*4+0] + data[j*4+1] + data[j*4+2])/3;
|
||||
}
|
||||
|
||||
tn.bump = R_LoadTexture8Bump (va("%s_bump", tx->name), width, height, heightmap-j, true, r_shadow_bumpscale_basetexture.value);
|
||||
tn.bump = R_LoadTexture8BumpPal (va("%s_bump", tx->name), width, height, heightmap-j, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -720,12 +720,8 @@ GL_BeginRendering
|
|||
|
||||
=================
|
||||
*/
|
||||
void GL_BeginRendering (int *x, int *y, int *width, int *height)
|
||||
void GL_BeginRendering (void)
|
||||
{
|
||||
// if (!wglMakeCurrent( maindc, baseRC ))
|
||||
// Sys_Error ("wglMakeCurrent failed");
|
||||
|
||||
// qglViewport (*x, *y, *width, *height);
|
||||
}
|
||||
|
||||
|
||||
|
@ -776,8 +772,7 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
|
|||
return false;
|
||||
}
|
||||
|
||||
vid.maxwarpwidth = WARP_WIDTH;
|
||||
vid.maxwarpheight = WARP_HEIGHT;
|
||||
vid.pixeloffset = 0;
|
||||
vid.colormap = host_colormap;
|
||||
|
||||
// interpret command-line params
|
||||
|
|
|
@ -134,8 +134,6 @@ typedef union eval_s
|
|||
#endif
|
||||
*/
|
||||
|
||||
|
||||
#define MAX_ENT_LEAFS 16
|
||||
typedef struct edictrun_s
|
||||
{
|
||||
pbool isfree;
|
||||
|
|
|
@ -315,3 +315,6 @@ comextqcfields
|
|||
#undef comfieldstring
|
||||
#undef comfieldfunction
|
||||
} comextentvars_t;
|
||||
|
||||
|
||||
#define MAX_ENT_LEAFS 16
|
||||
|
|
|
@ -26,7 +26,7 @@ struct edict_s;
|
|||
#define MAX_PROGS 64
|
||||
#define MAXADDONS 16
|
||||
|
||||
#define NUM_SPAWN_PARMS 32 //moved from server.h because of include ordering :(.
|
||||
#define NUM_SPAWN_PARMS 64 //moved from server.h because of include ordering :(.
|
||||
|
||||
#define NewGetEdictFieldValue GetEdictFieldValue
|
||||
void Q_SetProgsParms(qboolean forcompiler);
|
||||
|
@ -47,9 +47,6 @@ void PR_RunThreads(void);
|
|||
#define PR_MAINPROGS 0 //this is a constant that should really be phased out. But seeing as QCLIB requires some sort of master progs due to extern funcs...
|
||||
//maybe go through looking for extern funcs, and remember which were not allocated. It would then be a first come gets priority. Not too bad I supppose.
|
||||
|
||||
#include "progtype.h"
|
||||
#include "progdefs.h"
|
||||
|
||||
extern int compileactive;
|
||||
|
||||
typedef enum {PROG_NONE, PROG_QW, PROG_NQ, PROG_H2, PROG_PREREL, PROG_UNKNOWN} progstype_t; //unknown obtains NQ behaviour
|
||||
|
@ -117,7 +114,6 @@ typedef struct
|
|||
} worldode_t;
|
||||
#endif
|
||||
|
||||
#define MAX_ENT_LEAFS 16
|
||||
typedef struct edict_s
|
||||
{
|
||||
//these 5 shared with qclib
|
||||
|
|
|
@ -55,6 +55,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "cmd.h"
|
||||
#include "model.h"
|
||||
#include "crc.h"
|
||||
#include "progtype.h"
|
||||
#include "progdefs.h"
|
||||
#include "progs.h"
|
||||
#include "q2game.h"
|
||||
|
||||
|
|
|
@ -274,8 +274,10 @@ void SV_Loadgame_f(void)
|
|||
cl->connection_started = realtime+20;
|
||||
cl->istobeloaded = true;
|
||||
|
||||
for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
|
||||
for (i=0 ; i<16 ; i++)
|
||||
fscanf (f, "%f\n", &cl->spawn_parms[i]);
|
||||
for (; i < NUM_SPAWN_PARMS; i++)
|
||||
cl->spawn_parms[i] = 0;
|
||||
}
|
||||
else //fte QuakeWorld saves ALL the clients on the server.
|
||||
{
|
||||
|
|
|
@ -1130,10 +1130,12 @@ void ClientReliableWrite_SZ(client_t *cl, void *data, int len);
|
|||
#define RANK_CUFFED 4
|
||||
#define RANK_CRIPPLED 8 //ha ha... get speed cheaters with this!... :o)
|
||||
|
||||
#define NUM_RANK_SPAWN_PARMS 32
|
||||
|
||||
typedef struct { //stats info
|
||||
int kills;
|
||||
int deaths;
|
||||
float parm[NUM_SPAWN_PARMS];
|
||||
float parm[NUM_RANK_SPAWN_PARMS];
|
||||
float timeonserver;
|
||||
qbyte flags1;
|
||||
qbyte trustlevel;
|
||||
|
|
|
@ -429,7 +429,7 @@ void SV_DropClient (client_t *drop)
|
|||
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, drop->edict);
|
||||
if (pr_nqglobal_struct->SetChangeParms)
|
||||
PR_ExecuteProgram (svprogfuncs, pr_global_struct->SetChangeParms);
|
||||
for (j=0 ; j<NUM_SPAWN_PARMS ; j++)
|
||||
for (j=0 ; j<NUM_RANK_SPAWN_PARMS ; j++)
|
||||
if (spawnparamglobals[j])
|
||||
rs.parm[j] = *spawnparamglobals[j];
|
||||
Rank_SetPlayerStats(drop->rankid, &rs);
|
||||
|
@ -2249,8 +2249,10 @@ client_t *SVC_DirectConnect(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
|
||||
for (i=0 ; i<NUM_RANK_SPAWN_PARMS ; i++)
|
||||
newcl->spawn_parms[i] = rs.parm[i];
|
||||
for (; i < NUM_SPAWN_PARMS; i++)
|
||||
newcl->spawn_parms[i] = 0;
|
||||
}
|
||||
|
||||
if (rs.timeonserver > 3*60) //woo. Ages.
|
||||
|
@ -4077,7 +4079,7 @@ qboolean ReloadRanking(client_t *cl, char *newname)
|
|||
pr_global_struct->self = EDICT_TO_PROG(svprogfuncs, cl->edict);
|
||||
if (pr_nqglobal_struct->SetChangeParms)
|
||||
PR_ExecuteProgram (svprogfuncs, pr_global_struct->SetChangeParms);
|
||||
for (j=0 ; j<NUM_SPAWN_PARMS ; j++)
|
||||
for (j=0 ; j<NUM_RANK_SPAWN_PARMS ; j++)
|
||||
if (spawnparamglobals[j])
|
||||
rs.parm[j] = *spawnparamglobals[j];
|
||||
Rank_SetPlayerStats(cl->rankid, &rs);
|
||||
|
|
|
@ -30,7 +30,7 @@ cvar_t rank_needlogin = SCVAR("rank_needlogin", "0");
|
|||
cvar_t rank_filename = SCVAR("rank_filename", "");
|
||||
char rank_cvargroup[] = "server rankings";
|
||||
|
||||
#define RANKFILE_VERSION 0x00000000
|
||||
#define RANKFILE_VERSION ((NUM_RANK_SPAWN_PARMS==32)?0:0x00000001)
|
||||
#define RANKFILE_IDENT *(int*)"RANK"
|
||||
|
||||
void inline READ_PLAYERSTATS(int x, rankstats_t *os)
|
||||
|
@ -42,7 +42,7 @@ void inline READ_PLAYERSTATS(int x, rankstats_t *os)
|
|||
|
||||
os->kills = swaplong(os->kills);
|
||||
os->deaths = swaplong(os->deaths);
|
||||
for (i = 0; i < NUM_SPAWN_PARMS; i++)
|
||||
for (i = 0; i < NUM_RANK_SPAWN_PARMS; i++)
|
||||
os->parm[i] = swapfloat(os->parm[i]);
|
||||
os->timeonserver = swapfloat(os->timeonserver);
|
||||
// os->flags1 = (os->flags1);
|
||||
|
@ -60,7 +60,7 @@ void inline WRITE_PLAYERSTATS(int x, rankstats_t *os)
|
|||
|
||||
ns.kills = swaplong(os->kills);
|
||||
ns.deaths = swaplong(os->deaths);
|
||||
for (i = 0; i < NUM_SPAWN_PARMS; i++)
|
||||
for (i = 0; i < NUM_RANK_SPAWN_PARMS; i++)
|
||||
ns.parm[i] = swapfloat(os->parm[i]);
|
||||
ns.timeonserver = swapfloat(os->timeonserver);
|
||||
ns.flags1 = (os->flags1);
|
||||
|
|
Loading…
Reference in a new issue