Fixed some warnings and stuph.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@829 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-01-24 23:47:32 +00:00
parent ed12d52f79
commit 51da6d3abf
28 changed files with 72 additions and 66 deletions

View file

@ -25,7 +25,8 @@ SERVER_DIR=$(BASE_DIR)/server
COMMON_DIR=$(BASE_DIR)/common
NQPROT_DIR=$(BASE_DIR)/nqnet
HTTP_DIR=$(BASE_DIR)/http
LIBS_DIR=$(BASE_DIR)/libs
#LIBS_DIR=$(BASE_DIR)/libs
LIBS_DIR?=.
PROGS_DIR=$(BASE_DIR)/qclib
SNDCODEC_DIR=$(BASE_DIR)/sndcodec
MP3_DIR=$(BASE_DIR)/../mp3/libmad
@ -330,6 +331,7 @@ SV_CFLAGS=$(SERVER_ONLY_CFLAGS)
#specific targets override those defaults as needed.
ifeq ($(FTE_TARGET),win32)
LIBS_DIR = $(BASE_DIR)/libs
SV_EXE_NAME=../fteqwsv.exe
SV_LDFLAGS=libs/zlib.lib -lwsock32
SV_DIR=sv_mingw
@ -438,8 +440,8 @@ endif
#which is needed as windows sucks too much for the chaining to carry a full list.
#god knows how gcc loads the list properly.
#or at least I hope he does. It makes no sence to mortals.
$(OUT_DIR)/$(EXE_NAME): $(addprefix $(OUT_DIR)/, $(foreach ol, $(OBJS), $($(ol))))
$(CC) $(WCFLAGS) -o $@ $(addprefix $(OUT_DIR)/, $(foreach ol, $(OBJS), $($(ol)))) $(LDFLAGS) $(CFLAGS)
$(OUT_DIR)/$(EXE_NAME): $(addprefix $(OUT_DIR)/, $(CUSTOMOBJS) $(foreach ol, $(OBJS), $($(ol))))
$(CC) $(WCFLAGS) -o $@ $(addprefix $(OUT_DIR)/, $(CUSTOMOBJS) $(foreach ol, $(OBJS), $($(ol)))) $(LDFLAGS) $(CFLAGS)
_out-rel:
$(MAKE) $(OUT_DIR)/$(EXE_NAME) EXE_NAME="$(EXE_NAME)" OUT_DIR="$(OUT_DIR)" WCFLAGS="$(WCFLAGS) $(RELEASE_CFLAGS)" LDFLAGS="$(BASELDFLAGS) $(LDFLAGS)" OBJS="$(OBJS)"

View file

@ -1593,12 +1593,14 @@ void CL_ParseServerData (void)
Con_TPrintf (TLC_PC_PS_NL, 2, str);
memset(cl.sound_name, 0, sizeof(cl.sound_name));
if (cls.fteprotocolextensions & PEXT_PK3DOWNLOADS)
#ifdef PEXT_PK3DOWNLOADS
if (cls.fteprotocolextensions & PEXT_PK3DOWNLOADS) //instead of going for a soundlist, go for the pk3 list instead. The server will make us go for the soundlist after.
{
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);
MSG_WriteString (&cls.netchan.message, va("pk3list %i 0", cl.servercount, 0));
}
else
#endif
{
// ask for the sound list next
MSG_WriteByte (&cls.netchan.message, clc_stringcmd);

View file

@ -794,6 +794,7 @@ void Skin_Skins_f (void);
void Skin_FlushSkin(char *name);
void Skin_AllSkins_f (void);
void Skin_NextDownload (void);
void Skin_FlushPlayers(void);
#define RSSHOT_WIDTH 320
#define RSSHOT_HEIGHT 200

View file

@ -1069,7 +1069,7 @@ void Con_DrawNotify (void)
Draw_ColouredCharacter ( (x+skip)<<3, v, s[x]|mask);
x++;
}
Draw_ColouredCharacter ( (x+skip)<<3, v, 10+((int)(realtime*con_cursorspeed)&1)|M_COLOR_WHITE);
Draw_ColouredCharacter ( (x+skip)<<3, v, (10+((int)(realtime*con_cursorspeed)&1))|M_COLOR_WHITE);
v += 8;
}

View file

@ -73,7 +73,7 @@ static void NM_Print (int cx, int cy, qbyte *str)
{
while (*str)
{
Draw_ColouredCharacter (cx, cy, (*str)|128+M_COLOR_WHITE);
Draw_ColouredCharacter (cx, cy, (*str)|128|M_COLOR_WHITE);
str++;
cx += 8;
}

View file

@ -108,6 +108,8 @@ extern int (*Mod_TagNumForName) (struct model_s *model, char *name);
#undef FNC
void Draw_FunString(int x, int y, char *str);
#ifdef SERVERONLY
#define Mod_Q1LeafPVS Mod_LeafPVS

View file

@ -176,6 +176,7 @@ cvar_t scr_allowsnap = {"scr_allowsnap", "1", NULL, CVAR_NOTFROMSERVER}; //oth
cvar_t scr_chatmodecvar = {"scr_chatmode", "0"};
#ifdef Q3SHADERS
cvar_t gl_shadeq3 = {"gl_shadeq3", "1"}; //use if you want.
extern cvar_t r_vertexlight;
cvar_t gl_shadeq1 = {"gl_shadeq1", "0", NULL, CVAR_CHEAT}; //FIXME: :(
cvar_t gl_shadeq1_name = {"gl_shadeq1_name", "*"};
@ -339,6 +340,7 @@ void GLRenderer_Init(void)
Cvar_Register (&r_vertexlight, GLRENDEREROPTIONS);
Cvar_Register (&gl_shadeq1, GLRENDEREROPTIONS);
Cvar_Register (&gl_shadeq1_name, GLRENDEREROPTIONS);
Cvar_Register (&gl_shadeq3, GLRENDEREROPTIONS);
#endif
}
#endif
@ -1377,7 +1379,6 @@ qboolean R_ApplyRenderer (rendererstate_t *newr)
host_basepal = (qbyte *)COM_LoadMallocFile ("gfx/palette.lmp");
if (!host_basepal)
{
extern char com_basedir[MAX_OSPATH];
qbyte *pcx=NULL;
host_basepal = BZ_Malloc(768);
pcx = COM_LoadTempFile("pics/colormap.pcx");

View file

@ -92,3 +92,5 @@ void SCR_ShowPic_Clear(void);
//a header is better than none...
void Draw_TextBox (int x, int y, int width, int lines);
void SCR_ScreenShot (char *filename);
void SCR_DrawTwoDimensional(int uimenu, qboolean nohud);

View file

@ -2301,12 +2301,11 @@ char com_basedir[MAX_OSPATH];
#ifdef _WIN32
#pragma comment( lib, "../libs/zlib.lib" )
#endif
#ifndef __linux__
#define uShort ZLIBuShort
#define uLong ZLIBuLong
#else
//typedef unsigned short uShort;
#endif
//#define uShort ZLIBuShort
//#define uLong ZLIBuLong
#include <zlib.h>
#include "unzip.c"
typedef struct zipfile_s

View file

@ -162,6 +162,8 @@ void MSG_ReadData (void *data, int len);
char *Q_strcpyline(char *out, char *in, int maxlen); //stops at '\n' (and '\r')
char *Q_strlwr(char *str);
#define Q_memset(d, f, c) memset((d), (f), (c))
#define Q_memcpy(d, s, c) memcpy((d), (s), (c))
#define Q_memcmp(m1, m2, c) memcmp((m1), (m2), (c))

View file

@ -1296,7 +1296,6 @@ void CMod_LoadFaces (lump_t *l)
int i, count, surfnum;
int planenum, side;
int ti;
extern qboolean r_usinglits;
in = (void *)(cmod_base + l->fileofs);
if (l->filelen % sizeof(*in))
@ -2263,9 +2262,9 @@ void CModQ3_LoadRFaces (lump_t *l)
mesh_t *mesh;
extern cvar_t gl_shaders;
extern cvar_t gl_shadeq3;
int shaders = 1;//0;//gl_shaders.value;
int shaders = gl_shadeq3.value;
in = (void *)(mod_base + l->fileofs);

View file

@ -156,7 +156,7 @@ static int EXPORT_FN Plug_SystemCalls(int arg, ...)
plugin_t *Plug_Load(char *file)
{
plugin_t *newplug;
int argarray;
long argarray;
for (newplug = plugs; newplug; newplug = newplug->next)
{
@ -175,7 +175,7 @@ plugin_t *Plug_Load(char *file)
newplug->next = plugs;
plugs = newplug;
argarray = (int)"Plug_GetEngineFunction";
argarray = (long)"Plug_GetEngineFunction";
VM_Call(newplug->vm, 0, Plug_FindBuiltin(NULL, ~0, &argarray));
if (newplug->reschange)
@ -496,7 +496,7 @@ int Plug_Draw_Fill(void *offset, unsigned int mask, const long *arg)
y = VM_FLOAT(arg[1]);
width = VM_FLOAT(arg[2]);
height = VM_FLOAT(arg[3]);
switch(qrenderer)
switch(qrenderer) //FIXME: I don't want qrenderer seen outside the refresh
{
#ifdef RGLQUAKE
case QR_OPENGL:
@ -510,11 +510,12 @@ int Plug_Draw_Fill(void *offset, unsigned int mask, const long *arg)
qglEnable(GL_TEXTURE_2D);
return 1;
#endif
default:
break;
}
return 0;
}
//hrm.... FIXME!
int Plug_Draw_ColourP(void *offset, unsigned int mask, const long *arg)
{
qbyte *pal = host_basepal + VM_LONG(arg[0])*3;
@ -589,7 +590,6 @@ int Plug_Cvar_SetFloat(void *offset, unsigned int mask, const long *arg)
int Plug_Cvar_GetFloat(void *offset, unsigned int mask, const long *arg)
{
char *name = VM_POINTER(arg[0]);
float value = VM_FLOAT(arg[1]);
int ret;
cvar_t *var = Cvar_Get(name, "", 0, "Plugin vars");
if (var)
@ -976,7 +976,7 @@ void Plug_Close_f(void)
}
for (plug = plugs; plug; plug = plug->next)
{
if (!strcmp(plug->name, Cmd_Argv(1)))
if (!strcmp(plug->name, name))
{
Plug_Close(plug);
return;

View file

@ -55,7 +55,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//#define PEXT_64PLAYERS 0x02000000 //Client is able to cope with 64 players. Wow.
#define PEXT_SHOWPIC 0x04000000
#define PEXT_SETATTACHMENT 0x08000000 //md3 tags (needs networking, they need to lerp).
#define PEXT_PK3DOWNLOADS 0x10000000 //retrieve a list of pk3s/pk3s/paks for downloading (with optional URL and crcs)
//#define PEXT_PK3DOWNLOADS 0x10000000 //retrieve a list of pk3s/pk3s/paks for downloading (with optional URL and crcs)
#ifdef _DEBUG
#define PEXT_CHUNKEDDOWNLOADS 0x20000000 //alternate file download method. Hopefully it'll give quadroupled download speed, especially on higher pings.
#endif

View file

@ -2334,7 +2334,7 @@ void R_RenderMeshCombined ( meshbuffer_t *mb, shaderpass_t *pass )
break;
case GL_DECAL:
// mimics Alpha-Blending in upper texture stage, but instead of multiplying the alpha-channel, they´re added
// mimics Alpha-Blending in upper texture stage, but instead of multiplying the alpha-channel, theyre added
// this way it can be possible to use GL_DECAL in both texture-units, while still looking good
// normal mutlitexturing would multiply the alpha-channel which looks ugly
GL_TexEnv (GL_COMBINE_EXT);

View file

@ -84,10 +84,6 @@ static unsigned int varray_i_polytotri[MAXARRAYVERTS]; //012 023 034 045...
int varray_ic;
int varray_vc;
#ifdef Q3SHADERS
static qboolean pplvarrayactive;
#endif
#define inline static
extern qboolean varrayactive; //used by the backend
@ -1311,10 +1307,7 @@ static void PPL_BaseChain_Flat(msurface_t *first)
static void PPL_BaseChain_NPR_Sketch(msurface_t *first)
{
static vec_t wallcolour[4] = {0,0,0,1};
static vec_t floorcolour[4] = {0,0,0,1};
msurface_t *s;
int iswall = -1;
int vi=-10;
int i;
glRect_t *theRect;

View file

@ -949,17 +949,19 @@ void R_PolyBlend (void)
//Con_Printf("R_PolyBlend(): %4.2f %4.2f %4.2f %4.2f\n",v_blend[0], v_blend[1], v_blend[2], v_blend[3]);
GL_DisableMultitexture();
GL_DisableMultitexture();
qglDisable (GL_ALPHA_TEST);
qglEnable (GL_BLEND);
qglDisable (GL_DEPTH_TEST);
qglDisable (GL_TEXTURE_2D);
qglLoadIdentity ();
qglBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
qglRotatef (-90, 1, 0, 0); // put Z going up
qglRotatef (90, 0, 0, 1); // put Z going up
qglLoadIdentity ();
qglRotatef (-90, 1, 0, 0); // put Z going up
qglRotatef (90, 0, 0, 1); // put Z going up
qglColor4fv (v_blend);
@ -1864,7 +1866,6 @@ void GLR_RenderView (void)
// we check if we need to use any shaders - currently it's just waterwarp
if ((gl_config.arb_shader_objects) && (r_waterwarp.value && r_viewleaf && r_viewleaf->contents <= Q1CONTENTS_WATER))
{
extern int char_texture;
float vwidth = 1, vheight = 1;
float vs, vt;

View file

@ -129,7 +129,7 @@ void GLSCR_UpdateScreen (void)
static float old2dscale=1;
int uimenu;
#ifdef TEXTEDITOR
extern qboolean editormodal, editoractive;
extern qboolean editormodal;
#endif
qboolean nohud;
RSpeedMark();

View file

@ -30,6 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <ctype.h>
//Spike: Marked code removal areas with FIZME
//readd as porting progresses
@ -215,7 +216,7 @@ static char *Shader_ParseString ( char **ptr )
}
token = COM_ParseExt ( ptr, false );
strlwr ( token );
Q_strlwr ( token );
return token;
}

View file

@ -367,7 +367,7 @@ GLhandleARB GLSlang_CreateShader (char *shadersource, int shadertype)
shader = qglCreateShaderObjectARB(type);
qglShaderSourceARB(shader, 1, &shadersource, NULL);
qglShaderSourceARB(shader, 1, (const GLcharARB**)&shadersource, NULL);
qglCompileShaderARB(shader);
qglGetObjectParameterivARB(shader, GL_OBJECT_COMPILE_STATUS_ARB, &compiled);

View file

@ -986,7 +986,7 @@ void GLR_InitSky (texture_t *mt)
((qbyte *)&transpix)[3] = 0;
sprintf(name, "%s_solid", mt->name);
strlwr(name);
Q_strlwr(name);
solidskytexture = Mod_LoadReplacementTexture(name, true, false, true);
if (!solidskytexture)
solidskytexture = GL_LoadTexture32(name, 128, 128, trans, true, false);
@ -1011,7 +1011,7 @@ void GLR_InitSky (texture_t *mt)
}
sprintf(name, "%s_trans", mt->name);
strlwr(name);
Q_strlwr(name);
alphaskytexture = Mod_LoadReplacementTexture(name, true, true, true);
if (!alphaskytexture)
alphaskytexture = GL_LoadTexture32(name, 128, 128, trans, true, true);

View file

@ -1,18 +1,6 @@
#include "quakedef.h"
#include "glquake.h"
#ifdef __linux__
void strlwr(char *s)
{
while(*s)
{
if (*s >= 'A' && *s <= 'Z')
*s -= 'A' + 'a';
s++;
}
}
#endif
#ifdef DOOMWADS
vec_t VectorNormalize2 (vec3_t v, vec3_t out);
@ -286,13 +274,13 @@ int Doom_LoadFlat(char *name)
Doom_LoadPalette();
sprintf(texname, "flat-%-.8s", name);
strlwr(texname);
Q_strlwr(texname);
tex = Mod_LoadReplacementTexture(texname, true, false, true);
if (tex)
return tex;
sprintf(texname, "flats/%-.8s", name);
strlwr(texname);
Q_strlwr(texname);
file = COM_LoadMallocFile(texname);
if (file)
{
@ -1136,7 +1124,7 @@ static int Doom_LoadPatchFromTexWad(char *name, void *texlump, unsigned short *w
for (i = 0; i < tx->componantcount; i++, tc++)
{
strncpy(patch+8, pnames+4+8*tc->patchnum, 8);
strlwr(patch+8);
Q_strlwr(patch+8);
patch[16] = '\0';
Doom_ExtractPName(tex, (doomimage_t *)COM_LoadTempFile(patch), tx->width, tx->height, tc->xoffset, tc->yoffset);

View file

@ -255,6 +255,7 @@ extern qboolean gl_mtexable;
void GL_DisableMultitexture(void);
void GL_EnableMultitexture(void);
void GL_SelectTexture (GLenum target);
//
// vid_gl*.c

View file

@ -166,7 +166,7 @@ typedef struct progexterns_s {
} progparms_t, progexterns_t;
void QC_AddSharedVar(progfuncs_t *progfuncs, int start, int size);
void QC_AddSharedFieldVar(progfuncs_t *progfuncs, int num);
#if defined(QCLIBDLL_EXPORTS)
__declspec(dllexport)

View file

@ -1821,7 +1821,7 @@ void SV_WriteEntitiesToClient (client_t *client, sizebuf_t *msg, qboolean ignore
continue;
if (e >= 1024 && !(client->fteprotocolextensions & PEXT_ENTITYDBL2))
continue;
if (dement->modelindex >= 256 && !(client->fteprotocolextensions & PEXT_MODELDBL))
if (/*dement->modelindex >= 256 &&*/ !(client->fteprotocolextensions & PEXT_MODELDBL))
continue;
state = &pack->entities[pack->num_entities];

View file

@ -683,9 +683,9 @@ void SVC_Status (void)
if (slots>12)
Con_Printf ("5013 23 64 94 \"DeathBunny\" \"soldier\" 13 13\n");
if (slots>10)
Con_Printf ("5010 32 85 162 \"€ƒ²¥ÄOÎÅ\" \"hacker\" 13 13\n");
Con_Printf ("5010 32 85 162 \"<EFBFBD><EFBFBD>\" \"hacker\" 13 13\n");
if (slots>8)
Con_Printf ("5011 32 85 162 \"ÁlòeaäùÄEÁÄ\" \"hacker\" 4 4\n");
Con_Printf ("5011 32 85 162 \"<EFBFBD><EFBFBD>a<EFBFBD><EFBFBD><EFBFBD>\" \"hacker\" 4 4\n");
*/
SV_EndRedirect ();
}
@ -3043,6 +3043,10 @@ void SV_InitLocal (void)
svs.fteprotocolextensions |= PEXT_SHOWPIC;
svs.fteprotocolextensions |= PEXT_SETATTACHMENT;
#ifdef PEXT_PK3DOWNLOADS
svs.fteprotocolextensions |= PEXT_PK3DOWNLOADS;
#endif
#ifdef PEXT_CHUNKEDDOWNLOADS
svs.fteprotocolextensions |= PEXT_CHUNKEDDOWNLOADS;
#endif

View file

@ -1663,7 +1663,7 @@ void SV_SendMVDMessage(void)
float min_fps;
extern cvar_t sv_demofps;
extern cvar_t sv_demoPings;
extern cvar_t sv_demoMaxSize;
// extern cvar_t sv_demoMaxSize;
if (!sv.mvdrecording)
return;

View file

@ -563,10 +563,15 @@ void SVQ2_NextServer_f (void)
void SV_PK3List_f (void)
{
#ifndef PEXT_PK3DOWNLOADS
Con_Printf ("pk3list not valid -- It's not implemented!\n");
return;
#else
int crc;
char *name;
int i;
if (host_client->state != cs_connected)
{ //fixme: send prints instead
Con_Printf ("pk3list not valid -- allready spawned\n");
@ -585,7 +590,8 @@ void SV_PK3List_f (void)
//NOTE: This doesn't go through ClientReliableWrite since it's before the user
//spawns. These functions are written to not overflow
if (host_client->num_backbuf) {
if (host_client->num_backbuf)
{
Con_Printf("WARNING %s: [SV_Soundlist] Back buffered (%d), clearing", host_client->name, host_client->netchan.message.cursize);
host_client->num_backbuf = 0;
SZ_Clear(&host_client->netchan.message);
@ -597,7 +603,7 @@ void SV_PK3List_f (void)
return;
}
for (i; ; i++)
for (; ; i++)
{
if (host_client->netchan.message.cursize < (MAX_QWMSGLEN/2))
{ //user's buffer was too small
@ -612,12 +618,14 @@ void SV_PK3List_f (void)
{
MSG_WriteByte(&host_client->netchan.message, svc_stufftext);
MSG_WriteString(&host_client->netchan.message, va("echo packfile %s\n", name));
continue; //okay, that was all we could find.
continue; //try the next.
}
//that's all folks, move on to sound.
MSG_WriteByte(&host_client->netchan.message, svc_stufftext);
MSG_WriteString(&host_client->netchan.message, va("soundlist %i 0\n", svs.spawncount));
return;
}
#endif
}
/*