Fix some stringop-truncation warnings. Enable static freetype in config_fteqw.h. Fix wastes build.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5318 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
49ae9573b8
commit
b68a6218e8
23 changed files with 180 additions and 91 deletions
|
@ -20,7 +20,7 @@ ifeq ($(SVNREVISION),)
|
||||||
endif
|
endif
|
||||||
MAKE:=$(MAKE) SVNREVISION=$(SVNREVISION)
|
MAKE:=$(MAKE) SVNREVISION=$(SVNREVISION)
|
||||||
|
|
||||||
WHOAMI:=$(shell whoami)
|
#WHOAMI:=$(shell whoami)
|
||||||
|
|
||||||
|
|
||||||
#update these to download+build a different version. this assumes that the url+subdirs etc contain a consistant version everywhere.
|
#update these to download+build a different version. this assumes that the url+subdirs etc contain a consistant version everywhere.
|
||||||
|
@ -28,7 +28,7 @@ JPEGVER=9b
|
||||||
ZLIBVER=1.2.11
|
ZLIBVER=1.2.11
|
||||||
PNGVER=1.6.34
|
PNGVER=1.6.34
|
||||||
OGGVER=1.3.3
|
OGGVER=1.3.3
|
||||||
VORBISVER=1.3.5
|
VORBISVER=1.3.6
|
||||||
SDL2VER=2.0.7
|
SDL2VER=2.0.7
|
||||||
SCINTILLAVER=373
|
SCINTILLAVER=373
|
||||||
OPUSVER=1.2.1
|
OPUSVER=1.2.1
|
||||||
|
@ -77,11 +77,14 @@ ifneq (,$(BRANDING))
|
||||||
BRANDFLAGS+=-DBRANDING_INC=../game_$(BRANDING).h
|
BRANDFLAGS+=-DBRANDING_INC=../game_$(BRANDING).h
|
||||||
-include game_$(BRANDING).mak
|
-include game_$(BRANDING).mak
|
||||||
endif
|
endif
|
||||||
ifneq (,$(FTE_CONFIG))
|
FTE_CONFIG?=fteqw
|
||||||
export FTE_CONFIG_EXTRA:=$(shell $(CC) -xc -E -P -DFTE_TARGET_$(FTE_TARGET) -DCOMPILE_OPTS common/config_$(FTE_CONFIG).h)
|
ifneq ($(FTE_TARGET),vc)
|
||||||
BRANDFLAGS+=-DCONFIG_FILE_NAME=config_$(FTE_CONFIG).h $(FTE_CONFIG_EXTRA)
|
ifeq (,$(FTE_CONFIG_EXTRA))
|
||||||
EXE_NAME=$(FTE_CONFIG)
|
export FTE_CONFIG_EXTRA := $(shell $(CC) -xc -E -P -DFTE_TARGET_$(FTE_TARGET) -DCOMPILE_OPTS common/config_$(FTE_CONFIG).h)
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
BRANDFLAGS+=-DCONFIG_FILE_NAME=config_$(FTE_CONFIG).h $(FTE_CONFIG_EXTRA)
|
||||||
|
EXE_NAME=$(FTE_CONFIG)
|
||||||
ifeq (,$(findstring DNO_SPEEX,$(FTE_CONFIG_EXTRA)))
|
ifeq (,$(findstring DNO_SPEEX,$(FTE_CONFIG_EXTRA)))
|
||||||
USE_SPEEX=1
|
USE_SPEEX=1
|
||||||
endif
|
endif
|
||||||
|
@ -856,9 +859,9 @@ endif
|
||||||
|
|
||||||
COMMONLIBFLAGS=
|
COMMONLIBFLAGS=
|
||||||
COMMONLDDEPS=
|
COMMONLDDEPS=
|
||||||
CLIENTLIBFLAGS=$(COMMONLIBFLAGS) $(LIBOPUS_STATIC) $(LIBSPEEX_STATIC) $(OGGVORBISFILE_STATIC) $(LIBFREETYPE_STATIC)
|
CLIENTLIBFLAGS=$(COMMONLIBFLAGS) $(LIBOPUS_STATIC) $(LIBSPEEX_STATIC) $(OGGVORBISFILE_STATIC)
|
||||||
SERVERLIBFLAGS=$(COMMONLIBFLAGS)
|
SERVERLIBFLAGS=$(COMMONLIBFLAGS)
|
||||||
CLIENTLDDEPS=$(COMMONLDDEPS) $(LIBOPUS_LDFLAGS) $(LIBSPEEX_LDFLAGS) $(OGGVORBISLDFLAGS) $(LIBFREETYPE_LDFLAGS)
|
CLIENTLDDEPS=$(COMMONLDDEPS) $(LIBOPUS_LDFLAGS) $(LIBSPEEX_LDFLAGS) $(OGGVORBISLDFLAGS)
|
||||||
SERVERLDDEPS=$(COMMONLDDEPS)
|
SERVERLDDEPS=$(COMMONLDDEPS)
|
||||||
ifeq (1,$(USE_OPUS))
|
ifeq (1,$(USE_OPUS))
|
||||||
LIBOPUS_STATIC=-DOPUS_STATIC
|
LIBOPUS_STATIC=-DOPUS_STATIC
|
||||||
|
@ -877,12 +880,12 @@ else
|
||||||
OGGVORBISFILE_STATIC=
|
OGGVORBISFILE_STATIC=
|
||||||
endif
|
endif
|
||||||
ifeq (1,$(LINK_FREETYPE))
|
ifeq (1,$(LINK_FREETYPE))
|
||||||
LIBFREETYPE_STATIC=-DFREETYPE_STATIC
|
CLIENTLIBFLAGS+=-DFREETYPE_STATIC
|
||||||
LIBFREETYPE_LDFLAGS=-lfreetype
|
CLIENTLDDEPS+=-lfreetype
|
||||||
endif
|
endif
|
||||||
ifeq (1,$(LINK_PNG))
|
ifeq (1,$(LINK_PNG))
|
||||||
LIBFREETYPE_STATIC=-DAVAIL_PNG
|
CLIENTLIBFLAGS+=-DAVAIL_PNG
|
||||||
LIBFREETYPE_LDFLAGS=-lpng
|
CLIENTLDDEPS+=-lpng
|
||||||
endif
|
endif
|
||||||
ifeq (1,$(strip $(INTERNAL_BULLET)))
|
ifeq (1,$(strip $(INTERNAL_BULLET)))
|
||||||
COMMON_OBJS+=com_phys_bullet.o
|
COMMON_OBJS+=com_phys_bullet.o
|
||||||
|
@ -1739,6 +1742,7 @@ $(OUT_DIR)/%.mo $(OUT_DIR)/%.d : %.m
|
||||||
$(OUT_DIR)/quakedef.h.gch : quakedef.h
|
$(OUT_DIR)/quakedef.h.gch : quakedef.h
|
||||||
$(CC) -x c $(ALL_CFLAGS) -o $@ -c $<
|
$(CC) -x c $(ALL_CFLAGS) -o $@ -c $<
|
||||||
PRECOMPHEADERS ?= $(OUT_DIR)/quakedef.h.gch
|
PRECOMPHEADERS ?= $(OUT_DIR)/quakedef.h.gch
|
||||||
|
ALL_CFLAGS+=-I$(OUT_DIR)
|
||||||
|
|
||||||
#addprefix is to add the ./release/server/ part of the object name
|
#addprefix is to add the ./release/server/ part of the object name
|
||||||
#foreach is needed as the OBJS is a list of variable names containing object lists.
|
#foreach is needed as the OBJS is a list of variable names containing object lists.
|
||||||
|
@ -2201,7 +2205,7 @@ libs-$(ARCH)/libspeexdsp.a:
|
||||||
|
|
||||||
libs-$(ARCH)/libfreetype.a:
|
libs-$(ARCH)/libfreetype.a:
|
||||||
test -f freetype-$(FREETYPEVER).tar.gz || wget https://download.savannah.gnu.org/releases/freetype/freetype-$(FREETYPEVER).tar.gz
|
test -f freetype-$(FREETYPEVER).tar.gz || wget https://download.savannah.gnu.org/releases/freetype/freetype-$(FREETYPEVER).tar.gz
|
||||||
-test -f libs-$(ARCH)/libfreetype.a || (mkdir -p libs-$(ARCH) && cd libs-$(ARCH) && tar -xvzf ../freetype-$(FREETYPEVER).tar.gz && cd freetype-$(FREETYPEVER) && CFLAGS="$(CFLAGS) -Os" $(TOOLOVERRIDES) ./configure $(CONFIGARGS) && $(TOOLOVERRIDES) $(MAKE) && cp objs/.libs/libfreetype.a ../ && cp -r include/ ../)
|
-test -f libs-$(ARCH)/libfreetype.a || (mkdir -p libs-$(ARCH) && cd libs-$(ARCH) && tar -xvzf ../freetype-$(FREETYPEVER).tar.gz && cd freetype-$(FREETYPEVER) && CFLAGS="$(CFLAGS) -Os" $(TOOLOVERRIDES) ./configure $(CONFIGARGS) --with-harfbuzz=no && $(TOOLOVERRIDES) $(MAKE) && cp objs/.libs/libfreetype.a ../ && cp -r include/ ../)
|
||||||
|
|
||||||
libs-$(ARCH)/libBulletDynamics.a:
|
libs-$(ARCH)/libBulletDynamics.a:
|
||||||
test -f bullet3-$(BULLETVER).tar.gz || wget https://github.com/bulletphysics/bullet3/archive/$(BULLETVER).tar.gz -O bullet3-$(BULLETVER).tar.gz
|
test -f bullet3-$(BULLETVER).tar.gz || wget https://github.com/bulletphysics/bullet3/archive/$(BULLETVER).tar.gz -O bullet3-$(BULLETVER).tar.gz
|
||||||
|
|
|
@ -342,7 +342,8 @@ void BotQueueConsoleMessage(int chatstate, int type, char *message)
|
||||||
m->handle = cs->handle;
|
m->handle = cs->handle;
|
||||||
m->time = AAS_Time();
|
m->time = AAS_Time();
|
||||||
m->type = type;
|
m->type = type;
|
||||||
strncpy(m->message, message, MAX_MESSAGE_SIZE);
|
strncpy(m->message, message, MAX_MESSAGE_SIZE-1);
|
||||||
|
m->message[MAX_MESSAGE_SIZE-1] = 0;
|
||||||
m->next = NULL;
|
m->next = NULL;
|
||||||
if (cs->lastmessage)
|
if (cs->lastmessage)
|
||||||
{
|
{
|
||||||
|
@ -1458,7 +1459,8 @@ int BotFindMatch(char *str, bot_match_t *match, unsigned long int context)
|
||||||
int i;
|
int i;
|
||||||
bot_matchtemplate_t *ms;
|
bot_matchtemplate_t *ms;
|
||||||
|
|
||||||
strncpy(match->string, str, MAX_MESSAGE_SIZE);
|
strncpy(match->string, str, MAX_MESSAGE_SIZE-1);
|
||||||
|
match->string[MAX_MESSAGE_SIZE-1] = 0;
|
||||||
//remove any trailing enters
|
//remove any trailing enters
|
||||||
while(strlen(match->string) &&
|
while(strlen(match->string) &&
|
||||||
match->string[strlen(match->string)-1] == '\n')
|
match->string[strlen(match->string)-1] == '\n')
|
||||||
|
@ -2117,7 +2119,8 @@ bot_chat_t *BotLoadInitialChat(char *chatfile, char *chatname)
|
||||||
if (pass)
|
if (pass)
|
||||||
{
|
{
|
||||||
chattype = (bot_chattype_t *) ptr;
|
chattype = (bot_chattype_t *) ptr;
|
||||||
strncpy(chattype->name, token.string, MAX_CHATTYPE_NAME);
|
strncpy(chattype->name, token.string, MAX_CHATTYPE_NAME-1);
|
||||||
|
chattype->name[MAX_CHATTYPE_NAME-1] = 0;
|
||||||
chattype->firstchatmessage = NULL;
|
chattype->firstchatmessage = NULL;
|
||||||
//add the chat type to the chat
|
//add the chat type to the chat
|
||||||
chattype->next = chat->types;
|
chattype->next = chat->types;
|
||||||
|
|
|
@ -283,7 +283,8 @@ itemconfig_t *LoadItemConfig(char *filename)
|
||||||
LibVarSet( "max_iteminfo", "256" );
|
LibVarSet( "max_iteminfo", "256" );
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy( path, filename, MAX_PATH );
|
strncpy( path, filename, MAX_PATH-1 );
|
||||||
|
path[MAX_PATH-1] = 0;
|
||||||
PC_SetBaseFolder(BOTFILESBASEFOLDER);
|
PC_SetBaseFolder(BOTFILESBASEFOLDER);
|
||||||
source = LoadSourceFile( path );
|
source = LoadSourceFile( path );
|
||||||
if( !source ) {
|
if( !source ) {
|
||||||
|
@ -316,7 +317,14 @@ itemconfig_t *LoadItemConfig(char *filename)
|
||||||
return NULL;
|
return NULL;
|
||||||
} //end if
|
} //end if
|
||||||
StripDoubleQuotes(token.string);
|
StripDoubleQuotes(token.string);
|
||||||
strncpy(ii->classname, token.string, sizeof(ii->classname)-1);
|
if (strlen(token.string) >= sizeof(ii->classname))
|
||||||
|
{
|
||||||
|
SourceError(source, "more than %d chars\n", sizeof(ii->classname)-1);
|
||||||
|
FreeMemory(ic);
|
||||||
|
FreeSource(source);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
strcpy(ii->classname, token.string);
|
||||||
if (!ReadStructure(source, &iteminfo_struct, (char *) ii))
|
if (!ReadStructure(source, &iteminfo_struct, (char *) ii))
|
||||||
{
|
{
|
||||||
FreeMemory(ic);
|
FreeMemory(ic);
|
||||||
|
@ -688,8 +696,11 @@ void BotGoalName(int number, char *name, int size)
|
||||||
{
|
{
|
||||||
if (li->number == number)
|
if (li->number == number)
|
||||||
{
|
{
|
||||||
strncpy(name, itemconfig->iteminfo[li->iteminfo].name, size-1);
|
size_t r = strlen(itemconfig->iteminfo[li->iteminfo].name);
|
||||||
name[size-1] = '\0';
|
if (r > size-1)
|
||||||
|
r = size-1; //truncate...
|
||||||
|
memcpy(name, itemconfig->iteminfo[li->iteminfo].name, r);
|
||||||
|
name[r] = '\0';
|
||||||
return;
|
return;
|
||||||
} //end for
|
} //end for
|
||||||
} //end for
|
} //end for
|
||||||
|
|
|
@ -219,7 +219,8 @@ weaponconfig_t *LoadWeaponConfig(char *filename)
|
||||||
max_projectileinfo = 32;
|
max_projectileinfo = 32;
|
||||||
LibVarSet("max_projectileinfo", "32");
|
LibVarSet("max_projectileinfo", "32");
|
||||||
} //end if
|
} //end if
|
||||||
strncpy(path, filename, MAX_PATH);
|
strncpy(path, filename, sizeof(path)-1);
|
||||||
|
path[sizeof(path)-1] = 0;
|
||||||
PC_SetBaseFolder(BOTFILESBASEFOLDER);
|
PC_SetBaseFolder(BOTFILESBASEFOLDER);
|
||||||
source = LoadSourceFile(path);
|
source = LoadSourceFile(path);
|
||||||
if (!source)
|
if (!source)
|
||||||
|
|
|
@ -75,7 +75,8 @@ void Log_Open(char *filename)
|
||||||
botimport.Print(PRT_ERROR, "can't open the log file %s\n", filename);
|
botimport.Print(PRT_ERROR, "can't open the log file %s\n", filename);
|
||||||
return;
|
return;
|
||||||
} //end if
|
} //end if
|
||||||
strncpy(logfile.filename, filename, MAX_LOGFILENAMESIZE);
|
strncpy(logfile.filename, filename, MAX_LOGFILENAMESIZE-1);
|
||||||
|
logfile.filename[MAX_LOGFILENAMESIZE-1] = 0;
|
||||||
botimport.Print(PRT_MESSAGE, "Opened log %s\n", logfile.filename);
|
botimport.Print(PRT_MESSAGE, "Opened log %s\n", logfile.filename);
|
||||||
} //end of the function Log_Create
|
} //end of the function Log_Create
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
|
@ -466,6 +466,7 @@ int PC_ReadDefineParms(source_t *source, define_t *define, token_t **parms, int
|
||||||
//============================================================================
|
//============================================================================
|
||||||
int PC_StringizeTokens(token_t *tokens, token_t *token)
|
int PC_StringizeTokens(token_t *tokens, token_t *token)
|
||||||
{
|
{
|
||||||
|
int ret = qtrue;
|
||||||
token_t *t;
|
token_t *t;
|
||||||
|
|
||||||
token->type = TT_STRING;
|
token->type = TT_STRING;
|
||||||
|
@ -475,10 +476,15 @@ int PC_StringizeTokens(token_t *tokens, token_t *token)
|
||||||
strcat(token->string, "\"");
|
strcat(token->string, "\"");
|
||||||
for (t = tokens; t; t = t->next)
|
for (t = tokens; t; t = t->next)
|
||||||
{
|
{
|
||||||
strncat(token->string, t->string, MAX_TOKEN - strlen(token->string) - 1);
|
if (strlen(token->string)+strlen(t->string) >= MAX_TOKEN-1)
|
||||||
|
{
|
||||||
|
ret = qfalse;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
strcat(token->string, t->string);
|
||||||
} //end for
|
} //end for
|
||||||
strncat(token->string, "\"", MAX_TOKEN - strlen(token->string) - 1);
|
strncat(token->string, "\"", MAX_TOKEN - strlen(token->string) - 1);
|
||||||
return qtrue;
|
return ret;
|
||||||
} //end of the function PC_StringizeTokens
|
} //end of the function PC_StringizeTokens
|
||||||
//============================================================================
|
//============================================================================
|
||||||
//
|
//
|
||||||
|
@ -1018,7 +1024,10 @@ int PC_Directive_include(source_t *source)
|
||||||
break;
|
break;
|
||||||
} //end if
|
} //end if
|
||||||
if (token.type == TT_PUNCTUATION && *token.string == '>') break;
|
if (token.type == TT_PUNCTUATION && *token.string == '>') break;
|
||||||
strncat(path, token.string, MAX_PATH - 1);
|
if (strlen(path) + strlen(token.string) >= MAX_PATH)
|
||||||
|
SourceWarning(source, "#include truncation");
|
||||||
|
else
|
||||||
|
strcat(path, token.string);
|
||||||
} //end while
|
} //end while
|
||||||
if (*token.string != '>')
|
if (*token.string != '>')
|
||||||
{
|
{
|
||||||
|
|
|
@ -216,15 +216,21 @@ qboolean ReadChar(source_t *source, fielddef_t *fd, void *p)
|
||||||
int ReadString(source_t *source, fielddef_t *fd, void *p)
|
int ReadString(source_t *source, fielddef_t *fd, void *p)
|
||||||
{
|
{
|
||||||
token_t token;
|
token_t token;
|
||||||
|
size_t s;
|
||||||
|
|
||||||
if (!PC_ExpectTokenType(source, TT_STRING, 0, &token)) return 0;
|
if (!PC_ExpectTokenType(source, TT_STRING, 0, &token)) return 0;
|
||||||
//remove the double quotes
|
//remove the double quotes
|
||||||
StripDoubleQuotes(token.string);
|
StripDoubleQuotes(token.string);
|
||||||
//copy the string
|
//copy the string
|
||||||
strncpy((char *) p, token.string, MAX_STRINGFIELD);
|
s = strlen(token.string);
|
||||||
//make sure the string is closed with a zero
|
if (s >= MAX_STRINGFIELD)
|
||||||
((char *)p)[MAX_STRINGFIELD-1] = '\0';
|
{
|
||||||
//
|
s = MAX_STRINGFIELD-1;
|
||||||
|
memcpy(p, token.string, s);
|
||||||
|
((char*)p)[s] = 0;
|
||||||
|
return 0; //truncated
|
||||||
|
}
|
||||||
|
strcpy((char*)p, token.string);
|
||||||
return 1;
|
return 1;
|
||||||
} //end of the function ReadString
|
} //end of the function ReadString
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
|
@ -587,7 +587,7 @@ cvar_t cl_pitchspeed = CVAR("cl_pitchspeed","150");
|
||||||
cvar_t cl_anglespeedkey = CVAR("cl_anglespeedkey","1.5");
|
cvar_t cl_anglespeedkey = CVAR("cl_anglespeedkey","1.5");
|
||||||
|
|
||||||
|
|
||||||
#define GATHERBIT(bname,bit) if (bname.state[pnum] & 3) {bits |= (1u<<bit);} bname.state[pnum] &= ~2;
|
#define GATHERBIT(bname,bit) if (bname.state[pnum] & 3) {bits |= (1u<<(bit));} bname.state[pnum] &= ~2;
|
||||||
void CL_GatherButtons (usercmd_t *cmd, int pnum)
|
void CL_GatherButtons (usercmd_t *cmd, int pnum)
|
||||||
{
|
{
|
||||||
unsigned int bits = 0;
|
unsigned int bits = 0;
|
||||||
|
|
|
@ -37,6 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include "pr_common.h"
|
#include "pr_common.h"
|
||||||
|
|
||||||
extern usercmd_t cl_pendingcmd[MAX_SPLITS];
|
extern usercmd_t cl_pendingcmd[MAX_SPLITS];
|
||||||
|
extern cvar_t sv_demo_write_csqc;
|
||||||
|
|
||||||
|
|
||||||
static pubprogfuncs_t *csqcprogs;
|
static pubprogfuncs_t *csqcprogs;
|
||||||
|
@ -6886,7 +6887,9 @@ static void PDECL CSQC_EntSpawn (struct edict_s *e, int loading)
|
||||||
ent->xv->dimension_solid = *csqcg.dimension_default;
|
ent->xv->dimension_solid = *csqcg.dimension_default;
|
||||||
ent->xv->dimension_hit = *csqcg.dimension_default;
|
ent->xv->dimension_hit = *csqcg.dimension_default;
|
||||||
|
|
||||||
|
#ifdef HEXEN2
|
||||||
ent->xv->drawflags = SCALE_ORIGIN_ORIGIN;
|
ent->xv->drawflags = SCALE_ORIGIN_ORIGIN;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7071,7 +7074,6 @@ static qboolean CSQC_ValidateMainCSProgs(void *file, size_t filesize, unsigned i
|
||||||
static void *CSQC_FindMainProgs(size_t *sz, const char *name, unsigned int checksum, size_t checksize)
|
static void *CSQC_FindMainProgs(size_t *sz, const char *name, unsigned int checksum, size_t checksize)
|
||||||
{ //returns a TempFile
|
{ //returns a TempFile
|
||||||
char newname[MAX_QPATH];
|
char newname[MAX_QPATH];
|
||||||
extern cvar_t sv_demo_write_csqc;
|
|
||||||
void *file = NULL;
|
void *file = NULL;
|
||||||
|
|
||||||
//the filename we'll cache to
|
//the filename we'll cache to
|
||||||
|
|
|
@ -2075,7 +2075,7 @@ void QCBUILTIN PF_skel_build_ptr(pubprogfuncs_t *prinst, struct globalvars_s *pr
|
||||||
lastbone = firstbone;
|
lastbone = firstbone;
|
||||||
|
|
||||||
fstate.g[FS_REG].endbone = 0x7fffffff;
|
fstate.g[FS_REG].endbone = 0x7fffffff;
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < FRAME_BLENDS; i++)
|
||||||
{
|
{
|
||||||
fstate.g[FS_REG].frame[i] = blends->animation[i];
|
fstate.g[FS_REG].frame[i] = blends->animation[i];
|
||||||
fstate.g[FS_REG].frametime[i] = blends->animationtime[i];
|
fstate.g[FS_REG].frametime[i] = blends->animationtime[i];
|
||||||
|
|
|
@ -1884,7 +1884,7 @@ void Sys_Clipboard_PasteText(clipboardtype_t cbt, void (*callback)(void *cb, cha
|
||||||
free(cliputf8);
|
free(cliputf8);
|
||||||
GlobalUnlock(clipboardhandle);
|
GlobalUnlock(clipboardhandle);
|
||||||
CloseClipboard();
|
CloseClipboard();
|
||||||
return cliputf8;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//failed at the last hurdle
|
//failed at the last hurdle
|
||||||
|
|
|
@ -2527,6 +2527,7 @@ static void Mod_ClampModelSize(model_t *mod)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef NONSKELETALMODELS
|
||||||
#ifndef SERVERONLY
|
#ifndef SERVERONLY
|
||||||
static int R_FindTriangleWithEdge (index_t *indexes, int numtris, int start, int end, int ignore)
|
static int R_FindTriangleWithEdge (index_t *indexes, int numtris, int start, int end, int ignore)
|
||||||
{
|
{
|
||||||
|
@ -2581,6 +2582,7 @@ static void Mod_CompileTriangleNeighbours(model_t *loadmodel, galiasinfo_t *gali
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|
|
@ -4788,14 +4788,19 @@ COM_Version_f
|
||||||
*/
|
*/
|
||||||
static void COM_Version_f (void)
|
static void COM_Version_f (void)
|
||||||
{
|
{
|
||||||
|
Con_Printf("\n");
|
||||||
|
Con_Printf("^&F0%s\n", FULLENGINENAME);
|
||||||
|
Con_Printf("%s\n", ENGINEWEBSITE);
|
||||||
Con_Printf("%s\n", version_string());
|
Con_Printf("%s\n", version_string());
|
||||||
|
|
||||||
Con_TPrintf ("Exe: %s %s\n", __DATE__, __TIME__);
|
Con_TPrintf ("Exe: %s %s\n", __DATE__, __TIME__);
|
||||||
|
|
||||||
#ifdef SVNREVISION
|
#ifdef SVNREVISION
|
||||||
if (strcmp(STRINGIFY(SVNREVISION), "-"))
|
if (strcmp(STRINGIFY(SVNREVISION), "-"))
|
||||||
Con_Printf("SVN Revision: %s\n",STRINGIFY(SVNREVISION));
|
Con_Printf("SVN Revision: %s\n",STRINGIFY(SVNREVISION));
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef CONFIG_FILE_NAME
|
||||||
|
Con_Printf("Build config: %s\n\n", STRINGIFY(CONFIG_FILE_NAME));
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
Con_Printf("debug build\n");
|
Con_Printf("debug build\n");
|
||||||
|
@ -4977,11 +4982,13 @@ static void COM_Version_f (void)
|
||||||
#else
|
#else
|
||||||
#ifdef SPEEX_STATIC
|
#ifdef SPEEX_STATIC
|
||||||
Con_Printf(" speex");
|
Con_Printf(" speex");
|
||||||
|
Con_DPrintf("(static)");
|
||||||
#else
|
#else
|
||||||
Con_Printf(" speex(dynamic)");
|
Con_Printf(" speex(dynamic)");
|
||||||
#endif
|
#endif
|
||||||
#ifdef OPUS_STATIC
|
#ifdef OPUS_STATIC
|
||||||
Con_Printf(" opus");
|
Con_Printf(" opus");
|
||||||
|
Con_DPrintf("(static)");
|
||||||
#else
|
#else
|
||||||
Con_Printf(" opus(dynamic)");
|
Con_Printf(" opus(dynamic)");
|
||||||
#endif
|
#endif
|
||||||
|
@ -5019,18 +5026,23 @@ static void COM_Version_f (void)
|
||||||
|
|
||||||
Con_Printf("Misc:");
|
Con_Printf("Misc:");
|
||||||
#ifdef SUBSERVERS
|
#ifdef SUBSERVERS
|
||||||
Con_Printf(" mapcluster(enabled)");
|
Con_Printf(" mapcluster");
|
||||||
#else
|
#else
|
||||||
Con_DPrintf(" ^h(disabled: mapcluster)^7");
|
Con_DPrintf(" ^h(disabled: mapcluster)^7");
|
||||||
#endif
|
#endif
|
||||||
#ifndef SERVERONLY
|
#ifndef SERVERONLY
|
||||||
#ifdef AVAIL_FREETYPE
|
#ifdef AVAIL_FREETYPE
|
||||||
Con_Printf(" freetype2");
|
#ifdef FREETYPE_STATIC
|
||||||
|
Con_Printf(" freetype2");
|
||||||
|
Con_DPrintf("(static)");
|
||||||
|
#else
|
||||||
|
Con_Printf(" freetype2(dynamic)");
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
Con_DPrintf(" ^h(disabled: freetype2)^7");
|
Con_DPrintf(" ^h(disabled: freetype2)^7");
|
||||||
#endif
|
#endif
|
||||||
#ifdef AVAIL_OPENAL
|
#ifdef AVAIL_OPENAL
|
||||||
Con_Printf(" openal");
|
Con_Printf(" openal(dynamic)");
|
||||||
#else
|
#else
|
||||||
Con_DPrintf(" ^h(disabled: openal)^7");
|
Con_DPrintf(" ^h(disabled: openal)^7");
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -180,5 +180,9 @@
|
||||||
#endif
|
#endif
|
||||||
//-DNO_VORBISFILE //disable static vorbisfile
|
//-DNO_VORBISFILE //disable static vorbisfile
|
||||||
|
|
||||||
|
|
||||||
|
//enable some staticaly linked libraries
|
||||||
|
-DLINK_FREETYPE //international text requires international fonts.
|
||||||
|
|
||||||
//-Os //optimise for size instead of speed. less cpu cache needed means that its sometimes faster anyway.
|
//-Os //optimise for size instead of speed. less cpu cache needed means that its sometimes faster anyway.
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -35,12 +35,18 @@ extern char **myargv;
|
||||||
int QCC_filelength (int handle);
|
int QCC_filelength (int handle);
|
||||||
int QCC_tell (int handle);
|
int QCC_tell (int handle);
|
||||||
|
|
||||||
|
#if 0//def __GNUC__
|
||||||
|
#define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
|
||||||
|
#else
|
||||||
|
#define WARN_UNUSED_RESULT
|
||||||
|
#endif
|
||||||
|
|
||||||
int QC_strcasecmp (const char *s1, const char *s2);
|
int QC_strcasecmp (const char *s1, const char *s2);
|
||||||
int QC_strncasecmp(const char *s1, const char *s2, int n);
|
int QC_strncasecmp(const char *s1, const char *s2, int n);
|
||||||
|
|
||||||
void QC_strlcat(char *dest, const char *src, size_t destsize);
|
pbool QC_strlcat(char *dest, const char *src, size_t destsize) WARN_UNUSED_RESULT;
|
||||||
void QC_strlcpy(char *dest, const char *src, size_t destsize);
|
pbool QC_strlcpy(char *dest, const char *src, size_t destsize) WARN_UNUSED_RESULT;
|
||||||
void QC_strnlcpy(char *dest, const char *src, size_t srclen, size_t destsize);
|
pbool QC_strnlcpy(char *dest, const char *src, size_t srclen, size_t destsize) WARN_UNUSED_RESULT;
|
||||||
char *QC_strcasestr(const char *haystack, const char *needle);
|
char *QC_strcasestr(const char *haystack, const char *needle);
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
|
|
@ -143,39 +143,36 @@ void SetEndian(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void QC_strlcat(char *dest, const char *src, size_t destsize)
|
pbool QC_strlcat(char *dest, const char *src, size_t destsize)
|
||||||
{
|
{
|
||||||
size_t curlen = strlen(dest);
|
size_t curlen = strlen(dest);
|
||||||
if (!destsize)
|
if (!destsize)
|
||||||
return; //err
|
return false; //err
|
||||||
dest += curlen;
|
dest += curlen;
|
||||||
while(*src && ++curlen < destsize)
|
while(*src && ++curlen < destsize)
|
||||||
*dest++ = *src++;
|
*dest++ = *src++;
|
||||||
// if (*src)
|
|
||||||
// printf("QC_strlcpy: truncation\n");
|
|
||||||
*dest = 0;
|
*dest = 0;
|
||||||
|
return !*src;
|
||||||
}
|
}
|
||||||
void QC_strlcpy(char *dest, const char *src, size_t destsize)
|
pbool QC_strlcpy(char *dest, const char *src, size_t destsize)
|
||||||
{
|
{
|
||||||
size_t curlen = 0;
|
size_t curlen = 0;
|
||||||
if (!destsize)
|
if (!destsize)
|
||||||
return; //err
|
return false; //err
|
||||||
while(*src && ++curlen < destsize)
|
while(*src && ++curlen < destsize)
|
||||||
*dest++ = *src++;
|
*dest++ = *src++;
|
||||||
// if (*src)
|
|
||||||
// printf("QC_strlcpy: truncation\n");
|
|
||||||
*dest = 0;
|
*dest = 0;
|
||||||
|
return !*src;
|
||||||
}
|
}
|
||||||
void QC_strnlcpy(char *dest, const char *src, size_t srclen, size_t destsize)
|
pbool QC_strnlcpy(char *dest, const char *src, size_t srclen, size_t destsize)
|
||||||
{
|
{
|
||||||
size_t curlen = 0;
|
size_t curlen = 0;
|
||||||
if (!destsize)
|
if (!destsize)
|
||||||
return; //err
|
return false; //err
|
||||||
for(; *src && srclen > 0 && ++curlen < destsize; srclen--)
|
for(; *src && srclen > 0 && ++curlen < destsize; srclen--)
|
||||||
*dest++ = *src++;
|
*dest++ = *src++;
|
||||||
// if (srclen)
|
|
||||||
// printf("QC_strlcpy: truncation\n");
|
|
||||||
*dest = 0;
|
*dest = 0;
|
||||||
|
return !srclen;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *QC_strcasestr(const char *haystack, const char *needle)
|
char *QC_strcasestr(const char *haystack, const char *needle)
|
||||||
|
|
|
@ -286,10 +286,11 @@ int *pr_cases;
|
||||||
QCC_ref_t *pr_casesref;
|
QCC_ref_t *pr_casesref;
|
||||||
QCC_ref_t *pr_casesref2;
|
QCC_ref_t *pr_casesref2;
|
||||||
|
|
||||||
|
#define MAX_LABEL_LENGTH 256
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int statementno;
|
int statementno;
|
||||||
int lineno;
|
int lineno;
|
||||||
char name[256];
|
char name[MAX_LABEL_LENGTH];
|
||||||
} gotooperator_t;
|
} gotooperator_t;
|
||||||
|
|
||||||
int max_labels;
|
int max_labels;
|
||||||
|
@ -793,6 +794,7 @@ static pbool OpAssignsToB(unsigned int op)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#define OpAssignsToA(op) false
|
#define OpAssignsToA(op) false
|
||||||
|
#ifdef _DEBUG
|
||||||
static int OpAssignsCount(unsigned int op)
|
static int OpAssignsCount(unsigned int op)
|
||||||
{
|
{
|
||||||
switch(op)
|
switch(op)
|
||||||
|
@ -855,7 +857,6 @@ static int OpAssignsCount(unsigned int op)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef _DEBUG
|
|
||||||
static void OpAssignsTo_Debug(void)
|
static void OpAssignsTo_Debug(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -10173,7 +10174,8 @@ static void QCC_PR_GotoStatement (QCC_statement_t *patch2, char *labelname)
|
||||||
pr_gotos = realloc(pr_gotos, sizeof(*pr_gotos)*max_gotos);
|
pr_gotos = realloc(pr_gotos, sizeof(*pr_gotos)*max_gotos);
|
||||||
}
|
}
|
||||||
|
|
||||||
strncpy(pr_gotos[num_gotos].name, labelname, sizeof(pr_gotos[num_gotos].name) -1);
|
if (!QC_strlcpy(pr_gotos[num_gotos].name, labelname, sizeof(pr_gotos[num_gotos].name)))
|
||||||
|
QCC_PR_ParseWarning(WARN_STRINGTOOLONG, "Label name too long");
|
||||||
pr_gotos[num_gotos].lineno = pr_source_line;
|
pr_gotos[num_gotos].lineno = pr_source_line;
|
||||||
pr_gotos[num_gotos].statementno = patch2 - statements;
|
pr_gotos[num_gotos].statementno = patch2 - statements;
|
||||||
|
|
||||||
|
|
|
@ -128,10 +128,16 @@ void QCC_PR_AddIncludePath(const char *newinc)
|
||||||
{
|
{
|
||||||
if (!*qccincludedir[i])
|
if (!*qccincludedir[i])
|
||||||
{
|
{
|
||||||
|
pbool trunc;
|
||||||
const char *e = newinc + strlen(newinc)-1;
|
const char *e = newinc + strlen(newinc)-1;
|
||||||
QC_strlcpy(qccincludedir[i], newinc, sizeof(qccincludedir));
|
trunc = !QC_strlcpy(qccincludedir[i], newinc, sizeof(qccincludedir));
|
||||||
if (*e != '/' && *e != '\\')
|
if (*e != '/' && *e != '\\')
|
||||||
QC_strlcat(qccincludedir[i], "/", sizeof(qccincludedir));
|
trunc |= !QC_strlcat(qccincludedir[i], "/", sizeof(qccincludedir));
|
||||||
|
if (trunc)
|
||||||
|
{
|
||||||
|
QCC_PR_ParseWarning(WARN_STRINGTOOLONG, "Include path too long.");
|
||||||
|
*qccincludedir[i] = 0;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!strcmp(qccincludedir[i], newinc))
|
if (!strcmp(qccincludedir[i], newinc))
|
||||||
|
@ -469,24 +475,25 @@ static void QCC_PR_GetDefinesListEnumerate(void *vctx, void *data)
|
||||||
CompilerConstant_t *def = data;
|
CompilerConstant_t *def = data;
|
||||||
char term[8192];
|
char term[8192];
|
||||||
size_t termsize;
|
size_t termsize;
|
||||||
|
pbool success = true;
|
||||||
|
|
||||||
QC_snprintfz(term, sizeof(term), "\n%s", def->name);
|
QC_snprintfz(term, sizeof(term), "\n%s", def->name);
|
||||||
if (def->numparams >= 0)
|
if (def->numparams >= 0)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
QC_strlcat(term, "(", sizeof(term));
|
success &= QC_strlcat(term, "(", sizeof(term));
|
||||||
for (i = 0; i < def->numparams; i++)
|
for (i = 0; i < def->numparams; i++)
|
||||||
{
|
{
|
||||||
if (i)
|
if (i)
|
||||||
QC_strlcat(term, ",", sizeof(term));
|
success &= QC_strlcat(term, ",", sizeof(term));
|
||||||
QC_strlcat(term, def->params[i], sizeof(term));
|
success &= QC_strlcat(term, def->params[i], sizeof(term));
|
||||||
}
|
}
|
||||||
QC_strlcat(term, ")", sizeof(term));
|
success &= QC_strlcat(term, ")", sizeof(term));
|
||||||
}
|
}
|
||||||
if (def->value && *def->value)
|
if (def->value && *def->value)
|
||||||
{
|
{
|
||||||
char *o, *i;
|
char *o, *i;
|
||||||
QC_strlcat(term, "=", sizeof(term));
|
success &= QC_strlcat(term, "=", sizeof(term));
|
||||||
|
|
||||||
//annoying logic to skip whitespace... hopefully it won't fuck stuff up too much.
|
//annoying logic to skip whitespace... hopefully it won't fuck stuff up too much.
|
||||||
for (o = term+strlen(term), i = def->value; o < term + sizeof(term)-1 && *i; )
|
for (o = term+strlen(term), i = def->value; o < term + sizeof(term)-1 && *i; )
|
||||||
|
@ -498,6 +505,8 @@ static void QCC_PR_GetDefinesListEnumerate(void *vctx, void *data)
|
||||||
}
|
}
|
||||||
*o = 0;
|
*o = 0;
|
||||||
}
|
}
|
||||||
|
if (!success) //this define was too long. don't show truncated stuff.
|
||||||
|
return;
|
||||||
|
|
||||||
termsize = strlen(term);
|
termsize = strlen(term);
|
||||||
if (ctx->length + termsize+1 > ctx->buffersize)
|
if (ctx->length + termsize+1 > ctx->buffersize)
|
||||||
|
@ -1126,9 +1135,8 @@ static pbool QCC_PR_Precompiler(void)
|
||||||
memmove(msg, msg+1, e-(msg+1));
|
memmove(msg, msg+1, e-(msg+1));
|
||||||
msg[e-(msg+1)] = 0;
|
msg[e-(msg+1)] = 0;
|
||||||
}
|
}
|
||||||
if (strlen(msg) >= sizeof(QCC_copyright))
|
if (!QC_strlcpy(QCC_copyright, msg, sizeof(QCC_copyright)))
|
||||||
QCC_PR_ParseWarning(WARN_STRINGTOOLONG, "Copyright message is too long\n");
|
QCC_PR_ParseWarning(WARN_STRINGTOOLONG, "Copyright message is too long\n");
|
||||||
QC_strlcpy(QCC_copyright, msg, sizeof(QCC_copyright)-1);
|
|
||||||
}
|
}
|
||||||
else if (!QC_strcasecmp(qcc_token, "compress"))
|
else if (!QC_strcasecmp(qcc_token, "compress"))
|
||||||
{
|
{
|
||||||
|
@ -2806,7 +2814,8 @@ static void QCC_PR_LexGrab (void)
|
||||||
if (*pr_framemodelname)
|
if (*pr_framemodelname)
|
||||||
QCC_PR_MacroFrame(pr_framemodelname, pr_macrovalue, true);
|
QCC_PR_MacroFrame(pr_framemodelname, pr_macrovalue, true);
|
||||||
|
|
||||||
QC_strlcpy(pr_framemodelname, pr_token, sizeof(pr_framemodelname));
|
if (!QC_strlcpy(pr_framemodelname, pr_token, sizeof(pr_framemodelname)))
|
||||||
|
QCC_PR_ParseWarning (WARN_STRINGTOOLONG, "$modelname name too long");
|
||||||
|
|
||||||
i = QCC_PR_FindMacro(pr_framemodelname);
|
i = QCC_PR_FindMacro(pr_framemodelname);
|
||||||
if (i)
|
if (i)
|
||||||
|
@ -3574,7 +3583,8 @@ int QCC_PR_CheckCompConst(void)
|
||||||
|| *end == '#')
|
|| *end == '#')
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
QC_strnlcpy(pr_token, pr_file_p, end-pr_file_p, sizeof(pr_token));
|
if (!QC_strnlcpy(pr_token, pr_file_p, end-pr_file_p, sizeof(pr_token)))
|
||||||
|
return false; //name too long to be a valid macro
|
||||||
|
|
||||||
// externs->Printf("%s\n", pr_token);
|
// externs->Printf("%s\n", pr_token);
|
||||||
c = pHash_Get(&compconstantstable, pr_token);
|
c = pHash_Get(&compconstantstable, pr_token);
|
||||||
|
|
|
@ -4567,11 +4567,12 @@ static int QCC_FindQCFiles(const char *sourcedir)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void QCC_GenerateRelativePath(char *dest, size_t destsize, char *base, char *relative)
|
static pbool QCC_GenerateRelativePath(char *dest, size_t destsize, char *base, char *relative)
|
||||||
{
|
{
|
||||||
int p;
|
int p;
|
||||||
char *s1, *s2;
|
char *s1, *s2;
|
||||||
QC_strlcpy (dest, base, destsize);
|
if (!QC_strlcpy (dest, base, destsize))
|
||||||
|
return false;
|
||||||
s1 = strchr(dest, '\\');
|
s1 = strchr(dest, '\\');
|
||||||
s2 = strchr(dest, '/');
|
s2 = strchr(dest, '/');
|
||||||
if (s2 > s1)
|
if (s2 > s1)
|
||||||
|
@ -4607,22 +4608,27 @@ static void QCC_GenerateRelativePath(char *dest, size_t destsize, char *base, ch
|
||||||
{
|
{
|
||||||
if (p)
|
if (p)
|
||||||
{ //we were still looking for a separator, but didn't find one, so kill the entire path.
|
{ //we were still looking for a separator, but didn't find one, so kill the entire path.
|
||||||
QC_strlcpy(dest, "", destsize);
|
(void)QC_strlcpy(dest, "", destsize);
|
||||||
p--;
|
p--;
|
||||||
}
|
}
|
||||||
else
|
else if (!QC_strlcat(dest, "/", destsize))
|
||||||
QC_strlcat(dest, "/", destsize);
|
return false;
|
||||||
}
|
}
|
||||||
QC_strlcat(dest, s2, destsize);
|
if (!QC_strlcat(dest, s2, destsize))
|
||||||
|
return false;
|
||||||
|
|
||||||
while (p>0 && strlen(dest)+3 < destsize)
|
while (p>0)
|
||||||
{
|
{
|
||||||
|
if (strlen(dest)+3 >= destsize)
|
||||||
|
return false;
|
||||||
memmove(dest+3, dest, strlen(dest)+1);
|
memmove(dest+3, dest, strlen(dest)+1);
|
||||||
dest[0] = '.';
|
dest[0] = '.';
|
||||||
dest[1] = '.';
|
dest[1] = '.';
|
||||||
dest[2] = '/';
|
dest[2] = '/';
|
||||||
p--;
|
p--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *qcccol[COL_MAX];
|
const char *qcccol[COL_MAX];
|
||||||
|
@ -4769,7 +4775,7 @@ pbool QCC_main (int argc, char **argv) //as part of the quake engine
|
||||||
|
|
||||||
time(&long_time);
|
time(&long_time);
|
||||||
strftime(QCC_copyright, sizeof(QCC_copyright), "Compiled [%Y/%m/%d]. ", localtime( &long_time ));
|
strftime(QCC_copyright, sizeof(QCC_copyright), "Compiled [%Y/%m/%d]. ", localtime( &long_time ));
|
||||||
QC_strlcat(QCC_copyright, QCC_VersionString(), sizeof(QCC_copyright));
|
(void)QC_strlcat(QCC_copyright, QCC_VersionString(), sizeof(QCC_copyright));
|
||||||
for (p = 0; p < 5; p++)
|
for (p = 0; p < 5; p++)
|
||||||
strcpy(QCC_Packname[p], "");
|
strcpy(QCC_Packname[p], "");
|
||||||
|
|
||||||
|
@ -4913,7 +4919,7 @@ memset(pr_immediate_string, 0, sizeof(pr_immediate_string));
|
||||||
|
|
||||||
qccmsrc = NULL;
|
qccmsrc = NULL;
|
||||||
if (!numsourcefiles)
|
if (!numsourcefiles)
|
||||||
{
|
{ //generate an internal .src file from the argument list
|
||||||
int i;
|
int i;
|
||||||
for (i = 1;i<myargc;i++)
|
for (i = 1;i<myargc;i++)
|
||||||
{
|
{
|
||||||
|
@ -4923,10 +4929,10 @@ memset(pr_immediate_string, 0, sizeof(pr_immediate_string));
|
||||||
if (!qccmsrc)
|
if (!qccmsrc)
|
||||||
{
|
{
|
||||||
qccmsrc = qccHunkAlloc(8192);
|
qccmsrc = qccHunkAlloc(8192);
|
||||||
QC_strlcpy(qccmsrc, "progs.dat\n", 8192);
|
(void)QC_strlcpy(qccmsrc, "progs.dat\n", 8192);
|
||||||
}
|
}
|
||||||
QC_strlcat(qccmsrc, myargv[i], 8192);
|
if (!QC_strlcat(qccmsrc, myargv[i], 8192) || !QC_strlcat(qccmsrc, "\n", 8192))
|
||||||
QC_strlcat(qccmsrc, "\n", 8192);
|
QCC_PR_ParseWarning (WARN_STRINGTOOLONG, "Too many files to compile");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -262,7 +262,8 @@ int QC_EnumerateFilesFromBlob(const void *blob, size_t blobsize, void (*cb)(cons
|
||||||
|
|
||||||
csize = QC_ReadRawInt(le+18);
|
csize = QC_ReadRawInt(le+18);
|
||||||
usize = QC_ReadRawInt(le+22);
|
usize = QC_ReadRawInt(le+22);
|
||||||
QC_strlcpy(name, cd+46, (nl+1<sizeof(name))?nl+1:sizeof(name));
|
if (!QC_strlcpy(name, cd+46, (nl+1<sizeof(name))?nl+1:sizeof(name)))
|
||||||
|
continue; //name was too long.
|
||||||
|
|
||||||
cb(name, le+30+QC_ReadRawShort(le+26)+QC_ReadRawShort(le+28), csize, method, usize);
|
cb(name, le+30+QC_ReadRawShort(le+26)+QC_ReadRawShort(le+28), csize, method, usize);
|
||||||
ret++;
|
ret++;
|
||||||
|
|
|
@ -3922,7 +3922,6 @@ static void QCBUILTIN PF_checkclient (pubprogfuncs_t *prinst, struct globalvars_
|
||||||
void PF_stuffcmd_Internal(int entnum, const char *str, unsigned int flags)
|
void PF_stuffcmd_Internal(int entnum, const char *str, unsigned int flags)
|
||||||
{
|
{
|
||||||
client_t *cl;
|
client_t *cl;
|
||||||
int slen;
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
if (flags & STUFFCMD_BROADCAST)
|
if (flags & STUFFCMD_BROADCAST)
|
||||||
|
@ -3999,8 +3998,6 @@ void PF_stuffcmd_Internal(int entnum, const char *str, unsigned int flags)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
slen = strlen(str);
|
|
||||||
|
|
||||||
if (!(flags & STUFFCMD_DEMOONLY))
|
if (!(flags & STUFFCMD_DEMOONLY))
|
||||||
{
|
{
|
||||||
if (flags & STUFFCMD_UNRELIABLE)
|
if (flags & STUFFCMD_UNRELIABLE)
|
||||||
|
@ -4013,7 +4010,7 @@ void PF_stuffcmd_Internal(int entnum, const char *str, unsigned int flags)
|
||||||
if (!(flags & STUFFCMD_IGNOREINDEMO))
|
if (!(flags & STUFFCMD_IGNOREINDEMO))
|
||||||
if (sv.mvdrecording)
|
if (sv.mvdrecording)
|
||||||
{
|
{
|
||||||
sizebuf_t *msg = MVDWrite_Begin (dem_single, entnum - 1, 2 + slen);
|
sizebuf_t *msg = MVDWrite_Begin (dem_single, entnum - 1, 2 + strlen(str));
|
||||||
MSG_WriteByte (msg, svc_stufftext);
|
MSG_WriteByte (msg, svc_stufftext);
|
||||||
MSG_WriteString (msg, str);
|
MSG_WriteString (msg, str);
|
||||||
}
|
}
|
||||||
|
|
|
@ -530,12 +530,18 @@ void SV_Map_f (void)
|
||||||
if (!Q_strcasecmp(Cmd_Argv(0), "map_restart"))
|
if (!Q_strcasecmp(Cmd_Argv(0), "map_restart"))
|
||||||
{
|
{
|
||||||
const char *arg = Cmd_Argv(1);
|
const char *arg = Cmd_Argv(1);
|
||||||
|
#ifdef SAVEDGAMES
|
||||||
if (!strcmp(arg, "restore")) //hexen2 reload-saved-game
|
if (!strcmp(arg, "restore")) //hexen2 reload-saved-game
|
||||||
;
|
;
|
||||||
else if (!strcmp(arg, "initial")) //force initial, even if it breaks saved games.
|
else if (!strcmp(arg, "initial")) //force initial, even if it breaks saved games.
|
||||||
*sv.loadgame_on_restart = 0;
|
*sv.loadgame_on_restart = 0;
|
||||||
else if (atof(arg)) //q3's restart-after-delay
|
else
|
||||||
Con_DPrintf ("map_restart delay not implemented yet\n");
|
#endif
|
||||||
|
{
|
||||||
|
float delay = atof(arg);
|
||||||
|
if (delay) //q3's restart-after-delay
|
||||||
|
Con_DPrintf ("map_restart delay not implemented yet\n");
|
||||||
|
}
|
||||||
Q_strncpyz (level, ".", sizeof(level));
|
Q_strncpyz (level, ".", sizeof(level));
|
||||||
startspot = NULL;
|
startspot = NULL;
|
||||||
|
|
||||||
|
|
|
@ -479,7 +479,7 @@ void World_TouchLinks (world_t *w, wedict_t *ent, areanode_t *node)
|
||||||
if (!((int)ent->xv->dimension_solid & (int)touch->xv->dimension_hit)) //didn't change did it?...
|
if (!((int)ent->xv->dimension_solid & (int)touch->xv->dimension_hit)) //didn't change did it?...
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
w->Event_Touch(w, touch, ent);
|
w->Event_Touch(w, touch, ent, NULL);
|
||||||
|
|
||||||
if (ED_ISFREE(ent))
|
if (ED_ISFREE(ent))
|
||||||
break;
|
break;
|
||||||
|
@ -2242,9 +2242,7 @@ static void World_ClipToNetwork (world_t *w, moveclip_t *clip)
|
||||||
{
|
{
|
||||||
touch = &pe->entities[i];
|
touch = &pe->entities[i];
|
||||||
|
|
||||||
if (touch->solidsize == ES_SOLID_NOT)
|
if (touch->solidsize == ES_SOLID_BSP)
|
||||||
continue;
|
|
||||||
else if (touch->solidsize == ES_SOLID_BSP)
|
|
||||||
{
|
{
|
||||||
switch(touch->skinnum)
|
switch(touch->skinnum)
|
||||||
{
|
{
|
||||||
|
@ -2261,6 +2259,12 @@ static void World_ClipToNetwork (world_t *w, moveclip_t *clip)
|
||||||
VectorCopy(model->mins, bmins);
|
VectorCopy(model->mins, bmins);
|
||||||
VectorCopy(model->maxs, bmaxs);
|
VectorCopy(model->maxs, bmaxs);
|
||||||
}
|
}
|
||||||
|
#if 1
|
||||||
|
else
|
||||||
|
continue; //only hit brush ents.
|
||||||
|
#else
|
||||||
|
else if (touch->solidsize == ES_SOLID_NOT)
|
||||||
|
continue;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (clip->type & MOVE_NOMONSTERS)
|
if (clip->type & MOVE_NOMONSTERS)
|
||||||
|
@ -2269,6 +2273,7 @@ static void World_ClipToNetwork (world_t *w, moveclip_t *clip)
|
||||||
model = NULL;
|
model = NULL;
|
||||||
COM_DecodeSize(touch->solidsize, bmins, bmaxs);
|
COM_DecodeSize(touch->solidsize, bmins, bmaxs);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (!(clip->hitcontentsmask & touchcontents))
|
if (!(clip->hitcontentsmask & touchcontents))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -2325,7 +2330,10 @@ static void World_ClipToNetwork (world_t *w, moveclip_t *clip)
|
||||||
if (clip->trace.startsolid && !trace.startsolid)
|
if (clip->trace.startsolid && !trace.startsolid)
|
||||||
trace.ent = clip->trace.ent; //something else hit earlier, that one gets the trace entity, but not the fraction. yeah, combining traces like this was always going to be weird.
|
trace.ent = clip->trace.ent; //something else hit earlier, that one gets the trace entity, but not the fraction. yeah, combining traces like this was always going to be weird.
|
||||||
else
|
else
|
||||||
trace.ent = touch;
|
{
|
||||||
|
trace.ent = NULL;
|
||||||
|
clip->trace.entnum = touch->number;
|
||||||
|
}
|
||||||
clip->trace = trace;
|
clip->trace = trace;
|
||||||
}
|
}
|
||||||
else if (trace.startsolid || trace.allsolid)
|
else if (trace.startsolid || trace.allsolid)
|
||||||
|
@ -2336,7 +2344,8 @@ static void World_ClipToNetwork (world_t *w, moveclip_t *clip)
|
||||||
if (!clip->trace.ent || trace.fraction == clip->trace.fraction) //xonotic requires that second test (DP has no check at all, which would end up reporting mismatched fraction/ent results, so yuck).
|
if (!clip->trace.ent || trace.fraction == clip->trace.fraction) //xonotic requires that second test (DP has no check at all, which would end up reporting mismatched fraction/ent results, so yuck).
|
||||||
{
|
{
|
||||||
clip->trace.contents = trace.contents;
|
clip->trace.contents = trace.contents;
|
||||||
clip->trace.ent = touch;
|
clip->trace.ent = NULL;
|
||||||
|
clip->trace.entnum = touch->number;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue