fix some compile issues (errors and warnings). sdl, ode, vulkan.

fix q2bsp textures.
fix some vulkan validation issues.
MOVE_OTHERONLY is now an official feature (replacing MOVE_ONLYENT which is now removed, same functionality, better behaved behaviour).
network up edited brushes on initial connect. still needs more work for entity editing, but should otherwise be okay for now.
add sys_browserredirect console command for emscripten builds (can be used to trigger window redirections - including download requests)

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5001 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2016-07-15 12:26:24 +00:00
parent 27a59a0cbc
commit 934a97c53e
65 changed files with 9051 additions and 4750 deletions

View File

@ -728,6 +728,10 @@ ifeq ($(FTE_TARGET),SDL2)
SDLCONFIG?=sdl2-config
FTE_FULLTARGET?=sdl2$(BITS)
endif
ifeq ($(FTE_TARGET),SDL1)
SDLCONFIG?=sdl-config
FTE_FULLTARGET?=sdl1$(BITS)
endif
ifeq ($(FTE_TARGET),SDL)
FTE_FULLTARGET?=sdl$(BITS)
endif
@ -742,18 +746,20 @@ GLCL_EXE_NAME=../fteqwcl_gl$(FTE_FULLTARGET)
ifdef windir
GL_LDFLAGS=$(GLLDFLAGS) -lmingw32 -lws2_32 `$(SDLCONFIG) --static-libs`
M_LDFLAGS=$(MLDFLAGS) -lmingw32 -lws2_32 `$(SDLCONFIG) --static-libs`
SV_LDFLAGS=`$(SDLCONFIG) --static-libs`
else
GL_LDFLAGS=$(GLLDFLAGS) $(IMAGELDFLAGS) $(OGGVORBISLDFLAGS) `$(SDLCONFIG) --static-libs`
M_LDFLAGS=$(MLDFLAGS) `$(SDLCONFIG) --static-libs` $(IMAGELDFLAGS) $(OGGVORBISLDFLAGS)
SV_LDFLAGS=`$(SDLCONFIG) --static-libs`
endif
GL_CFLAGS=-DFTE_SDL $(GLCFLAGS) `$(SDLCONFIG) --cflags`
GLB_DIR=gl_$(FTE_FULLTARGET)
GLCL_DIR=glcl_$(FTE_FULLTARGET)
SV_DIR?=sv_$(FTE_FULLTARGET)
SV_OBJS=$(COMMON_OBJS) $(SERVER_OBJS) $(PROGS_OBJS) $(SERVERONLY_OBJS)
SV_EXE_NAME=../fteqw_sv$(FTE_FULLTARGET)
SV_CFLAGS=$(SERVER_ONLY_CFLAGS)
SV_LDFLAGS=
SV_CFLAGS=-DFTE_SDL `$(SDLCONFIG) --cflags` $(SERVER_ONLY_CFLAGS)
MINGL_DIR=mingl_$(FTE_FULLTARGET)
MINGL_EXE_NAME=../fteqw_mingl$(FTE_FULLTARGET)
@ -761,8 +767,7 @@ MINGL_EXE_NAME=../fteqw_mingl$(FTE_FULLTARGET)
MB_DIR=m_$(FTE_FULLTARGET)
M_EXE_NAME=../fteqw_$(FTE_FULLTARGET)
MCL_OBJS=$(D3DGL_OBJS) $(GLQUAKE_OBJS) $(SOFTWARE_OBJS) gl_vidsdl.o snd_sdl.o cd_sdl.o sys_sdl.o in_sdl.o
M_CFLAGS=$(GLCFLAGS) `$(SDLCONFIG) --cflags`
M_LDFLAGS=$(GLLDFLAGS) $(IMAGELDFLAGS) $(OGGVORBISLDFLAGS)
M_CFLAGS=-DFTE_SDL $(GLCFLAGS) `$(SDLCONFIG) --cflags`
QCC_DIR=qcc$(BITS)
@ -1044,15 +1049,14 @@ ifeq (win,$(findstring win,$(FTE_TARGET))$(findstring _SDL,$(FTE_TARGET)))
endif
BASELDFLAGS+=-lcomctl32
EXEPOSTFIX=.exe
SV_CFLAGS=$(SERVER_ONLY_CFLAGS) $(W32_CFLAGS)
LIBS_DIR = $(BASE_DIR)/libs
SV_EXE_NAME=../fteqwsv$(BITS)$(EXEPOSTFIX)
SV_LDFLAGS=$(MINGW_LIBS_DIR)/libz.a -lws2_32 -lwinmm
SV_DIR=sv_mingw$(BITS)
SV_OBJS=$(COMMON_OBJS) $(SERVER_OBJS) $(PROGS_OBJS) $(WINDOWSSERVERONLY_OBJS) $(BOTLIB_OBJS) fs_win32.o $(LTO_END) resources.o $(LTO_START)
SV_CFLAGS=$(SERVER_ONLY_CFLAGS) $(W32_CFLAGS)
GLCL_OBJS=$(GL_OBJS) $(D3DGL_OBJS) $(GLQUAKE_OBJS) $(BOTLIB_OBJS) $(SPEEX_OBJS) gl_vidnt.o $(WINDOWS_OBJS)
@ -1069,11 +1073,11 @@ ifeq (win,$(findstring win,$(FTE_TARGET))$(findstring _SDL,$(FTE_TARGET)))
NPFTE_CFLAGS=$(NPFTECFLAGS) $(W32_CFLAGS) -DMULTITHREAD
NPFTEB_DIR=npfte_mgw$(BITS)
MCL_OBJS=$(D3DGL_OBJS) $(GLQUAKE_OBJS) $(SOFTWARE_OBJS) $(D3DQUAKE_OBJS) $(BOTLIB_OBJS) $(SPEEX_OBJS) gl_vidnt.o $(WINDOWS_OBJS)
MCL_OBJS=$(D3DGL_OBJS) $(GLQUAKE_OBJS) $(SOFTWARE_OBJS) $(D3DQUAKE_OBJS) $(BOTLIB_OBJS) $(SPEEX_OBJS) gl_vidnt.o vk_win32.o $(WINDOWS_OBJS)
M_EXE_NAME=../fteqw$(BITS)$(EXEPOSTFIX)
MCL_EXE_NAME=../fteqwcl$(BITS)$(EXEPOSTFIX)
M_LDFLAGS=$(GLLDFLAGS) $(IMAGELDFLAGS) $(OGGVORBISLDFLAGS) -ldxguid -lws2_32 -lwinmm -lgdi32 -lole32 -Wl,--subsystem,windows
M_CFLAGS=$(GLCFLAGS) $(W32_CFLAGS) $(D3DCFLAGS) $(DX7SDK) -DMULTITHREAD -DLIBVORBISFILE_STATIC $(SPEEXCFLAGS)
M_CFLAGS=$(GLCFLAGS) $(W32_CFLAGS) $(D3DCFLAGS) $(DX7SDK) $(VKCFLAGS) -DMULTITHREAD -DLIBVORBISFILE_STATIC $(SPEEXCFLAGS)
MB_DIR=m_mgw$(BITS)
MCL_DIR=mcl_mgw$(BITS)
@ -1112,6 +1116,7 @@ ifeq ($(FTE_TARGET),bsd)
SV_DIR=sv_linux
SV_LDFLAGS=-lz -ldl
SV_CFLAGS=$(SERVER_ONLY_CFLAGS)
GLCL_OBJS=$(GL_OBJS) $(D3DGL_OBJS) $(GLQUAKE_OBJS) $(BOTLIB_OBJS) gl_vidlinuxglx.o snd_linux.o cd_null.o sys_linux.o sys_linux_threads.o
GL_EXE_NAME=../fteqw.gl
@ -1166,7 +1171,7 @@ ifneq (,$(findstring linux,$(FTE_TARGET)))
M_EXE_NAME=../fteqw$(BITS)
MCL_EXE_NAME=../fteqwcl$(BITS)
M_LDFLAGS=$(GL_LDFLAGS)
M_CFLAGS=$(GL_CFLAGS)
M_CFLAGS=$(VKCFLAGS) $(GL_CFLAGS)
MB_DIR=m_linux$(BITS)
MCL_DIR=mcl_linux$(BITS)
@ -1271,6 +1276,7 @@ endif
ifeq ($(FTE_TARGET),cyg)
SV_DIR=sv_cygwin
SV_LDFLAGS=-lz
SV_CFLAGS=$(SERVER_ONLY_CFLAGS)
EXEPOSTFIX=.exe
GLCL_OBJS=$(GL_OBJS) $(D3DGL_OBJS) $(GLQUAKE_OBJS) $(BOTLIB_OBJS) $(SPEEX_OBJS) gl_vidlinuxglx.o snd_linux.o cd_null.o sys_linux.o sys_linux_threads.o
@ -1298,7 +1304,7 @@ endif
ifeq ($(FTE_TARGET),droid)
BASELDFLAGS=
SV_CFLAGS=
SV_CFLAGS=$(SERVER_ONLY_CFLAGS) $(W32_CFLAGS)
SV_LDFLAGS=
SV_DIR=sv_droid-$(DROID_ARCH)
SV_OBJS=$(COMMON_OBJS) $(SERVER_OBJS) $(PROGS_OBJS) $(BOTLIB_OBJS) sys_droid.o
@ -1341,6 +1347,7 @@ ifeq ($(FTE_TARGET),web)
#SV_LDFLAGS=-lz
#SV_OBJS=$(COMMON_OBJS) $(SERVER_OBJS) $(PROGS_OBJS)
SV_EXE_NAME=../libftesv.js
SV_CFLAGS=$(SERVER_ONLY_CFLAGS)
#SV_LDFLAGS=
@ -1774,15 +1781,17 @@ EMSCRIPTENROOT?=C:/Games/tools/Emscripten
#EMSCRIPTENPATH=$(realpath $(EMSCRIPTENROOT)):$(realpath $(EMSCRIPTENROOT)/clang/e1.22.0_64bit):$(realpath $(EMSCRIPTENROOT)/node/0.10.17_64bit):$(realpath $(EMSCRIPTENROOT)/python/2.7.5.3_64bit):$(realpath $(EMSCRIPTENROOT)/emscripten/1.22.0):$(PATH)
EMSCRIPTENPATH=$(realpath $(EMSCRIPTENROOT)):$(realpath $(EMSCRIPTENROOT)/clang/e1.35.0_64bit):$(realpath $(EMSCRIPTENROOT)/node/4.1.1_64bit/bin):$(realpath $(EMSCRIPTENROOT)/python/2.7.5.3_64bit):$(realpath $(EMSCRIPTENROOT)/emscripten/1.35.0):$(PATH)
#EMCC?=/opt/emsdk_portable/emscripten/master/emcc
EMCC?=emcc.bat --em-config $(shell cygpath -m $(USERPROFILE))/.emscripten
web-rel:
@PATH="$(EMSCRIPTENPATH)" $(MAKE) gl-rel FTE_TARGET=web CC="emcc.bat --em-config $(shell cygpath -m $(USERPROFILE))/.emscripten"
@PATH="$(EMSCRIPTENPATH)" $(MAKE) gl-rel FTE_TARGET=web CC="$(EMCC)"
cp $(BASE_DIR)/web/fteshell.html $(RELEASE_DIR)/ftewebgl.html
@gzip -f $(RELEASE_DIR)/ftewebgl.html
@gzip -f $(RELEASE_DIR)/ftewebgl.js
@gzip -f $(RELEASE_DIR)/ftewebgl.js.mem
web-dbg:
@PATH="$(EMSCRIPTENPATH)" $(MAKE) gl-dbg FTE_TARGET=web CC="emcc.bat --em-config $(shell cygpath -m $(USERPROFILE))/.emscripten"
@PATH="$(EMSCRIPTENPATH)" $(MAKE) gl-dbg FTE_TARGET=web CC="$(EMCC)"
cp $(BASE_DIR)/web/fteshell.html $(RELEASE_DIR)/ftewebgl.html
@gzip -f $(DEBUG_DIR)/ftewebgl.html
@gzip -f $(DEBUG_DIR)/ftewebgl.js

View File

@ -107,7 +107,9 @@ static void Cam_AutoTrack_f(void)
static float CL_TrackScoreProp(player_info_t *pl, char rule, float *weights)
{
#ifdef QUAKESTATS
float r;
#endif
switch(rule)
{
case '.': //currently being tracked. combine with currently alive or something

View File

@ -385,7 +385,6 @@ void IN_WriteButtons(vfsfile_t *f, qboolean all)
void IN_Impulse (void)
{
int newimp;
int best, i, imp, items;
int pnum = CL_TargettedSplit(false);
newimp = Q_atoi(Cmd_Argv(1));
@ -393,6 +392,7 @@ void IN_Impulse (void)
#ifdef QUAKESTATS
if (Cmd_Argc() > 2)
{
int best, i, imp, items;
items = cl.playerview[pnum].stats[STAT_ITEMS];
best = 0;

View File

@ -61,7 +61,7 @@ cvar_t cl_idlefps = CVARFD("cl_idlefps", "0", CVAR_ARCHIVE, "This is the maximum
cvar_t cl_yieldcpu = CVARFD("cl_yieldcpu", "0", CVAR_ARCHIVE, "Attempt to yield between frames. This can resolve issues with certain drivers and background software, but can mean less consistant frame times. Will reduce power consumption/heat generation so should be set on laptops or similar (over-hot/battery powered) devices.");
cvar_t cl_nopext = CVARF("cl_nopext", "0", CVAR_ARCHIVE);
cvar_t cl_pext_mask = CVAR("cl_pext_mask", "0xffffffff");
cvar_t cl_nolerp = CVARD("cl_nolerp", "0", "Disables interpolation. If set, missiles/monsters will be smoother, but they may be more laggy. Does not affect players. A value of 2 means 'interpolate only in single-player/coop'.");
cvar_t cl_nolerp = CVARD("cl_nolerp", "0", "Disables interpolation. If set, missiles/monsters will be show exactly what was last received, which will be jerky. Does not affect players. A value of 2 means 'interpolate only in single-player/coop'.");
cvar_t cl_nolerp_netquake = CVARD("cl_nolerp_netquake", "0", "Disables interpolation when connected to an NQ server. Does affect players, even the local player. You probably don't want to set this.");
cvar_t *hud_tracking_show;
cvar_t *hud_miniscores_show;
@ -1992,7 +1992,9 @@ void CL_CheckServerInfo(void)
{
char *s;
unsigned int allowed;
#ifdef QUAKESTATS
int oldstate;
#endif
int oldteamplay;
oldteamplay = cl.teamplay;
@ -5487,7 +5489,10 @@ void CL_ArgumentOverrides(void)
//note that this does NOT include commandline.
void CL_ExecInitialConfigs(char *resetcommand)
{
int qrc, hrc, def;
#ifdef QUAKESTATS
int qrc, hrc;
#endif
int def;
Cbuf_Execute (); //make sure any pending console commands are done with. mostly, anyway...
SCR_ShowPic_Clear(true);

View File

@ -27,7 +27,9 @@ void CLDP_ParseDarkPlaces5Entities(void);
static void CL_SetStatNumeric (int pnum, int stat, int ivalue, float fvalue);
#define CL_SetStatInt(pnum,stat,ival) do{int thevalue=ival; CL_SetStatNumeric(pnum,stat,thevalue,thevalue);}while(0)
static qboolean CL_CheckModelResources (char *name);
#ifdef NQPROT
static char *CLNQ_ParseProQuakeMessage (char *s);
#endif
char cl_dp_csqc_progsname[128];
int cl_dp_csqc_progssize;
@ -141,8 +143,8 @@ char *svc_qwstrings[] =
"svcfte_voicechat",
"svcfte_setangledelta",
"svcfte_updateentities",
"???",
"???",
"svcfte_brushedit",
"svcfte_updateseats",
"???",
"???",
"???",
@ -4984,13 +4986,13 @@ CL_SetStat
*/
static void CL_SetStat_Internal (int pnum, int stat, int ivalue, float fvalue)
{
int j;
if (cl.playerview[pnum].stats[stat] != ivalue)
Sbar_Changed ();
#ifdef QUAKESTATS
if (stat == STAT_ITEMS)
{ // set flash times
int j;
for (j=0 ; j<32 ; j++)
if ( (ivalue & (1<<j)) && !(cl.playerview[pnum].stats[stat] & (1<<j)))
cl.playerview[pnum].item_gettime[j] = cl.time;

View File

@ -1600,7 +1600,7 @@ static int Con_DrawProgress(int left, int right, int y)
{
#ifdef RUNTIMELIGHTING
extern model_t *lightmodel;
extern int relitsurface;
extern long relitsurface;
#endif
conchar_t dlbar[1024], *chr;

View File

@ -832,10 +832,11 @@ void Sys_SendKeyEvents(void)
#if SDL_MAJOR_VERSION >= 2
//actually, joysticks *should* work with sdl1 as well, but there are some differences (like no hot plugging, I think).
case SDL_JOYAXISMOTION:
J_JoystickAxis(event.jaxis.which, event.jaxis.axis, event.jaxis.value);
break;
// case SDL_JOYBALLMOTION:
// case SDL_JOYHATMOTION:
break;
// break;
case SDL_JOYBUTTONDOWN:
case SDL_JOYBUTTONUP:
J_JoystickButton(event.jbutton.which, event.jbutton.button, event.type==SDL_CONTROLLERBUTTONDOWN);

View File

@ -304,8 +304,8 @@ void M_Menu_SinglePlayer_f (void)
menubutton_t *b;
mpic_t *p;
static menuresel_t resel;
#endif
extern cvar_t cl_splitscreen;
#endif
Key_Dest_Add(kdm_emenu);
m_state = m_complex;

View File

@ -2558,6 +2558,7 @@ qboolean PScript_Query(int typenum, int body, char *outstr, int outstrlen)
return false;
}
#ifndef NOLEGACY
static void P_ExportAllEffects_f(void)
{
char effect[8192];
@ -2599,6 +2600,7 @@ static void P_ExportAllEffects_f(void)
FS_NativePath(fname, FS_GAMEONLY, effect, sizeof(effect));
Con_Printf("Written %s\n", effect);
}
#endif
#if 1//_DEBUG
// R_BeamInfo_f - debug junk
@ -3457,6 +3459,7 @@ static void PScript_ClearParticles (void)
}
}
#ifndef NOLEGACY
static void P_ExportBuiltinSet_f(void)
{
char *efname = Cmd_Argv(1);
@ -3487,6 +3490,7 @@ static void P_ExportBuiltinSet_f(void)
Con_Printf("'%s' is not a built in particle set\n", efname);
}
#endif
static qboolean P_LoadParticleSet(char *name, qboolean implicit)
{

View File

@ -150,7 +150,9 @@ void R2D_Shutdown(void)
Font_Free(font_tiny);
font_tiny = NULL;
#ifndef NOBUILTINMENUS
M_ReloadMenus();
#endif
#if defined(MENU_DAT) || defined(CSQC_DAT)
PR_ReloadFonts(false);

View File

@ -277,6 +277,7 @@ extern cvar_t r_novis;
extern cvar_t r_speeds;
extern cvar_t r_waterwarp;
#ifndef NOLEGACY
#if defined(ANDROID)
//on android, these numbers seem to be generating major weirdness, so disable these.
cvar_t r_polygonoffset_submodel_factor = CVAR("r_polygonoffset_submodel_factor", "0");
@ -289,6 +290,7 @@ cvar_t r_polygonoffset_submodel_offset = CVAR("r_polygonoffset_submodel_offset",
cvar_t r_polygonoffset_submodel_factor = CVAR("r_polygonoffset_submodel_factor", "0.05");
cvar_t r_polygonoffset_submodel_offset = CVAR("r_polygonoffset_submodel_offset", "25");
#endif
#endif
cvar_t r_polygonoffset_shadowmap_offset = CVAR("r_polygonoffset_shadowmap_factor", "0.05");
cvar_t r_polygonoffset_shadowmap_factor = CVAR("r_polygonoffset_shadowmap_offset", "0");
@ -838,8 +840,10 @@ void Renderer_Init(void)
Cvar_Register (&r_showbboxes, GLRENDEREROPTIONS);
Cvar_Register (&r_showfields, GLRENDEREROPTIONS);
#ifndef NOLEGACY
Cvar_Register (&r_polygonoffset_submodel_factor, GLRENDEREROPTIONS);
Cvar_Register (&r_polygonoffset_submodel_offset, GLRENDEREROPTIONS);
#endif
Cvar_Register (&r_polygonoffset_shadowmap_factor, GLRENDEREROPTIONS);
Cvar_Register (&r_polygonoffset_shadowmap_offset, GLRENDEREROPTIONS);
Cvar_Register (&r_polygonoffset_stencil_factor, GLRENDEREROPTIONS);
@ -1661,7 +1665,7 @@ qboolean R_BuildRenderstate(rendererstate_t *newr, char *rendererstring)
// use desktop settings if set to 0 and not dedicated
if (newr->renderer && newr->renderer->rtype != QR_NONE)
{
extern qboolean isPlugin;
extern int isPlugin;
if (vid_desktopsettings.value)
{

View File

@ -294,7 +294,7 @@ static int WASAPI_Thread(void *arg)
//extra crap to get the OS to favour waking us up on demand.
{
HANDLE WINAPI (*pAvSetMmThreadCharacteristics)(LPCTSTR TaskName, LPDWORD TaskIndex);
HANDLE (WINAPI *pAvSetMmThreadCharacteristics)(LPCTSTR TaskName, LPDWORD TaskIndex);
dllfunction_t funcs[] = {{(void*)&pAvSetMmThreadCharacteristics, "AvSetMmThreadCharacteristics"}, {NULL}};
DWORD taskIndex = 0;

View File

@ -65,7 +65,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
int noconinput = 0;
int nostdout = 0;
qboolean isPlugin;
int isPlugin;
int sys_parentleft;
int sys_parenttop;
int sys_parentwidth;
@ -710,11 +710,13 @@ char *Sys_ConsoleInput(void)
static char text[256];
int len;
#ifdef SUBSERVERS
if (SSV_IsSubServer())
{
SSV_CheckFromMaster();
return NULL;
}
#endif
if (noconinput)
return NULL;

View File

@ -455,7 +455,6 @@ int QDECL main(int argc, char **argv)
{
float time, newtime, oldtime;
quakeparms_t parms;
float delay = 0.001;
memset(&parms, 0, sizeof(parms));
@ -485,14 +484,14 @@ int QDECL main(int argc, char **argv)
#ifndef CLIENTONLY
if (isDedicated)
{
NET_Sleep(delay, false);
float delay;
// find time passed since last cycle
newtime = Sys_DoubleTime ();
time = newtime - oldtime;
oldtime = newtime;
delay = SV_Frame();
NET_Sleep(delay, false);
}
else
#endif

View File

@ -301,7 +301,7 @@ int Sys_EnumerateFiles (const char *gpath, const char *match, int (QDECL *func)(
#if !defined(CLIENTONLY) && !defined(SERVERONLY)
qboolean isDedicated = false;
#endif
extern qboolean isPlugin;
extern int isPlugin;
qboolean debugout;
float gammapending; //to cope with ATI. When it times out, v_gamma is reforced in order to correct/update gamma now the drivers think that they have won.
@ -3876,7 +3876,6 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
double time, oldtime, newtime;
char cwd[1024], bindir[1024];
const char *qtvfile = NULL;
float delay = 0;
char lang[32];
char ctry[32];
int c;
@ -4245,7 +4244,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
if (isDedicated)
{
#ifndef CLIENTONLY
NET_Sleep(delay, false);
float delay;
// find time passed since last cycle
newtime = Sys_DoubleTime ();
@ -4253,6 +4252,8 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLin
oldtime = newtime;
delay = SV_Frame ();
NET_Sleep(delay, false);
#else
Sys_Error("wut?");
#endif

View File

@ -1199,8 +1199,10 @@ called to apply any dirty refdef bits and recalculates pending data.
*/
void V_ApplyRefdef (void)
{
#ifdef QUAKEHUD
float size;
int h;
#endif
qboolean full = false;
// force the status bar to redraw

View File

@ -295,6 +295,7 @@ void TP_ExecTrigger (char *s, qboolean indemos)
#define MAX_MACRO_VALUE 256
static char macro_buf[MAX_MACRO_VALUE] = "";
#ifndef QUAKETC
// buffer-size-safe helper functions
//static void MacroBuf_strcat (char *str) {
// strlcat (macro_buf, str, sizeof(macro_buf));
@ -304,6 +305,7 @@ static void MacroBuf_strcat_with_separator (char *str) {
strlcat (macro_buf, tp_name_separator.string, sizeof(macro_buf));
strlcat (macro_buf, str, sizeof(macro_buf));
}
#endif
static char *Macro_Latency (void)
@ -2708,7 +2710,7 @@ static void TP_FindModelNumbers (void)
}
}
#ifndef QUAKETC
// on success, result is non-zero
// on failure, result is zero
// for armors, returns skinnum+1 on success
@ -2782,7 +2784,6 @@ static int FindNearestItem (vec3_t org, int flags, item_t **pitem)
return bestidx;
}
static int CountTeammates (void)
{
int i, count;
@ -2882,9 +2883,11 @@ static void TP_ItemTaken (char *s, int flag, vec3_t org, int entnum, item_t *ite
}
*/
}
#endif
void TP_ParsePlayerInfo(player_state_t *oldstate, player_state_t *state, player_info_t *info)
{
#ifndef QUAKETC
// if (TP_NeedRefreshSkins())
// {
// if ((state->effects & (EF_BLUE|EF_RED) ) != (oldstate->effects & (EF_BLUE|EF_RED)))
@ -2922,6 +2925,7 @@ void TP_ParsePlayerInfo(player_state_t *oldstate, player_state_t *state, player_
strcpy (vars.lastdroploc, Macro_Location());
}
}
#endif
}
void TP_CheckPickupSound (char *s, vec3_t org, int seat)
@ -3420,8 +3424,8 @@ void TP_UpdateAutoStatus(void)
void TP_StatChanged (int stat, int value)
{
int i;
#ifdef QUAKESTATS
int i;
if (stat == STAT_HEALTH)
{
if (value > 0)

View File

@ -155,7 +155,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#undef AVAIL_FREETYPE
#endif
#if defined(_MSC_VER) && (_MSC_VER < 1500)
#if (defined(_MSC_VER) && (_MSC_VER < 1500)) || defined(FTE_SDL)
#undef AVAIL_WASAPI //wasapi is available in the vista sdk, while that's compatible with earlier versions, its not really expected until 2008
#endif
@ -220,7 +220,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#endif
#if defined(_WIN32) && !defined(FTE_SDL) && !defined(WINRT)
#define SUBSERVERS //use subserver code.
#elif defined(__linux__) && !defined(ANDROID)
#elif defined(__linux__) && !defined(ANDROID) && !defined(FTE_SDL)
#define SUBSERVERS //use subserver code.
#endif

View File

@ -1199,7 +1199,7 @@ Returns a single string containing argv(1) to argv(argc()-1)
char *VARGS Cmd_Args (void)
{
if (!cmd_args)
return "";
return "\0\0"; //fucking hell gcc, I shouldn't need this shit.
return cmd_args;
}

View File

@ -78,14 +78,10 @@ glibc SUCKS. 64bit glibc is depending upon glibc 2.14 because of some implementa
or something.
anyway, the actual interface is the same. the old version might be slower, but when updating glibc generally results in also installing systemd, requiring the new version is NOT an option.
*/
#if defined(__GNUC__) && defined(__LP64__) && defined(__linux__)
#if defined(__GNUC__) && defined(__LP64__) && defined(__linux__) && !defined(FTE_SDL)
#include <features.h> /* for glibc version */
#if defined(__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 14)
__asm__(".symver oldmemcpy,memcpy@GLIBC_2.2.5"); void *oldmemcpy(void *__restrict dst, const void *__restrict src, size_t len);
__attribute__ ((visibility ("hidden"))) void *memcpy(void *__restrict dst, const void *__restrict src, size_t len)
{
return oldmemcpy(dst,src,len);
}
#if defined(__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 14)
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
#endif
#endif
/*end glibc workaround*/

View File

@ -756,7 +756,7 @@ int Netchan_Transmit (netchan_t *chan, int length, qbyte *data, int rate)
{
int hsz = 10 + ((chan->sock == NS_CLIENT)?chan->qportsize:0); /*header size, if fragmentation is in use*/
if ((!chan->fragmentsize) || send.cursize-hsz < ((chan->fragmentsize - hsz)&~7))
if ((!chan->fragmentsize))// || send.cursize < ((chan->fragmentsize - hsz)&~7))
{
for (i = -1; i < chan->dupe && e == NETERR_SENT; i++)
e = NET_SendPacket (chan->sock, send.cursize, send.data, &chan->remote_address);
@ -770,28 +770,13 @@ int Netchan_Transmit (netchan_t *chan, int length, qbyte *data, int rate)
}
else
{
int offset, no;
int offset = 0, no;
qboolean more;
/*switch on the 'more flags' bit, and send the first part*/
send.data[hsz - 2] |= 0x1;
for(;;)
{
offset = chan->fragmentsize - hsz;
offset &= ~7;
e = NET_SendPacket (chan->sock, offset + hsz, send.data, &chan->remote_address);
if (e == NETERR_MTU && chan->fragmentsize > 560)
{
chan->fragmentsize -= 10;
Con_Printf("Reducing MSS to %i\n", chan->fragmentsize);
continue;
}
break;
}
/*FIXME: splurge over a number of frames, if we have an outgoing reliable*/
/*send the additional parts, adding new headers within the previous packet*/
while(offset < send.cursize-hsz)
do
{
no = offset + chan->fragmentsize - hsz;
if (no < send.cursize-hsz)
@ -819,9 +804,22 @@ int Netchan_Transmit (netchan_t *chan, int length, qbyte *data, int rate)
*(short*)&send.data[offset + hsz-2] = LittleShort((offset>>2) | (more?1:0));
if (e == NETERR_SENT)
e = NET_SendPacket (chan->sock, (no - offset) + hsz, send.data + offset, &chan->remote_address);
{
for (i = -1; i < chan->dupe && e == NETERR_SENT; i++)
{
e = NET_SendPacket (chan->sock, (no - offset) + hsz, send.data + offset, &chan->remote_address);
if (e == NETERR_MTU && !offset && chan->fragmentsize > 560)
{
chan->fragmentsize -= 10;
Con_Printf("Reducing MSS to %i\n", chan->fragmentsize);
no = offset;
more = true;
break;
}
}
}
offset = no;
}
} while(more);
}
}

View File

@ -402,26 +402,33 @@ static qintptr_t VARGS Plug_PR_GetVMInstance(void *offset, quintptr_t mask, cons
struct pubprogfuncs_s *pr = NULL;
if (offset)
return 0;
switch(vmid)
{
#ifndef CLIENTONLY
else if (vmid == 0)
case 0:
pr = sv.world.progs;
break;
#endif
#if defined(CSQC_DAT) && !defined(SERVERONLY)
else if (vmid == 1)
{
extern world_t csqc_world;
pr = csqc_world.progs;
}
case 1:
{
extern world_t csqc_world;
pr = csqc_world.progs;
}
break;
#endif
#if defined(MENU_DAT) && !defined(SERVERONLY)
else if (vmid == 2)
{
extern world_t menu_world;
pr = menu_world.progs;
}
case 2:
{
extern world_t menu_world;
pr = menu_world.progs;
}
break;
#endif
else
default:
pr = NULL; //unknown vmid / not present in this build.
break;
}
return (qintptr_t)pr;
}
@ -1841,7 +1848,9 @@ void Plug_SBar(playerview_t *pv)
hudmode = 1;
else
hudmode = 2;
if (!(plug_sbar.ival & hudmode))
if (!(plug_sbar.ival&4) && ((cls.protocol != CP_QUAKEWORLD && cls.protocol != CP_NETQUAKE) || M_GameType()!=MGT_QUAKE1))
currentplug = NULL; //disable the hud if we're not running quake. q2/q3/h2 must not display the hud, allowing for a simpler install-anywhere installer that can include it.
else if (!(plug_sbar.ival & hudmode))
currentplug = NULL;
else
{

View File

@ -125,7 +125,7 @@ typedef struct q2trace_s
#define MOVE_EVERYTHING 32 //can return triggers and non-solid items if they're marked with FINDABLE_NONSOLID (works even if the items are not properly linked)
#define MOVE_LAGGED 64 //trace touches current last-known-state, instead of actual ents (just affects players for now)
#define MOVE_ENTCHAIN 128 //chain of impacted ents, otherwise result shows only world
#define MOVE_ONLYENT 256 //test the trace against a single entity, ignoring non-solid/owner/etc flags (but respecting contents).
#define MOVE_OTHERONLY 256 //test the trace against a single entity, ignoring non-solid/owner/etc flags (but respecting contents).
#define MOVE_IGNOREHULL (1u<<31) //used on tracelines etc to simplify the code a little
typedef struct areanode_s

View File

@ -215,6 +215,7 @@ static void BE_PolyOffset(qboolean pushdepth)
po.factor = shaderstate.curshader->polyoffset.factor;
po.unit = shaderstate.curshader->polyoffset.unit;
#ifndef NOLEGACY
if (pushdepth)
{
/*some quake doors etc are flush with the walls that they're meant to be hidden behind, or plats the same height as the floor, etc
@ -223,6 +224,7 @@ static void BE_PolyOffset(qboolean pushdepth)
po.factor += r_polygonoffset_submodel_factor.value;
po.unit += r_polygonoffset_submodel_offset.value;
}
#endif
if (shaderstate.mode == BEM_DEPTHONLY)
{
extern cvar_t r_polygonoffset_shadowmap_offset, r_polygonoffset_shadowmap_factor;
@ -252,6 +254,7 @@ void GLBE_PolyOffsetStencilShadow(qboolean pushdepth)
po.factor = r_polygonoffset_stencil_factor.value;
po.unit = r_polygonoffset_stencil_offset.value;
#ifndef NOLEGACY
if (pushdepth)
{
/*some quake doors etc are flush with the walls that they're meant to be hidden behind, or plats the same height as the floor, etc
@ -260,6 +263,7 @@ void GLBE_PolyOffsetStencilShadow(qboolean pushdepth)
po.factor += r_polygonoffset_submodel_factor.value;
po.unit += r_polygonoffset_submodel_offset.value;
}
#endif
#ifndef FORCESTATE
if (shaderstate.curpolyoffset.factor != po.factor || shaderstate.curpolyoffset.unit != po.unit)
@ -279,6 +283,7 @@ static void GLBE_PolyOffsetShadowMap(qboolean pushdepth)
{
extern cvar_t r_polygonoffset_shadowmap_offset, r_polygonoffset_shadowmap_factor;
polyoffset_t po;
#ifndef NOLEGACY
if (pushdepth)
{
/*some quake doors etc are flush with the walls that they're meant to be hidden behind, or plats the same height as the floor, etc
@ -288,6 +293,7 @@ static void GLBE_PolyOffsetShadowMap(qboolean pushdepth)
po.unit = r_polygonoffset_submodel_offset.value + r_polygonoffset_shadowmap_offset.value;
}
else
#endif
{
po.factor = r_polygonoffset_shadowmap_factor.value;
po.unit = r_polygonoffset_shadowmap_offset.value;
@ -1840,26 +1846,24 @@ static void colourgen(const shaderpass_t *pass, int cnt, vec4_t *src, vec4_t *ds
}
break;
case RGB_GEN_VERTEX_LIGHTING:
#if MAXRLIGHTMAPS > 1
if (mesh->colors4f_array[1])
{
float lm[MAXRLIGHTMAPS];
lm[0] = d_lightstylevalue[shaderstate.curbatch->vtlightstyle[0]]/256.0f*shaderstate.identitylighting;
#if MAXRLIGHTMAPS > 1
lm[1] = d_lightstylevalue[shaderstate.curbatch->vtlightstyle[1]]/256.0f*shaderstate.identitylighting;
lm[2] = d_lightstylevalue[shaderstate.curbatch->vtlightstyle[2]]/256.0f*shaderstate.identitylighting;
lm[3] = d_lightstylevalue[shaderstate.curbatch->vtlightstyle[3]]/256.0f*shaderstate.identitylighting;
#endif
while((cnt)--)
{
VectorScale( mesh->colors4f_array[0][cnt], lm[0], dst[cnt]);
#if MAXRLIGHTMAPS > 1
VectorMA(dst[cnt], lm[1], mesh->colors4f_array[1][cnt], dst[cnt]);
VectorMA(dst[cnt], lm[2], mesh->colors4f_array[2][cnt], dst[cnt]);
VectorMA(dst[cnt], lm[3], mesh->colors4f_array[3][cnt], dst[cnt]);
#endif
}
break;
}
#endif
if (shaderstate.identitylighting != 1)
{

View File

@ -5862,10 +5862,28 @@ static brushes_t *Terr_Brush_Insert(model_t *model, heightmap_t *hm, brushes_t *
if (brush->id)
out->id = brush->id;
else
out->id = ++hm->brushidseq;
{
unsigned int i;
//loop to avoid creating two brushes with the same id
do
{
out->id = (++hm->brushidseq)&0x00ffffff;
#ifndef SERVERONLY
if (cls.state) //avoid networking conflicts by having each node generating its own private ids
out->id |= (cl.playerview[0].playernum+1)<<24;
#endif
for (i = 0; i < hm->numbrushes; i++)
{
if (hm->wbrushes[i].id == out->id)
break;
}
} while (i != hm->numbrushes);
}
// Con_Printf("brush %u (%i faces)\n", out->id, oface);
hm->numbrushes+=1;
hm->brushesedited = true;
hm->recalculatebrushlighting = true; //lightmaps need to be reallocated
@ -5892,8 +5910,9 @@ static void Terr_Brush_DeleteIdx(heightmap_t *hm, size_t idx)
BZ_Free(br->planes);
hm->numbrushes--;
hm->brushesedited = true;
//plug the hole with some other brush.
if (hm->numbrushes)
if (idx < hm->numbrushes)
hm->wbrushes[idx] = hm->wbrushes[hm->numbrushes];
}
static void Terr_Brush_DeleteId(heightmap_t *hm, unsigned int brushid)
@ -5982,17 +6001,45 @@ static qboolean Brush_Deserialise(heightmap_t *hm, brushes_t *br)
return true;
}
#ifndef SERVERONLY
heightmap_t *CL_BrushEdit_ForceContext(model_t *mod)
{
heightmap_t *hm = mod?mod->terrain:NULL;
if (!hm)
{
if (mod && mod->loadstate == MLS_LOADING)
COM_WorkerPartialSync(mod, &mod->loadstate, MLS_LOADING);
if (mod && mod->loadstate == MLS_LOADED)
{
char basename[MAX_QPATH];
COM_FileBase(mod->name, basename, sizeof(basename));
mod->terrain = Mod_LoadTerrainInfo(mod, basename, true);
hm = mod->terrain;
if (!hm)
return NULL;
Terr_FinishTerrain(mod);
}
else
return NULL;
}
return hm;
}
void CL_Parse_BrushEdit(void)
{
model_t *mod = cl.model_precache[1];
unsigned int modelindex = MSG_ReadShort();
int cmd = MSG_ReadByte();
model_t *mod = (modelindex<countof(cl.model_precache))?cl.model_precache[modelindex]:NULL;
heightmap_t *hm = mod?mod->terrain:NULL;
int cmd = MSG_ReadByte();
if (cmd == 0)
Terr_Brush_DeleteId(hm, MSG_ReadLong());
else if (cmd == 1)
{
brushes_t brush;
hm = CL_BrushEdit_ForceContext(mod); //do this early, to ensure that the textures are correct
memset(&brush, 0, sizeof(brush));
brush.numplanes = 128;
brush.planes = alloca(sizeof(*brush.planes) * brush.numplanes);
@ -6016,18 +6063,93 @@ void CL_Parse_BrushEdit(void)
}
Terr_Brush_Insert(mod, hm, &brush);
}
else if (cmd == 2)
{
hm = CL_BrushEdit_ForceContext(mod); //make sure we don't end up with any loaded brushes.
if (hm)
{
while(hm->numbrushes)
Terr_Brush_DeleteIdx(hm, hm->numbrushes-1);
}
}
else if (cmd == 3)
{
//follows edits after a 2
}
else
Host_EndGame("CL_Parse_BrushEdit: unknown command %i\n", cmd);
}
#endif
#ifndef CLIENTONLY
qboolean SV_Prespawn_Brushes(sizebuf_t *msg, unsigned int *modelindex, unsigned int *lastid)
{
//lastid starts at 0
unsigned int bestid, i;
brushes_t *best;
model_t *mod;
heightmap_t *hm;
while(1)
{
if (*modelindex < MAX_PRECACHE_MODELS)
mod = sv.models[*modelindex];
else
mod = NULL;
if (!mod)
{
if (!(*modelindex)++)
continue;
return false;
}
hm = mod->terrain;
if (!hm || !hm->brushesedited)
{
*modelindex+=1;
*lastid = 0;
continue;
}
if (!*lastid)
{ //make sure the client starts with a clean slate.
MSG_WriteByte(msg, svcfte_brushedit);
MSG_WriteShort(msg, *modelindex);
MSG_WriteByte(msg, 2);
}
//weird loop to try to ensure we never miss any brushes.
//get the lowest index that is 1 higher than our previous.
for (best = NULL, bestid = ~0u, i = 0; i < hm->numbrushes; i++)
{
unsigned int bid = hm->wbrushes[i].id;
if (bid > *lastid && bid <= bestid)
{
best = &hm->wbrushes[i];
bestid = best->id;
if (bestid == *lastid+1)
break;
}
}
if (best)
{
MSG_WriteByte(msg, svcfte_brushedit);
MSG_WriteShort(msg, *modelindex);
MSG_WriteByte(msg, 1);
Brush_Serialise(msg, best);
*lastid = bestid;
return true;
}
*modelindex+=1;
*lastid = 0;
}
}
qboolean SV_Parse_BrushEdit(void)
{
model_t *mod = sv.models[1];
heightmap_t *hm = mod?mod->terrain:NULL;
qboolean authorise = SV_MayCheat() || (host_client->penalties & BAN_VIP);
int cmd = MSG_ReadByte();
unsigned int modelindex = MSG_ReadShort();
int cmd = MSG_ReadByte();
model_t *mod = (modelindex<countof(sv.models))?sv.models[modelindex]:NULL;
heightmap_t *hm = mod?mod->terrain:NULL;
if (cmd == 0)
{
unsigned int brushid = MSG_ReadLong();
@ -6036,6 +6158,7 @@ qboolean SV_Parse_BrushEdit(void)
Terr_Brush_DeleteId(hm, brushid);
MSG_WriteByte(&sv.multicast, svcfte_brushedit);
MSG_WriteShort(&sv.multicast, modelindex);
MSG_WriteByte(&sv.multicast, 0);
MSG_WriteLong(&sv.multicast, brushid);
SV_MulticastProtExt(vec3_origin, MULTICAST_ALL_R, ~0, 0, 0);
@ -6063,6 +6186,7 @@ qboolean SV_Parse_BrushEdit(void)
//FIXME: expand the world entity's sizes if needed?
MSG_WriteByte(&sv.multicast, svcfte_brushedit);
MSG_WriteShort(&sv.multicast, modelindex);
MSG_WriteByte(&sv.multicast, 1);
Brush_Serialise(&sv.multicast, &brush);
SV_MulticastProtExt(vec3_origin, MULTICAST_ALL_R, ~0, 0, 0);
@ -6167,7 +6291,8 @@ void QCBUILTIN PF_brush_get(pubprogfuncs_t *prinst, struct globalvars_s *pr_glob
void QCBUILTIN PF_brush_create(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{
world_t *vmw = prinst->parms->user;
model_t *mod = vmw->Get_CModel(vmw, G_FLOAT(OFS_PARM0));
int modelindex = G_FLOAT(OFS_PARM0);
model_t *mod = vmw->Get_CModel(vmw, modelindex);
heightmap_t *hm = mod?mod->terrain:NULL;
unsigned int numfaces = G_INT(OFS_PARM2);
qcbrushface_t *in_faces = validateqcpointer(prinst, G_INT(OFS_PARM1), sizeof(*in_faces), numfaces, false);
@ -6226,9 +6351,10 @@ void QCBUILTIN PF_brush_create(pubprogfuncs_t *prinst, struct globalvars_s *pr_g
{
G_INT(OFS_RETURN) = nb->id;
#ifndef CLIENTONLY
if (sv.state)
if (sv.state && modelindex > 0)
{
MSG_WriteByte(&sv.multicast, svcfte_brushedit);
MSG_WriteShort(&sv.multicast, modelindex);
MSG_WriteByte(&sv.multicast, 1);
Brush_Serialise(&sv.multicast, nb);
SV_MulticastProtExt(vec3_origin, MULTICAST_ALL_R, ~0, 0, 0);
@ -6236,9 +6362,10 @@ void QCBUILTIN PF_brush_create(pubprogfuncs_t *prinst, struct globalvars_s *pr_g
}
#endif
#ifndef SERVERONLY
if (cls.state)
if (cls.state && modelindex > 0)
{
MSG_WriteByte(&cls.netchan.message, clcfte_brushedit);
MSG_WriteShort(&cls.netchan.message, modelindex);
MSG_WriteByte(&cls.netchan.message, 1);
Brush_Serialise(&cls.netchan.message, nb);
return;
@ -6251,7 +6378,8 @@ void QCBUILTIN PF_brush_create(pubprogfuncs_t *prinst, struct globalvars_s *pr_g
void QCBUILTIN PF_brush_delete(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
{
world_t *vmw = prinst->parms->user;
model_t *mod = vmw->Get_CModel(vmw, G_FLOAT(OFS_PARM0));
int modelindex = G_FLOAT(OFS_PARM0);
model_t *mod = vmw->Get_CModel(vmw, modelindex);
heightmap_t *hm = mod?mod->terrain:NULL;
unsigned int brushid = G_INT(OFS_PARM1);
@ -6261,9 +6389,10 @@ void QCBUILTIN PF_brush_delete(pubprogfuncs_t *prinst, struct globalvars_s *pr_g
Terr_Brush_DeleteId(hm, brushid);
#ifndef CLIENTONLY
if (sv.state)
if (sv.state && modelindex > 0)
{
MSG_WriteByte(&sv.multicast, svcfte_brushedit);
MSG_WriteShort(&sv.multicast, modelindex);
MSG_WriteByte(&sv.multicast, 0);
MSG_WriteLong(&sv.multicast, brushid);
SV_MulticastProtExt(vec3_origin, MULTICAST_ALL_R, ~0, 0, 0);
@ -6271,9 +6400,10 @@ void QCBUILTIN PF_brush_delete(pubprogfuncs_t *prinst, struct globalvars_s *pr_g
}
#endif
#ifndef SERVERONLY
if (cls.state)
if (cls.state && modelindex > 0)
{
MSG_WriteByte(&cls.netchan.message, clcfte_brushedit);
MSG_WriteShort(&cls.netchan.message, modelindex);
MSG_WriteByte(&cls.netchan.message, 0);
MSG_WriteLong(&cls.netchan.message, brushid);
return;
@ -6689,8 +6819,12 @@ qboolean Terr_ReformEntitiesLump(model_t *mod, heightmap_t *hm, char *entities)
brush.planes = planes;
brush.faces = faces;
brush.id = 0;
if (numplanes)
if (numplanes && subhm)
{
qboolean oe = subhm->brushesedited;
Terr_Brush_Insert(submod, subhm, &brush);
subhm->brushesedited = oe;
}
numplanes = 0;
inbrush = false;
continue;

View File

@ -4496,7 +4496,7 @@ void ModBrush_LoadGLStuff(void *ctx, void *data, size_t a, size_t b)
// maps |= SHADER_HASNORMALMAP;
if (gl_specular.ival)
maps |= SHADER_HASGLOSS;
R_BuildLegacyTexnums(mod->textures[a]->shader, mod->textures[a]->name, loadname, 0, maps, TF_MIP4_SOLID8, mod->textures[a]->width, mod->textures[a]->height, mod->textures[a]->mips, mod->textures[a]->palette);
R_BuildLegacyTexnums(mod->textures[a]->shader, mod->textures[a]->name, loadname, maps, 0, TF_MIP4_SOLID8, mod->textures[a]->width, mod->textures[a]->height, mod->textures[a]->mips, mod->textures[a]->palette);
BZ_Free(mod->textures[a]->mips[0]);
}
}
@ -4926,7 +4926,6 @@ SPRITES
void Mod_LoadSpriteFrameShader(model_t *spr, int frame, int subframe, mspriteframe_t *frameinfo)
{
#ifndef SERVERONLY
int i;
char *shadertext;
char name[MAX_QPATH];
qboolean litsprite = false;
@ -4944,6 +4943,7 @@ void Mod_LoadSpriteFrameShader(model_t *spr, int frame, int subframe, mspritefra
#ifndef NOLEGACY
else
{
int i;
/*
A quick note on tenebrae and sprites: In tenebrae, sprites are always lit, unless the light_lev field is set (which makes it fullbright).
While its generally preferable and more consistent to assume lit sprites, this is incompatible with vanilla quake and thus unacceptable to us, but you can set the mod_assumelitsprites cvar if you want it.

View File

@ -1028,6 +1028,7 @@ qboolean Terr_DownloadedSection(char *fname);
void CL_Parse_BrushEdit(void);
qboolean SV_Parse_BrushEdit(void);
qboolean SV_Prespawn_Brushes(sizebuf_t *msg, unsigned int *modelindex, unsigned int *lastid);
#endif

View File

@ -370,6 +370,7 @@ typedef struct heightmap_s
brushes_t *wbrushes;
unsigned int numbrushes;
unsigned int brushidseq;
qboolean brushesedited;
} heightmap_t;
typedef struct terrainfuncs_s

View File

@ -46,7 +46,7 @@ static void *GLVID_getsdlglfunction(char *functionname)
}
#if SDL_MAJOR_VERSION >= 2
void *GLVID_CreateCursor (char *filename, float hotx, float hoty, float scale)
void *GLVID_CreateCursor (const char *filename, float hotx, float hoty, float scale)
{
int width;
int height;

File diff suppressed because it is too large Load Diff

View File

@ -7,12 +7,11 @@
vfsfile_t *FS_GZ_DecompressWriteFilter(vfsfile_t *outfile, qboolean autoclosefile);
#if defined(WEBCLIENT)
#ifndef NPFTE
static struct dl_download *activedownloads;
#endif
#if defined(WEBCLIENT)
#if defined(FTE_TARGET_WEB)

View File

@ -500,12 +500,14 @@ static void FSPPAPI_ReadFile(searchpathfuncs_t *handle, flocation_t *loc, char *
VFS_CLOSE(f);
}
searchpathfuncs_t *QDECL FSPPAPI_OpenPath(vfsfile_t *mustbenull, const char *desc)
searchpathfuncs_t *QDECL FSPPAPI_OpenPath(vfsfile_t *mustbenull, const char *desc, const char *prefix)
{
pppath_t *np;
int dlen = strlen(desc);
if (mustbenull)
return NULL;
if (prefix && *prefix)
return NULL; //don't try to support this. too risky with absolute paths etc.
np = Z_Malloc(sizeof(*np) + dlen);
if (np)
{

View File

@ -294,6 +294,6 @@ void GLVID_Update (vrect_t *rects);
int GLVID_SetMode (rendererstate_t *info, unsigned char *palette);
void GLVID_SetCaption(char *caption)
void GLVID_SetCaption(const char *caption)
{
}

View File

@ -98,7 +98,6 @@ int PPAPI_InitCard (soundcardinfo_t *sc, int cardnum)
sc->GetDMAPos = PPAPI_GetDMAPos;
sc->Lock = PPAPI_LockBuffer;
sc->Unlock = PPAPI_UnlockBuffer;
sc->SetWaterDistortion = PPAPI_SetUnderWater;
sc->Shutdown = PPAPI_Shutdown;

View File

@ -169,7 +169,7 @@ void INS_ReInit(void)
void INS_Shutdown(void)
{
}
void INS_EnumerateDevices(void *ctx, void(*callback)(void *ctx, char *type, char *devicename, int *qdevid))
void INS_EnumerateDevices(void *ctx, void(*callback)(void *ctx, const char *type, const char *devicename, int *qdevid))
{
}

View File

@ -7411,6 +7411,22 @@ QCC_sref_t QCC_EvaluateCast(QCC_sref_t src, QCC_type_t *cast, pbool implicit)
{
QCC_type_t *tmp;
int totype;
if ( (cast->type == ev_accessor && cast->parentclass == src.cast)
|| (src.cast->type == ev_accessor && src.cast->parentclass == cast))
{
if (implicit)
{
char typea[256];
char typeb[256];
TypeName(src.cast, typea, sizeof(typea));
TypeName(cast, typeb, sizeof(typeb));
QCC_PR_ParseWarning(0, "Implicit cast from %s to %s", typea, typeb);
}
src.cast = cast;
return src;
}
//casting from an accessor uses the base type of that accessor (this allows us to properly read void* accessors)
while (src.cast->type == ev_accessor)
src.cast = src.cast->parentclass;
@ -7570,6 +7586,8 @@ QCC_ref_t *QCC_PR_RefTerm (QCC_ref_t *retbuf, unsigned int exprflags)
{
e = QCC_PR_Expression (NOT_PRIORITY, EXPR_DISALLOW_COMMA|EXPR_WARN_ABOVE_1);
t = e.cast->type;
if (t == ev_accessor)
t = e.cast->parentclass->type;
if (t == ev_float)
e2 = QCC_PR_Statement (&pr_opcodes[OP_BITNOT_F], e, nullsref, NULL);
else if (t == ev_integer)
@ -7726,6 +7744,9 @@ QCC_ref_t *QCC_PR_RefTerm (QCC_ref_t *retbuf, unsigned int exprflags)
int QCC_canConv(QCC_sref_t from, etype_t to)
{
while(from.cast->type == ev_accessor)
from.cast = from.cast->parentclass;
if (from.cast->type == to)
return 0;
@ -9951,13 +9972,31 @@ void QCC_PR_ParseStatement (void)
pbool striptruth = false;
pbool stripfalse = false;
const QCC_eval_t *eval;
pbool negate = QCC_PR_CheckKeyword(keyword_not, "not");
int negate = QCC_PR_CheckKeyword(keyword_not, "not")/*hexenc*/;
if (!negate && QCC_PR_CheckToken("!"))
{
QCC_PR_ParseWarning (WARN_FTE_SPECIFIC, "if !() is specific to fteqcc");
negate = 2;
}
else if (negate && qcc_targetformat != QCF_HEXEN2 && qcc_targetformat != QCF_FTEH2)
QCC_PR_ParseWarning (WARN_FTE_SPECIFIC, "if not() is specific to fteqcc or hexen2");
QCC_PR_Expect ("(");
conditional = 1;
e = QCC_PR_Expression (TOP_PRIORITY, 0);
conditional = 0;
if (negate == 2)
{
if (e.cast->type == ev_string/*deal with empty properly*/
|| e.cast->type == ev_float/*deal with -0.0*/
|| e.cast->type == ev_accessor/*its complicated*/ )
{
e = QCC_PR_GenerateLogicalNot(e, "Type mismatch: !%s");
negate = 0;
}
}
eval = QCC_SRef_EvalConst(e);
// negate = negate != 0;

View File

@ -9579,7 +9579,7 @@ BuiltinList_t BuiltinList[] = { //nq qw h2 ebfs
{"vectoyaw", PF_vectoyaw, 13, 13, 13, 0, D("float(vector v, optional entity reference)", "Given a direction vector, returns the yaw angle in which that direction vector points. If an entity is passed, the yaw angle will be relative to that entity's gravity direction.")},
{"spawn", PF_Spawn, 14, 14, 14, 0, D("entity()", "Adds a brand new entity into the world! Hurrah, you're now a parent!")},
{"remove", PF_Remove, 15, 15, 15, 0, D("void(entity e)", "Destroys the given entity and clears some limited fields (including model, modelindex, solid, classname). Any references to the entity following the call are an error. After two seconds, the entity will be reused, in the interim you can unfortunatly still read its fields to see if the reference is no longer valid.")},
{"traceline", PF_svtraceline, 16, 16, 16, 0, D("void(vector v1, vector v2, float flags, entity ent)", "Traces an infinitely thin line through the world from v1 towards v2.\nWill not collide with ent, ent.owner, or any entity who's owner field refers to ent.\nThere are no side effects beyond the trace_* globals being written.\nflags&MOVE_NOMONSTERS will not impact on non-bsp entities.\nflags&MOVE_MISSILE will impact with increased size.\nflags&MOVE_HITMODEL will impact upon model meshes, instead of their bounding boxes.\nflags&MOVE_TRIGGERS will also stop on triggers\nflags&MOVE_EVERYTHING will stop if it hits anything, even non-solid entities.\nflags&MOVE_LAGGED will backdate entity positions for the purposes of this builtin according to the indicated player ent's latency, to provide lag compensation.")},
{"traceline", PF_svtraceline, 16, 16, 16, 0, D("void(vector v1, vector v2, float flags, entity ent)", "Traces an infinitely thin line through the world from v1 towards v2.\nWill not collide with ent, ent.owner, or any entity who's owner field refers to ent.\nThe passed entity will also be used to determine whether to use a capsule trace, the contents that the trace should impact, and a couple of other extra fields that define the trace.\nThere are no side effects beyond the trace_* globals being written.\nflags&MOVE_NOMONSTERS will not impact on non-bsp entities.\nflags&MOVE_MISSILE will impact with increased size.\nflags&MOVE_HITMODEL will impact upon model meshes, instead of their bounding boxes.\nflags&MOVE_TRIGGERS will also stop on triggers\nflags&MOVE_EVERYTHING will stop if it hits anything, even non-solid entities.\nflags&MOVE_LAGGED will backdate entity positions for the purposes of this builtin according to the indicated player ent's latency, to provide lag compensation.")},
{"checkclient", PF_checkclient, 17, 17, 17, 0, D("entity()", "Returns one of the player entities. The returned player will change periodically.")},
{"find", PF_FindString, 18, 18, 18, 0, D("entity(entity start, .string fld, string match)", "Scan for the next entity with a given field set to the given 'match' value. start should be either world, or the previous entity that was found. Returns world on failure/if there are no more.")},
{"precache_sound", PF_precache_sound, 19, 19, 19, 0, D("string(string s)", "Precaches a sound, making it known to clients and loading it from disk. This builtin (strongly) should be called during spawn functions. This builtin must be called for the sound before the sound builtin is called, or it might not even be heard.")},
@ -11396,7 +11396,7 @@ void PR_DumpPlatform_f(void)
{"MOVE_EVERYTHING", "const float", QW|NQ|CS, "This type of trace will hit solids and triggers alike. Even non-solid entities.", MOVE_EVERYTHING},
{"MOVE_LAGGED", "const float", QW|NQ, "Will use antilag based upon the player's latency. Traces will be performed against old positions for entities instead of their current origin.", MOVE_LAGGED},
{"MOVE_ENTCHAIN", "const float", QW|NQ|CS, "Returns a list of entities impacted via the trace_ent.chain field", MOVE_ENTCHAIN},
// {"MOVE_ONLYENT", "const float", QW|NQ|CS, "Traces that use this trace type will collide against *only* the entity specified, and will ignore all owner/solid/dimension etc fields, they will still adhere to contents though.", MOVE_ONLYENT},
{"MOVE_OTHERONLY", "const float", QW|NQ|CS, "Traces that use this trace type will collide against *only* the entity specified via the 'other' global, and will ignore all owner/solid_not/dimension etc rules, they will still adhere to contents and bsp/bbox rules though.", MOVE_OTHERONLY},
{"RESTYPE_MODEL", "const float", ALL, "RESTYPE_* constants are used as arguments with the resourcestatus builtin.", RESTYPE_MODEL},
{"RESTYPE_SOUND", "const float", ALL, "precache_sound", RESTYPE_SOUND},

View File

@ -378,7 +378,9 @@ enum
PRESPAWN_SPAWNSTATIC,
PRESPAWN_AMBIENTSOUND,
PRESPAWN_BASELINES,
PRESPAWN_DONE
PRESPAWN_SPAWN,
PRESPAWN_BRUSHES,
PRESPAWN_COMPLETED
};
enum
@ -402,6 +404,7 @@ typedef struct client_s
unsigned int prespawn_stage;
unsigned int prespawn_idx;
unsigned int prespawn_idx2;
qboolean prespawn_allow_modellist;
qboolean prespawn_allow_soundlist;

View File

@ -4028,7 +4028,9 @@ qboolean SV_ReadPackets (float *delay)
if (cl->delay > 0)
{
#ifdef NQPROT
dominping:
#endif
if (cl->state < cs_connected)
break;
if (net_message.cursize > sizeof(svs.free_lagged_packet->data))

View File

@ -1864,7 +1864,7 @@ void SV_MVD_SendInitialGamestate(mvddest_t *dest)
demo.recorder.prespawn_stage = PRESPAWN_SERVERINFO;
demo.recorder.prespawn_idx = 0;
demo.recorder.netchan.message = buf;
while (demo.recorder.prespawn_stage != PRESPAWN_DONE)
while (demo.recorder.prespawn_stage != PRESPAWN_COMPLETED)
{
if (demo.recorder.prespawn_stage == PRESPAWN_MAPCHECK)
{

View File

@ -3138,12 +3138,11 @@ void SV_SendClientMessages (void)
}
SV_ReplaceEntityFrame(c, c->netchan.outgoing_sequence);
SV_SendClientPrespawnInfo(c);
if (c->state == cs_spawned)
SV_SendClientDatagram (c);
else
{
SV_SendClientPrespawnInfo(c);
SV_DarkPlacesDownloadChunk(c, &c->datagram);
fnum = c->netchan.outgoing_sequence;
sentbytes = Netchan_Transmit (&c->netchan, c->datagram.cursize, c->datagram.data, SV_RateForClient(c)); // just update reliable

View File

@ -560,11 +560,13 @@ char *Sys_ConsoleInput (void)
static char text[256];
int len;
#ifdef SUBSERVERS
if (SSV_IsSubServer())
{
SSV_CheckFromMaster();
return NULL;
}
#endif
if (!stdin_ready || !do_stdin)
return NULL; // the select didn't say it was ready

View File

@ -938,7 +938,7 @@ void SV_SendClientPrespawnInfo(client_t *client)
//much of this function is written to fill packets enough to overflow them (assuming max packet sizes are large enough), but some bits are lazy and just backbuffer as needed.
//FIXME: have per-stage indicies, to allow returning to a previous stage when new precaches or whatever get added
if (client->num_backbuf || client->prespawn_stage == PRESPAWN_DONE)
if (client->num_backbuf || client->prespawn_stage == PRESPAWN_COMPLETED)
{
//don't spam too much.
return;
@ -1368,6 +1368,7 @@ void SV_SendClientPrespawnInfo(client_t *client)
{
client->prespawn_stage++;
client->prespawn_idx = 0;
client->prespawn_idx2 = 0;
break;
}
@ -1513,24 +1514,37 @@ void SV_SendClientPrespawnInfo(client_t *client)
client->prespawn_idx++;
}
}
if (client->prespawn_stage == PRESPAWN_DONE)
if (client->prespawn_stage == PRESPAWN_SPAWN)
{
if (!client->prespawn_idx)
//we'll spawn the client and then send all the updating stuff only when we know the channel is clear, by pinging the client for it.
if (ISNQCLIENT(client))
{
//we'll spawn the client and then send all the updating stuff only when we know the channel is clear, by pinging the client for it.
if (ISNQCLIENT(client))
//effectively a cmd spawn... but also causes the client to actually send the player's name too.
ClientReliableWrite_Begin (client, svc_signonnum, 2);
ClientReliableWrite_Byte (client, 2);
}
else
{
char *cmd = va("cmd spawn %i\n",svs.spawncount);
ClientReliableWrite_Begin(client, svc_stufftext, 2+strlen(cmd));
ClientReliableWrite_String(client, cmd);
}
client->prespawn_stage++;
}
//this is extra stuff that will happen after we're on the server
if (client->prespawn_stage == PRESPAWN_BRUSHES)
{ //when brush editing, connecting clients need a copy of all the brushes.
while (client->netchan.message.cursize < maxsize)
{
if (!SV_Prespawn_Brushes(&client->netchan.message, &client->prespawn_idx, &client->prespawn_idx2))
{
//effectively a cmd spawn... but also causes the client to actually send the player's name too.
ClientReliableWrite_Begin (client, svc_signonnum, 2);
ClientReliableWrite_Byte (client, 2);
client->prespawn_stage++;
client->prespawn_idx = 0;
client->prespawn_idx2 = 0;
break;
}
else
{
char *cmd = va("cmd spawn %i\n",svs.spawncount);
ClientReliableWrite_Begin(client, svc_stufftext, 2+strlen(cmd));
ClientReliableWrite_String(client, cmd);
}
client->prespawn_idx++;
}
}
}
@ -1615,7 +1629,7 @@ void SVQW_Spawn_f (void)
Con_Printf ("Spawn not valid -- already spawned\n");
return;
}
if (host_client->prespawn_stage != PRESPAWN_DONE)
if (host_client->prespawn_stage <= PRESPAWN_SPAWN)
{
Con_Printf ("%s sent spawn without prespawn!\n", host_client->name);
SV_New_f ();
@ -3497,8 +3511,10 @@ void SV_Say (qboolean team)
if (*p == '"')
{
p++;
p[Q_strlen(p)-1] = 0;
char *e = p + strlen(p)-1;
*p++ = 0;
if (*e == '\"')
*e = 0;
}
if (strlen(text)+strlen(p)+2 >= sizeof(text)-10)

View File

@ -1901,11 +1901,10 @@ trace_t World_Move (world_t *w, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t e
clip.hitcontentsmask = MASK_POINTSOLID; /*ignores playerclip but hits everything else*/
clip.capsule = (passedict->xv->geomtype == GEOMTYPE_CAPSULE);
if (type & MOVE_ONLYENT)
if (type & MOVE_OTHERONLY)
{
if (!passedict)
passedict = w->edicts;
return World_ClipMoveToEntity (w, passedict, passedict->v->origin, start, mins, maxs, end, hullnum, type & MOVE_HITMODEL, clip.capsule, clip.hitcontentsmask);
wedict_t *other = WEDICT_NUM(w->progs, *w->g.other);
return World_ClipMoveToEntity (w, other, other->v->origin, start, mins, maxs, end, hullnum, type & MOVE_HITMODEL, clip.capsule, clip.hitcontentsmask);
}
// clip to world

View File

@ -1,6 +1,12 @@
#ifdef VERTEX_SHADER
#define attribute in
#define varying out
out gl_PerVertex
{
vec4 gl_Position;
};
#else
#define varying in
#endif

View File

@ -553,7 +553,7 @@ qboolean VK_LoadBlob(program_t *prog, void *blobdata, const char *name)
pipeLayoutCreateInfo.flags = 0;
pipeLayoutCreateInfo.setLayoutCount = countof(sets);
pipeLayoutCreateInfo.pSetLayouts = sets;
pipeLayoutCreateInfo.pushConstantRangeCount = !strncmp(name, "fixedemu#CONSTCOLOUR", 12);
pipeLayoutCreateInfo.pushConstantRangeCount = !strncmp(name, "fixedemu", 8);
pipeLayoutCreateInfo.pPushConstantRanges = push;
VkAssert(vkCreatePipelineLayout(vk.device, &pipeLayoutCreateInfo, vkallocationcb, &layout));
prog->layout = layout;
@ -727,10 +727,10 @@ static struct descpool *VKBE_CreateDescriptorPool(void)
dpi.pPoolSizes = dpisz;
dpisz[0].type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
dpisz[0].descriptorCount = 2;
dpisz[0].descriptorCount = 2*dpi.maxSets;
dpisz[1].type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
dpisz[1].descriptorCount = MAX_TMUS;
dpisz[1].descriptorCount = MAX_TMUS*dpi.maxSets;
VkAssert(vkCreateDescriptorPool(vk.device, &dpi, NULL, &np->pool));

View File

@ -176,10 +176,18 @@ static void VK_DestroySwapChain(void)
VK_DestroyVkTexture(&vk.backbufs[i].depth);
}
#ifdef THREADACQUIRE
while (vk.aquirenext < vk.aquirelast)
{
VkAssert(vkWaitForFences(vk.device, 1, &vk.acquirefences[vk.aquirenext%ACQUIRELIMIT], VK_FALSE, UINT64_MAX));
vk.aquirenext++;
}
for (i = 0; i < ACQUIRELIMIT; i++)
{
vkDestroyFence(vk.device, vk.acquirefences[i], vkallocationcb);
if (vk.acquirefences[i])
vkDestroyFence(vk.device, vk.acquirefences[i], vkallocationcb);
vk.acquirefences[i] = VK_NULL_HANDLE;
}
#endif
@ -201,7 +209,10 @@ static void VK_DestroySwapChain(void)
}
if (vk.swapchain)
{
vkDestroySwapchainKHR(vk.device, vk.swapchain, vkallocationcb);
vk.swapchain = VK_NULL_HANDLE;
}
if (vk.backbufs)
free(vk.backbufs);
@ -1048,6 +1059,7 @@ void VK_R_DeInit (void)
{
R_GAliasFlushSkinCache(true);
Surf_DeInit();
VK_DestroySwapChain();
VKBE_Shutdown();
Shader_Shutdown();
Image_Shutdown();
@ -2065,11 +2077,11 @@ void VKBE_RenderToTextureUpdate2d(qboolean destchanged)
static void VK_CreateRenderPass(void)
{
int pass;
VkAttachmentReference color_reference;
VkAttachmentReference depth_reference;
VkAttachmentDescription attachments[2] = {{0}};
VkSubpassDescription subpass = {0};
VkRenderPassCreateInfo rp_info = {VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO};
static VkAttachmentReference color_reference;
static VkAttachmentReference depth_reference;
static VkAttachmentDescription attachments[2] = {{0}};
static VkSubpassDescription subpass = {0};
static VkRenderPassCreateInfo rp_info = {VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO};
for (pass = 0; pass < 3; pass++)
{
@ -2673,7 +2685,10 @@ void VK_Shutdown(void)
vkDestroyDevice(vk.device, vkallocationcb);
if (vk_debugcallback)
{
vkDestroyDebugReportCallbackEXT(vk.instance, vk_debugcallback, vkallocationcb);
vk_debugcallback = VK_NULL_HANDLE;
}
vkDestroyInstance(vk.instance, vkallocationcb);
Sys_DestroyMutex(vk.swapchain_mutex);
Sys_DestroyConditional(vk.submitcondition);

120
engine/vulkan/vk_platform.h Normal file
View File

@ -0,0 +1,120 @@
//
// File: vk_platform.h
//
/*
** Copyright (c) 2014-2015 The Khronos Group Inc.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#ifndef VK_PLATFORM_H_
#define VK_PLATFORM_H_
#ifdef __cplusplus
extern "C"
{
#endif // __cplusplus
/*
***************************************************************************************************
* Platform-specific directives and type declarations
***************************************************************************************************
*/
/* Platform-specific calling convention macros.
*
* Platforms should define these so that Vulkan clients call Vulkan commands
* with the same calling conventions that the Vulkan implementation expects.
*
* VKAPI_ATTR - Placed before the return type in function declarations.
* Useful for C++11 and GCC/Clang-style function attribute syntax.
* VKAPI_CALL - Placed after the return type in function declarations.
* Useful for MSVC-style calling convention syntax.
* VKAPI_PTR - Placed between the '(' and '*' in function pointer types.
*
* Function declaration: VKAPI_ATTR void VKAPI_CALL vkCommand(void);
* Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void);
*/
#if defined(_WIN32)
// On Windows, Vulkan commands use the stdcall convention
#define VKAPI_ATTR
#define VKAPI_CALL __stdcall
#define VKAPI_PTR VKAPI_CALL
#elif defined(__ANDROID__) && defined(__ARM_EABI__) && !defined(__ARM_ARCH_7A__)
// Android does not support Vulkan in native code using the "armeabi" ABI.
#error "Vulkan requires the 'armeabi-v7a' or 'armeabi-v7a-hard' ABI on 32-bit ARM CPUs"
#elif defined(__ANDROID__) && defined(__ARM_ARCH_7A__)
// On Android/ARMv7a, Vulkan functions use the armeabi-v7a-hard calling
// convention, even if the application's native code is compiled with the
// armeabi-v7a calling convention.
#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))
#define VKAPI_CALL
#define VKAPI_PTR VKAPI_ATTR
#else
// On other platforms, use the default calling convention
#define VKAPI_ATTR
#define VKAPI_CALL
#define VKAPI_PTR
#endif
#include <stddef.h>
#if !defined(VK_NO_STDINT_H)
#if defined(_MSC_VER) && (_MSC_VER < 1600)
typedef signed __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef signed __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
#include <stdint.h>
#endif
#endif // !defined(VK_NO_STDINT_H)
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
// Platform-specific headers required by platform window system extensions.
// These are enabled prior to #including "vulkan.h". The same enable then
// controls inclusion of the extension interfaces in vulkan.h.
#ifdef VK_USE_PLATFORM_ANDROID_KHR
#include <android/native_window.h>
#endif
#ifdef VK_USE_PLATFORM_MIR_KHR
#include <mir_toolkit/client_types.h>
#endif
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
#include <wayland-client.h>
#endif
#ifdef VK_USE_PLATFORM_WIN32_KHR
#include <windows.h>
#endif
#ifdef VK_USE_PLATFORM_XLIB_KHR
#include <X11/Xlib.h>
#endif
#ifdef VK_USE_PLATFORM_XCB_KHR
#include <xcb/xcb.h>
#endif
#endif

3934
engine/vulkan/vulkan.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,9 @@
//emscripten's download mechanism lacks usable progress indicators.
void emscriptenfte_async_wget_data2(const char *url, void *ctx, void (*onload)(void*ctx,void*buf,int sz), void (*onerror)(void*ctx,int code), void (*onprogress)(void*ctx,int prog,int total));
//changes the page away from quake (oh noes!) or downloads something.
void emscriptenfte_window_location(const char *url);
//filesystem buffers are implemented in javascript so that we are not bound by power-of-two heap limitations quite so much.
//also, we can't use emscripten's stdio because it reserves 16m file handles or something.
//these buffers do not track file offsets nor file access permissions.

View File

@ -28,6 +28,13 @@ mergeInto(LibraryManager.library,
console.log(msg);
alert(msg);
},
emscriptenfte_window_location : function(msg)
{
msg = Pointer_stringify(msg);
console.log("Redirecting page to " + msg);
window.location = msg;
},
emscriptenfte_handle_alloc__deps : ['$FTEH'],
emscriptenfte_handle_alloc : function(h)

View File

@ -142,7 +142,10 @@ void *Sys_GetAddressForName(dllhandle_t *module, const char *exportname)
void Sys_BrowserRedirect_f(void)
{
emscriptenfte_window_location(Cmd_Argv(1));
}
void Sys_Init(void)
{
@ -152,6 +155,8 @@ void Sys_Init(void)
//these are not really supported. so silence any spam that suggests we do something about something not even supported.
vid_width.flags &= ~CVAR_RENDERERLATCH;
vid_height.flags &= ~CVAR_RENDERERLATCH;
Cmd_AddCommand("sys_browserredirect", Sys_BrowserRedirect_f);
}
void Sys_Shutdown(void)
{

View File

@ -4,13 +4,16 @@ ifeq ($(FTE_TARGET),win32)
PLUG_NATIVE_EXT=_x86.dll
PLUG_LDFLAGS=-L../engine/libs/mingw-libs -lzlib
BITS=32
PLUG_LDFLAGS_DL=
endif
ifeq ($(FTE_TARGET),win64)
PLUG_NATIVE_EXT=_x64.dll
PLUG_LDFLAGS=-L../engine/libs/mingw64-libs -lz -Wl,--support-old-code
BITS=64
PLUG_LDFLAGS_DL=
endif
PLUG_LDFLAGS_DL?=-ldl
PLUG_LDFLAGS?=-L/usr/local/lib -Wl,-R/usr/local/lib -lz -lm
ifneq ($(PLUG_NATIVE_EXT),)
@ -150,7 +153,7 @@ $(ODE_LIB): $(OUT_DIR)/../ode-$(ODE_VER).tar.gz
ODE_FILES=../engine/common/com_phys_ode.c ../engine/common/mathlib.c plugin.c qvm_api.c $(ODE_LIB)
$(OUT_DIR)/fteplug_ode$(PLUG_NATIVE_EXT): $(ODE_FILES)
$(CC) -s $(BASE_CFLAGS) $(CFLAGS) -DFTEPLUGIN -DODE_STATIC -o $@ -shared $(PLUG_CFLAGS) -I$(ODE_BASE)ode-$(ODE_VER)/include $(ODE_FILES) $(PLUG_DEFFILE) $(PLUG_LDFLAGS) -lstdc++ -lpthread
$(CC) -flto -s $(BASE_CFLAGS) $(CFLAGS) -Os -DFTEPLUGIN -DODE_STATIC -o $@ -shared $(PLUG_CFLAGS) -I$(ODE_BASE)ode-$(ODE_VER)/include $(ODE_FILES) $(PLUG_DEFFILE) $(PLUG_LDFLAGS) -static-libgcc `$(CC) -print-file-name=libstdc++.a` -lpthread
#NATIVE_PLUGINS+=ode
@ -186,7 +189,7 @@ $(OUT_DIR)/fteplug_qi$(PLUG_NATIVE_EXT): qi/qi.c jabber/xml.c plugin.c qvm_api.c
NATIVE_PLUGINS+=qi
$(OUT_DIR)/fteplug_cef$(PLUG_NATIVE_EXT): cef/cef.c plugin.c qvm_api.c
$(CC) $(BASE_CFLAGS) $(CFLAGS) -DFTEPLUGIN -o $@ -shared $(PLUG_CFLAGS) -Icef/2623 $^ $(PLUG_DEFFILE) $(PLUG_LDFLAGS) -Wl,-rpath,. -ldl
$(CC) $(BASE_CFLAGS) $(CFLAGS) -DFTEPLUGIN -o $@ -shared $(PLUG_CFLAGS) -Icef/2623 $^ $(PLUG_DEFFILE) $(PLUG_LDFLAGS) -Wl,-rpath,. $(PLUG_LDFLAGS_DL)
#NATIVE_PLUGINS+=cef
#irc plugin can still be built as a qvm.

View File

@ -445,7 +445,7 @@ static qboolean browser_handle_query(const char *req, char *buffer, size_t buffe
static int CEF_CALLBACK browser_on_process_message_received(cef_client_t* self, cef_browser_t* browser, cef_process_id_t source_process, cef_process_message_t* message)
{
int handled = false;
browser_t *br = (browser_t*)((char*)self - offsetof(browser_t, request_handler));
// browser_t *br = (browser_t*)((char*)self - offsetof(browser_t, request_handler));
cef_string_userfree_t msgnameunusable = message->get_name(message);
cef_string_utf8_t name = {NULL};
cef_string_to_utf8(msgnameunusable->str, msgnameunusable->length, &name);
@ -637,7 +637,7 @@ static void CEF_CALLBACK browser_on_status_message(cef_display_handler_t* self,
//request_handler methods
static int CEF_CALLBACK browser_on_before_browse(cef_request_handler_t* self, cef_browser_t* browser, cef_frame_t* frame, cef_request_t* request, int is_redirect)
{
browser_t *br = (browser_t*)((char*)self - offsetof(browser_t, request_handler));
// browser_t *br = (browser_t*)((char*)self - offsetof(browser_t, request_handler));
cef_release(browser);
cef_release(frame);
@ -903,7 +903,7 @@ static int CEF_CALLBACK fsfunc_execute(cef_v8handler_t* self, const cef_string_t
cef_v8context_t *v8ctx = cef_v8context_get_current_context();
cef_browser_t *browser = v8ctx->get_browser(v8ctx);
cef_frame_t *frame = v8ctx->get_frame(v8ctx);
int64 frame_id = frame->get_identifier(frame);
// int64 frame_id = frame->get_identifier(frame);
// cef_string_t key = {L"omgwtfitkindaworks"};
// key.length = wcslen(key.str);
@ -954,7 +954,7 @@ static int CEF_CALLBACK fsfunc_execute(cef_v8handler_t* self, const cef_string_t
static int CEF_CALLBACK render_process_handler_on_process_message_received(cef_render_process_handler_t* self,cef_browser_t* browser, cef_process_id_t source_process,cef_process_message_t* message)
{
int handled = false;
browser_t *br = (browser_t*)((char*)self - offsetof(browser_t, request_handler));
// browser_t *br = (browser_t*)((char*)self - offsetof(browser_t, request_handler));
cef_string_userfree_t msgnameunusable = message->get_name(message);
cef_string_utf8_t name = {NULL};
cef_string_to_utf8(msgnameunusable->str, msgnameunusable->length, &name);

View File

@ -77,7 +77,7 @@ void() wrap_renderscene =
renderscene();
if (autocvar_ca_colourtint)
if (autocvar_ca_colourtint != "")
{
local string shdrname = strcat("tint_", autocvar_ca_colourtint);
/*make sure the shader exist*/
@ -185,7 +185,7 @@ void() wrap_renderscene =
for (i = 0, x = 0; i < editornames.length; i+=1)
{
if (editornames[i])
if (editornames[i] != "")
{
float w = stringwidth(editornames[i], TRUE, '8 8 0') + 8;
if (autocvar_ca_editormode == i)

View File

@ -54,3 +54,7 @@ enum
var string editornames[MODE_COUNT] = {"OPTIONS","LIGHTS","SPLINES", "TERRAIN", "BRUSHES", "PARTICLES", "ENTITIES"};
var float(float vismode) ca_checksave;
#define isnull(v) (!(int)(v))
#define notnull(v) ((int)(v))

View File

@ -189,7 +189,7 @@ void() updatemodelents =
{
string key, value;
key = hash_getkey(ent->fields, i);
if not (key)
if isnull(key)
break;
value = ent->fields[key];
//inject markup into the value so that it doesn't get too corrupted
@ -291,7 +291,7 @@ entedit_t*(entedit_t *o) editor_ents_clone =
{
string key, value;
key = hash_getkey(o->fields, i);
if not (key)
if isnull(key)
break;
value = o->fields[key];
n->fields[key] = value;
@ -312,7 +312,7 @@ void() editor_ents_reload =
for(;;)
{
field = getentitytoken();
if not (field)
if isnull(field)
{
break;
}
@ -324,7 +324,7 @@ void() editor_ents_reload =
for(;;)
{
field = getentitytoken();
if not (field)
if isnull(field)
{
print("Truncated ent lump\n");
return;
@ -372,6 +372,7 @@ void(string shadername, vector min, vector max, vector col) editor_ents_drawbbox
void() editor_ents_add =
{
int e;
string shadername;
if (!tempent)
{
tempent = spawn();
@ -410,25 +411,27 @@ void() editor_ents_add =
if ((gettime(0)*5f) & 1)
continue;
tempent.effects |= EF_NODEPTHTEST;
editor_ents_drawbbox("entboxsel", editents[e].org+editents[e].mins, editents[e].org+editents[e].maxs, editents[e].colourmod);
shadername = "entboxsel";
}
else
{
tempent.effects &= ~EF_NODEPTHTEST;
editor_ents_drawbbox("entbox", editents[e].org+editents[e].mins, editents[e].org+editents[e].maxs, editents[e].colourmod);
shadername = "entbox";
}
if (!editents[e].modelindex)
continue;
if (editents[e].modelindex)
{
tempent.modelindex = editents[e].modelindex;
tempent.alpha = editents[e].alpha;
tempent.scale = editents[e].scale;
tempent.angles = editents[e].ang;
tempent.colormod = editents[e].colourmod;
tempent.modelindex = editents[e].modelindex;
tempent.alpha = editents[e].alpha;
tempent.scale = editents[e].scale;
tempent.angles = editents[e].ang;
tempent.colormod = editents[e].colourmod;
setorigin(tempent, editents[e].org);
addentity(tempent);
setorigin(tempent, editents[e].org);
addentity(tempent);
}
else
editor_ents_drawbbox("entbox", editents[e].org+editents[e].mins, editents[e].org+editents[e].maxs, editents[e].colourmod);
}
};
@ -447,7 +450,7 @@ float(float key, float unic, vector mousepos) editor_ents_key =
if (mousepos_x < 128)
{
editfieldtype = editkey?2:1;
editfieldtype = isnull(editkey)?1:2;
return TRUE;
}
editfieldtype = 0;
@ -455,6 +458,7 @@ float(float key, float unic, vector mousepos) editor_ents_key =
if (vlen(o - t) > 8192)
t = o + normalize(t)*8192;
other = tempent;
for (e = 1; e < numents; e++)
{
if (editents[e].isbsp)
@ -604,7 +608,7 @@ void(vector mousepos) editor_ents_overlay =
{
string key, value;
key = hash_getkey(ent->fields, i);
if not (key)
if isnull(key)
break;
value = ent->fields[key];
col = '1 1 1';

View File

@ -207,10 +207,10 @@ static void() updateloadedparticles =
static void(string descname) loadparticles =
{
float f;
filestream f;
/*kill old string*/
if (particlesfile)
if notnull(particlesfile)
strunzone(particlesfile);
particlesfile = (string)0;
cureffect = 0;
@ -235,7 +235,7 @@ static void(string descname) loadparticles =
static void(string descname) saveparticle =
{
float f;
filestream f;
string newfile;
/*only do this if there's something to save*/

View File

@ -55,7 +55,7 @@ static var float lasttool = ter_blank;
static int painttex;
static float mautorepeattime;
static entity tempent;
static var float texturesearch = -1;
static var searchhandle texturesearch = -1;
static float texturesearchfirst;
static string texturesearchhighlighted;
@ -581,7 +581,7 @@ void(vector mousepos) editor_terrain_overlay =
pos_y += 8;
}
if (texturesearchhighlighted)
if notnull(texturesearchhighlighted)
{
strunzone(texturesearchhighlighted);
texturesearchhighlighted = __NULL__;
@ -617,7 +617,7 @@ void(vector mousepos) editor_terrain_overlay =
if (mousepos_x > pos_x+x*128 && mousepos_y > pos_y && mousepos_x < pos_x+(x+1)*128 && mousepos_y < pos_y+(128+8))
{
if (texturesearchhighlighted)
if notnull(texturesearchhighlighted)
strunzone(texturesearchhighlighted);
texturesearchhighlighted = strzone(fname);
}

View File

@ -33,7 +33,7 @@ nonstatic void(mitem_desktop desktop) M_Configs =
for (i = 0; i < c; i++)
{
string fname = search_getfilename(fs, i);
string iname = substring(fname, 10, -5);
string iname = substring(fname, 13, -5);
string dname = GetFirstLineComment(fname, iname);
iname = sprintf("exec \"%s\"", iname);
if (dname && !fr.findchildcmd(iname))

View File

@ -16,21 +16,16 @@ nonstatic void(mitem_desktop desktop) M_Options_Effects =
float fl = RS_X_MIN_PARENT_MIN|RS_Y_MIN_PARENT_MIN | RS_X_MAX_PARENT_MAX|RS_Y_MAX_OWN_MIN;
float pos = 0;
fr.add(menuitemcheck_spawn(_("Show Framerate"), dp("showfps", "show_fps"), '280 8'), fl, [0, pos], [0, 8]); pos += 8;
fr.add(menuitemcheck_spawn(_("Bloom"), "r_bloom", '280 8'), fl, [0, pos], [0, 8]); pos += 8;
fr.add(menuitemcheck_spawn(_("HDR"), "r_hdr_irisadaptation", '280 8'), fl, [0, pos], [0, 8]); pos += 8;
fr.add(menuitemcheck_spawn(_("Coronas"), "r_coronas", '280 8'), fl, [0, pos], [0, 8]); pos += 8;
fr.add(menuitemcheck_spawn(_("Relief Mapping"), "r_glsl_offsetmapping", '280 8'), fl, [0, pos], [0, 8]); pos += 8;
fr.add(menuitemcheck_spawn(_("Realtime World Lighting"), "r_shadow_realtime_world", '280 8'), fl, [0, pos], [0, 8]); pos += 8;
fr.add(menuitemcheck_spawn(_("Realtime Dynamic Lights"), "r_shadow_realtime_dlight", '280 8'), fl, [0, pos], [0, 8]); pos += 8;
fr.add(menuitemcheck_spawn(_("High Res Textures"), "gl_load24bit", '280 8'), fl, [0, pos], [0, 8]); pos += 8;
fr.add(menuitemcheck_spawn(_("Relief Mapping"), "r_glsl_offsetmapping", '280 8'), fl, [0, pos], [0, 8]); pos += 8;
fr.add(menuitemcheck_spawn(_("Realtime Dynamic Lights"), "r_shadow_realtime_dlight", '280 8'), fl, [0, pos], [0, 8]); pos += 8;
fr.add(menuitemcheck_spawn(_("Realtime World Lighting"), "r_shadow_realtime_world", '280 8'), fl, [0, pos], [0, 8]); pos += 8;
if (assumefalsecheckcommand("r_particledesc"))
fr.add(spawn(mitem_text, item_text:_("Particle Sets"), item_command:"m_particles", item_scale:8, item_flags:IF_RIGHTALIGN), RS_X_MIN_PARENT_MIN|RS_Y_MIN_PARENT_MIN | RS_X_MAX_PARENT_MID|RS_Y_MAX_OWN_MIN, [0, pos], [-8, 8]); pos += 8;
// fr.add(menuitemcombo_spawn(_("Particles"), "r_particledesc", '280 8', _(
// "\"classic\" \"Classic Effects\" "
// "\"spikeset tsshaft\" \"Some lame set\" "
// "\"high tsshaft\" \"High\" "
// )), fl, [0, pos], [0, 8]); pos += 8;
fr.add(menuitemslider_spawn(_("Particle Density"), "r_part_density", '0.25 4 0.25', '280 8'), fl, [0, pos], [0, 8]); pos += 8;
fr.add(menuitemcombo_spawn(_("Water Effects"), "r_waterstyle", '280 8', _(
@ -38,13 +33,22 @@ nonstatic void(mitem_desktop desktop) M_Options_Effects =
"2 \"Ripples\" "
"3 \"Reflections\" "
)), fl, [0, pos], [0, 8]); pos += 8;
fr.add(menuitemcombo_spawn(_("Fish Eye"), "ffov", '280 8', _(
"0 \"Off\" "
if (assumefalsecheckcommand("r_projection"))
fr.add(menuitemcombo_spawn(_("View Projection"), "r_projection", '280 8', _(
"0 \"Standard\" "
"1 \"Stereographic / Pannini\" "
"2 \"Fish-Eye\" "
"3 \"Panoramic\" "
"4 \"Lambert Azimuthal Equal-Area\" "
"5 \"Equirectangular\" "
)), fl, [0, pos], [0, 8]); pos += 8;
if (assumefalsecheckcommand("ffov"))
fr.add(menuitemcombo_spawn(_("View Projection Angle"), "ffov", '280 8', _(
"90 \"Normal\" "
"180 \"180 degrees\" "
"270 \"270 degrees\" "
"360 \"360 degrees\" "
)), fl, [0, pos], [0, 8]); pos += 8;
fr.add(menuitemcheck_spawn(_("Show Framerate"), dp("showfps", "show_fps"), '280 8'), fl, [0, pos], [0, 8]); pos += 8;
fr.add(spawn(mitem_text, item_text:_("Apply"), item_command:"vid_restart", item_scale:8, item_flags:IF_RIGHTALIGN), RS_X_MIN_PARENT_MIN|RS_Y_MIN_PARENT_MIN | RS_X_MAX_PARENT_MID|RS_Y_MAX_OWN_MIN, [0, pos], [-8, 8]); pos += 8;

View File

@ -22,16 +22,33 @@ nonstatic void(mitem_desktop desktop) M_Options_Hud =
float fs = search_begin("huds/*.cfg", TRUE, TRUE);
float fc = search_getsize(fs);
//add the options
for (i = 0, float y = 0; i < fc; i++)
float y = 0;
string fname = "huds/hud_default.cfg";
string iname = "Default";
string dname = iname;
if ((int)whichpack(fname))
{
string fname = search_getfilename(fs, i);
string iname = substring(fname, 5, -5);
string dname = GetFirstLineComment(fname, iname);
print(sprintf("\"%s\" \"%s\" - \"%s\"\n", fname, iname, dname));
dname = GetFirstLineComment(fname, iname);
fr.add(spawn(mitem_text, item_text:dname, item_command:sprintf("set plug_sbar 3; cvarreset hud_*; exec \"%s\"; hud_recalculate", fname), item_scale:16, item_flags:IF_CENTERALIGN), RS_X_MIN_PARENT_MIN|RS_Y_MIN_PARENT_MIN | RS_X_MAX_PARENT_MAX|RS_Y_MAX_OWN_MIN, [0, y], [0, 16]);
}
else
fr.add(spawn(mitem_text, item_text:dname, item_command:"cvarreset hud_*; set plug_sbar 0", item_scale:16, item_flags:IF_CENTERALIGN), RS_X_MIN_PARENT_MIN|RS_Y_MIN_PARENT_MIN | RS_X_MAX_PARENT_MAX|RS_Y_MAX_OWN_MIN, [0, y], [0, 16]);
y += 16;
//add the options
for (i = 0; i < fc; i++)
{
fname = search_getfilename(fs, i);
iname = substring(fname, 5, -5);
if (iname == "hud_default")
continue;
if (substring(fname, 0, 4) == "hud_")
iname = substring(fname, 4, -1);
dname = GetFirstLineComment(fname, iname);
// print(sprintf("\"%s\" \"%s\" - \"%s\"\n", fname, iname, dname));
if (dname)
{
fr.add(spawn(mitem_text, item_text:dname, item_command:sprintf("cvarreset hud_*; exec \"%s\"; hud_recalculate", fname), item_scale:16, item_flags:IF_CENTERALIGN), RS_X_MIN_PARENT_MIN|RS_Y_MIN_PARENT_MIN | RS_X_MAX_PARENT_MAX|RS_Y_MAX_OWN_MIN, [0, y], [0, 16]);
fr.add(spawn(mitem_text, item_text:dname, item_command:sprintf("set plug_sbar 3; cvarreset hud_*; exec \"%s\"; hud_recalculate", fname), item_scale:16, item_flags:IF_CENTERALIGN), RS_X_MIN_PARENT_MIN|RS_Y_MIN_PARENT_MIN | RS_X_MAX_PARENT_MAX|RS_Y_MAX_OWN_MIN, [0, y], [0, 16]);
y += 16;
}
}

View File

@ -6,9 +6,9 @@ const static struct
{
{_("Forwards"), "+forward"},
{_("Back"), "+back"},
{_("Move Left"), "+moveleft"},
{_("Move Left"), "+moveleft"},
{_("Move Right"), "+moveright"},
{_("Turn Left"), "+left"},
{_("Turn Left"), "+left"},
{_("Turn Right"), "+right"},
{_("Look Up"), "+lookup"},
{_("Look Down"), "+lookdown"},
@ -26,17 +26,21 @@ const static struct
// {_("Mouse Look"), "+mlook"},
{_("Keyboard Look"), "+klook"},
{_("Strafe"), "+strafe"},
{_("Run"), "+speed"},
{0, 0},
{_("Axe"), "impulse 1"},
{_("Run"), "+speed"},
{0, 0},
{_("Axe"), "impulse 1"},
{_("Shotgun"), "impulse 2"},
{_("Super Shotgun"), "impulse 3"},
{_("Nailgun"), "impulse 4"},
{_("Super Nailgun"), "impulse 5"},
{_("Grenade Launcher"), "impulse 6"},
{_("Rocket Launcher"), "impulse 7"},
{_("Grenade Launcher"), "impulse 6"},
{_("Rocket Launcher"), "impulse 7"},
{_("Lightning Gun"), "impulse 8"},
// {_("Railgun"), "impulse 9"},
{0, 0},
{_("Ready Up"), "ready"},
{_("Break Match"), "break"},
};
void(mitem_desktop desktop) M_Options_Keys =
{

View File

@ -69,7 +69,7 @@ nonstatic void(mitem_desktop desktop) M_Preset =
for (i = 0; i < c; i++)
{
string fname = search_getfilename(fs, i);
string iname = substring(fname, 10, -5);
string iname = substring(fname, 15, -5);
string dname = GetFirstLineComment(fname, iname);
iname = sprintf("exec \"%s\";vid_reload", iname);
if (dname && !fr.findchildcmd(iname))

View File

@ -23,18 +23,19 @@ float sb_showscores;
void() mitem_desktop::mitem_desktop =
{
#define menu_font_win autocvar(menu_font_win, "")
#define menu_font autocvar(menu_font, "")
#define menu_font_win autocvar(menu_font_win, "")
#define menu_font autocvar(menu_font, "")
#define menu_font_fallback autocvar(gl_font, "")
queryscreensize();
//make sure we have a font that can cope with slightly up-scaled stuff.
//windows is special because we can load from the system fonts
string fontname = menu_font_fallback;
if (menu_font_win != "" && !strncmp(cvar_string("sys_platform"), "Win", 3))
drawfont = loadfont("", menu_font_win, "8 12 16", -1);
fontname = menu_font_win;
else if (menu_font != "")
drawfont = loadfont("", menu_font, "8 12 16", -1);
else
drawfont = 0;
fontname = menu_font;
drawfont = loadfont("", fontname, "8 12 16", -1);
item_text = "desktop";
if (!item_flags)