mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-29 15:12:19 +00:00
------------------------------------------------------------------------
r4189 | acceptthis | 2013-02-05 12:54:29 +0000 (Tue, 05 Feb 2013) | 1 line clipboard, icon, fullscreen support for glx. Numerous fixes for compile-time warnings. ------------------------------------------------------------------------ git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4187 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
5c108ea81f
commit
0ecf71adaf
57 changed files with 815 additions and 370 deletions
|
@ -117,7 +117,7 @@ ifeq ($(FTE_TARGET),droid)
|
||||||
|
|
||||||
STRIP=$(TOOLCHAIN)strip
|
STRIP=$(TOOLCHAIN)strip
|
||||||
CC=$(TOOLCHAIN)gcc -I$(NDK_PATH)/platforms/android-$(DROID_API_LEVEL)/$(DROID_PLAT_INC)/usr/include/ -DANDROID $(DROID_ABI) -fno-strict-aliasing
|
CC=$(TOOLCHAIN)gcc -I$(NDK_PATH)/platforms/android-$(DROID_API_LEVEL)/$(DROID_PLAT_INC)/usr/include/ -DANDROID $(DROID_ABI) -fno-strict-aliasing
|
||||||
DO_LD=$(CC) -Wl,-soname,libftedroid.so -shared -Wl,--no-undefined -Wl,-z,noexecstack --sysroot=$(NDK_PATH)/platforms/android-$(DROID_API_LEVEL)/$(DROID_PLAT_INC) -L$(NDK_PATH)/platforms/android-$(DROID_API_LEVEL)/$(DROID_PLAT_INC)/usr/lib -o $@ $(LTO_LD) $(WCFLAGS) $(CFLAGS) -llog -lc -lz -lm
|
DO_LD=$(DO_ECHO) $(CC) -Wl,-soname,libftedroid.so -shared -Wl,--no-undefined -Wl,-z,noexecstack --sysroot=$(NDK_PATH)/platforms/android-$(DROID_API_LEVEL)/$(DROID_PLAT_INC) -L$(NDK_PATH)/platforms/android-$(DROID_API_LEVEL)/$(DROID_PLAT_INC)/usr/lib -o $@ $(LTO_LD) $(WCFLAGS) $(CFLAGS) -llog -lc -lz -lm
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#correct the gcc build when cross compiling
|
#correct the gcc build when cross compiling
|
||||||
|
@ -287,7 +287,9 @@ ifneq ($(LTO),)
|
||||||
LTO_LD=-flto
|
LTO_LD=-flto
|
||||||
endif
|
endif
|
||||||
|
|
||||||
DO_CC=@echo $< && $(CC) $(LTO_CC) $(ALL_CFLAGS) -o $@ -c $<
|
#DO_ECHO=@echo $< &&
|
||||||
|
DO_ECHO=@
|
||||||
|
DO_CC=$(DO_ECHO) $(CC) $(LTO_CC) $(ALL_CFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
ifeq ($(FTE_TARGET),vc)
|
ifeq ($(FTE_TARGET),vc)
|
||||||
BASELDFLAGS=
|
BASELDFLAGS=
|
||||||
|
@ -333,7 +335,7 @@ ifeq ($(FTE_TARGET),vc)
|
||||||
WARNINGFLAGS=-W3 -D_CRT_SECURE_NO_WARNINGS
|
WARNINGFLAGS=-W3 -D_CRT_SECURE_NO_WARNINGS
|
||||||
GNUC_FUNCS=
|
GNUC_FUNCS=
|
||||||
else
|
else
|
||||||
WARNINGFLAGS=-Wall -Wno-pointer-sign
|
WARNINGFLAGS=-Wall -Wno-pointer-sign -Wno-unknown-pragmas -Wno-format-zero-length
|
||||||
|
|
||||||
GNUC_FUNCS= -Dstrnicmp=strncasecmp -Dstricmp=strcasecmp
|
GNUC_FUNCS= -Dstrnicmp=strncasecmp -Dstricmp=strcasecmp
|
||||||
endif
|
endif
|
||||||
|
@ -781,7 +783,7 @@ ifeq ($(FTE_TARGET),vc)
|
||||||
RELEASE_LDFLAGS = /LTCG:PGOPTIMIZE
|
RELEASE_LDFLAGS = /LTCG:PGOPTIMIZE
|
||||||
|
|
||||||
DO_CC=@$(CC) /nologo $(ALL_CFLAGS) -Fo$@ -c $<
|
DO_CC=@$(CC) /nologo $(ALL_CFLAGS) -Fo$@ -c $<
|
||||||
DO_LD=@"$(MSVCPATH)link" /nologo /out:"$@" /nodefaultlib:libc.lib /LARGEADDRESSAWARE /nodefaultlib:MSVCRT $(MSVCLIB) /manifest:no /OPT:REF wsock32.lib user32.lib advapi32.lib winmm.lib libs/zlib$(BITS).lib shell32.lib
|
DO_LD=$(DO_ECHO) "$(MSVCPATH)link" /nologo /out:"$@" /nodefaultlib:libc.lib /LARGEADDRESSAWARE /nodefaultlib:MSVCRT $(MSVCLIB) /manifest:no /OPT:REF wsock32.lib user32.lib advapi32.lib winmm.lib libs/zlib$(BITS).lib shell32.lib
|
||||||
PRECOMPHEADERS =
|
PRECOMPHEADERS =
|
||||||
NODEPS = 1
|
NODEPS = 1
|
||||||
|
|
||||||
|
@ -1171,7 +1173,7 @@ PRECOMPHEADERS ?= $(OUT_DIR)/quakedef.h.gch
|
||||||
#god knows how gcc loads the list properly.
|
#god knows how gcc loads the list properly.
|
||||||
#or at least I hope he does. It makes no sence to mortals.
|
#or at least I hope he does. It makes no sence to mortals.
|
||||||
|
|
||||||
DO_LD ?= $(CC) -o $@ $(LTO_LD) $(WCFLAGS) $(CFLAGS)
|
DO_LD ?=$(DO_ECHO) $(CC) -o $@ $(LTO_LD) $(WCFLAGS) $(CFLAGS)
|
||||||
$(OUT_DIR)/$(EXE_NAME): $(PRECOMPHEADERS) $(foreach fn, $(CUSTOMOBJS) $(foreach ol, $(OBJS), $($(ol))),$(if $(findstring ltox,$(fn)),,$(OUT_DIR)/$(fn)))
|
$(OUT_DIR)/$(EXE_NAME): $(PRECOMPHEADERS) $(foreach fn, $(CUSTOMOBJS) $(foreach ol, $(OBJS), $($(ol))),$(if $(findstring ltox,$(fn)),,$(OUT_DIR)/$(fn)))
|
||||||
$(DO_LD) $(foreach fn, $(CUSTOMOBJS) $(foreach ol, $(OBJS) $(LTO_END), $($(ol))),$(if $(findstring ltox,$(fn)),$(subst ltox,-x ,$(fn)),$(OUT_DIR)/$(fn)) ) $(LDFLAGS)
|
$(DO_LD) $(foreach fn, $(CUSTOMOBJS) $(foreach ol, $(OBJS) $(LTO_END), $($(ol))),$(if $(findstring ltox,$(fn)),$(subst ltox,-x ,$(fn)),$(OUT_DIR)/$(fn)) ) $(LDFLAGS)
|
||||||
|
|
||||||
|
|
|
@ -1689,7 +1689,7 @@ void CL_QTVPoll (void)
|
||||||
|
|
||||||
if (qtvrequestsize >= sizeof(qtvrequestbuffer) - 1)
|
if (qtvrequestsize >= sizeof(qtvrequestbuffer) - 1)
|
||||||
{
|
{
|
||||||
Con_Printf("%i of %i...\n", qtvrequestsize, sizeof(qtvrequestbuffer));
|
Con_Printf("%i of %i...\n", qtvrequestsize, (int)sizeof(qtvrequestbuffer));
|
||||||
len = -1;
|
len = -1;
|
||||||
}
|
}
|
||||||
if (!qtvrequestsize && len == 0)
|
if (!qtvrequestsize && len == 0)
|
||||||
|
|
|
@ -2359,7 +2359,6 @@ void CL_AddDecal(shader_t *shader, vec3_t origin, vec3_t up, vec3_t side, vec3_t
|
||||||
{
|
{
|
||||||
int num, v;
|
int num, v;
|
||||||
vec3_t tang;
|
vec3_t tang;
|
||||||
float radius = 1;
|
|
||||||
float *verts;
|
float *verts;
|
||||||
float tx, ty, tz;
|
float tx, ty, tz;
|
||||||
scenetris_t *t;
|
scenetris_t *t;
|
||||||
|
|
|
@ -164,7 +164,7 @@ static void Display_Ignorelist(void)
|
||||||
else if (x)
|
else if (x)
|
||||||
Con_Printf ("\n");
|
Con_Printf ("\n");
|
||||||
|
|
||||||
if (ignoreteamlist[i][0])
|
if (ignoreteamlist[0][0])
|
||||||
{
|
{
|
||||||
x = 0;
|
x = 0;
|
||||||
Con_Printf ("\x02" "Team Ignore List:\n");
|
Con_Printf ("\x02" "Team Ignore List:\n");
|
||||||
|
|
|
@ -605,18 +605,20 @@ int MakeChar (int i)
|
||||||
|
|
||||||
void CL_ClampPitch (int pnum)
|
void CL_ClampPitch (int pnum)
|
||||||
{
|
{
|
||||||
vec3_t view[4];
|
float mat[16];
|
||||||
vec3_t impact, norm;
|
|
||||||
float mat[16], mat2[16];
|
|
||||||
vec3_t cross;
|
|
||||||
float roll;
|
float roll;
|
||||||
float dot;
|
|
||||||
static float oldtime;
|
static float oldtime;
|
||||||
float timestep = realtime - oldtime;
|
float timestep = realtime - oldtime;
|
||||||
oldtime = realtime;
|
oldtime = realtime;
|
||||||
#if 0
|
#if 0
|
||||||
if (cl.pmovetype[pnum] == PM_WALLWALK)
|
if (cl.pmovetype[pnum] == PM_WALLWALK)
|
||||||
{
|
{
|
||||||
|
vec3_t impact;
|
||||||
|
vec3_t norm;
|
||||||
|
float mat2[16];
|
||||||
|
vec3_t cross;
|
||||||
|
vec3_t view[4];
|
||||||
|
float dot;
|
||||||
AngleVectors(cl.viewangles[pnum], view[0], view[1], view[2]);
|
AngleVectors(cl.viewangles[pnum], view[0], view[1], view[2]);
|
||||||
Matrix4x4_RM_FromVectors(mat, view[0], view[1], view[2], vec3_origin);
|
Matrix4x4_RM_FromVectors(mat, view[0], view[1], view[2], vec3_origin);
|
||||||
|
|
||||||
|
@ -654,7 +656,6 @@ void CL_ClampPitch (int pnum)
|
||||||
float viewm[16];
|
float viewm[16];
|
||||||
vec3_t view[4];
|
vec3_t view[4];
|
||||||
vec3_t surf[3];
|
vec3_t surf[3];
|
||||||
vec3_t fwd, up;
|
|
||||||
vec3_t vang;
|
vec3_t vang;
|
||||||
void PerpendicularVector( vec3_t dst, const vec3_t src );
|
void PerpendicularVector( vec3_t dst, const vec3_t src );
|
||||||
|
|
||||||
|
@ -1496,7 +1497,6 @@ void CL_SendCmd (double frametime, qboolean mainloop)
|
||||||
int msecstouse;
|
int msecstouse;
|
||||||
qboolean dontdrop=false;
|
qboolean dontdrop=false;
|
||||||
|
|
||||||
extern cvar_t cl_maxfps;
|
|
||||||
clcmdbuf_t *next;
|
clcmdbuf_t *next;
|
||||||
|
|
||||||
if (runningindepphys)
|
if (runningindepphys)
|
||||||
|
|
|
@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include "cl_master.h"
|
#include "cl_master.h"
|
||||||
#include "cl_ignore.h"
|
#include "cl_ignore.h"
|
||||||
#include "shader.h"
|
#include "shader.h"
|
||||||
|
#include <ctype.h>
|
||||||
// callbacks
|
// callbacks
|
||||||
void CL_Sbar_Callback(struct cvar_s *var, char *oldvalue);
|
void CL_Sbar_Callback(struct cvar_s *var, char *oldvalue);
|
||||||
void Name_Callback(struct cvar_s *var, char *oldvalue);
|
void Name_Callback(struct cvar_s *var, char *oldvalue);
|
||||||
|
@ -3125,8 +3125,8 @@ void CL_Init (void)
|
||||||
cls.state = ca_disconnected;
|
cls.state = ca_disconnected;
|
||||||
|
|
||||||
#ifdef SVNREVISION
|
#ifdef SVNREVISION
|
||||||
if (strcmp(SVNREVISION, "-"))
|
if (strcmp(STRINGIFY(SVNREVISION), "-"))
|
||||||
ver = va("%s v%i.%02i %s", DISTRIBUTION, FTE_VER_MAJOR, FTE_VER_MINOR, SVNREVISION);
|
ver = va("%s v%i.%02i %s", DISTRIBUTION, FTE_VER_MAJOR, FTE_VER_MINOR, STRINGIFY(SVNREVISION));
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
ver = va("%s v%i.%02i", DISTRIBUTION, FTE_VER_MAJOR, FTE_VER_MINOR);
|
ver = va("%s v%i.%02i", DISTRIBUTION, FTE_VER_MAJOR, FTE_VER_MINOR);
|
||||||
|
|
|
@ -583,9 +583,7 @@ void CL_SendDownloadStartRequest(char *filename, char *localname, unsigned int f
|
||||||
void CL_DownloadFinished(void)
|
void CL_DownloadFinished(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
extern int mod_numknown;
|
|
||||||
char *ext;
|
char *ext;
|
||||||
extern model_t mod_known[];
|
|
||||||
|
|
||||||
char *filename = cls.downloadlocalname;
|
char *filename = cls.downloadlocalname;
|
||||||
char *tempname = cls.downloadtempname;
|
char *tempname = cls.downloadtempname;
|
||||||
|
@ -659,6 +657,8 @@ void CL_DownloadFinished(void)
|
||||||
if (!cl.sendprespawn)
|
if (!cl.sendprespawn)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
extern int mod_numknown;
|
||||||
|
extern model_t mod_known[];
|
||||||
for (i = 0; i < mod_numknown; i++) //go and load this model now.
|
for (i = 0; i < mod_numknown; i++) //go and load this model now.
|
||||||
{
|
{
|
||||||
if (!strcmp(mod_known[i].name, filename))
|
if (!strcmp(mod_known[i].name, filename))
|
||||||
|
@ -1776,7 +1776,7 @@ void CL_ParseChunkedDownload(void)
|
||||||
}
|
}
|
||||||
if (ridx == MAXBLOCKS)
|
if (ridx == MAXBLOCKS)
|
||||||
{
|
{
|
||||||
Con_DPrintf("dupe/invalid chunk received\n", chunknum);
|
Con_DPrintf("dupe/invalid chunk received\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dlblock[ridx].chunkno = ~0;
|
dlblock[ridx].chunkno = ~0;
|
||||||
|
@ -2506,6 +2506,8 @@ void CLQW_ParseServerData (void)
|
||||||
pnum = MSG_ReadByte ();
|
pnum = MSG_ReadByte ();
|
||||||
for (clnum = 0; ; clnum++)
|
for (clnum = 0; ; clnum++)
|
||||||
{
|
{
|
||||||
|
if (clnum == MAX_SPLITS)
|
||||||
|
Host_EndGame("Server sent us too many alternate clients\n");
|
||||||
cl.playernum[clnum] = pnum;
|
cl.playernum[clnum] = pnum;
|
||||||
if (cl.playernum[clnum] & 128)
|
if (cl.playernum[clnum] & 128)
|
||||||
{
|
{
|
||||||
|
@ -2520,12 +2522,8 @@ void CLQW_ParseServerData (void)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
pnum = MSG_ReadByte ();
|
pnum = MSG_ReadByte ();
|
||||||
|
|
||||||
if (pnum == 128)
|
if (pnum == 128)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (clnum == MAX_SPLITS)
|
|
||||||
Host_EndGame("Server sent us too many alternate clients\n");
|
|
||||||
}
|
}
|
||||||
cl.splitclients = clnum+1;
|
cl.splitclients = clnum+1;
|
||||||
}
|
}
|
||||||
|
@ -4870,15 +4868,15 @@ void CL_PrintChat(player_info_t *plr, char *rawmsg, char *msg, int plrflags)
|
||||||
|
|
||||||
if (plrflags & (TPM_TEAM|TPM_OBSERVEDTEAM)) // for team chat don't highlight the name, just the brackets
|
if (plrflags & (TPM_TEAM|TPM_OBSERVEDTEAM)) // for team chat don't highlight the name, just the brackets
|
||||||
{
|
{
|
||||||
Q_strncatz(fullchatmessage, va("(^[^7%s%s^d\\player\\%i^])", name_coloured?"^m":"", name, plr-cl.players), sizeof(fullchatmessage));
|
Q_strncatz(fullchatmessage, va("(^[^7%s%s^d\\player\\%i^])", name_coloured?"^m":"", name, (int)(plr-cl.players)), sizeof(fullchatmessage));
|
||||||
}
|
}
|
||||||
else if (cl_standardchat.ival)
|
else if (cl_standardchat.ival)
|
||||||
{
|
{
|
||||||
Q_strncatz(fullchatmessage, va("^[^7%s%s^d\\player\\%i^]", name_coloured?"^m":"", name, plr-cl.players), sizeof(fullchatmessage));
|
Q_strncatz(fullchatmessage, va("^[^7%s%s^d\\player\\%i^]", name_coloured?"^m":"", name, (int)(plr-cl.players)), sizeof(fullchatmessage));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Q_strncatz(fullchatmessage, va("^[^7%s^%c%s^d\\player\\%i^]", name_coloured?"^m":"", c, name, plr-cl.players), sizeof(fullchatmessage));
|
Q_strncatz(fullchatmessage, va("^[^7%s^%c%s^d\\player\\%i^]", name_coloured?"^m":"", c, name, (int)(plr-cl.players)), sizeof(fullchatmessage));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!memessage)
|
if (!memessage)
|
||||||
|
@ -5032,7 +5030,7 @@ void CL_PrintStandardMessage(char *msg, int printlevel)
|
||||||
c = '0' + CL_PlayerColor(p, &coloured);
|
c = '0' + CL_PlayerColor(p, &coloured);
|
||||||
|
|
||||||
// print name
|
// print name
|
||||||
Q_strncatz(fullmessage, va("^[%s^%c%s^d\\player\\%i^]", coloured?"^m":"", c, name, p - cl.players), sizeof(fullmessage));
|
Q_strncatz(fullmessage, va("^[%s^%c%s^d\\player\\%i^]", coloured?"^m":"", c, name, (int)(p - cl.players)), sizeof(fullmessage));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1637,7 +1637,7 @@ void SCR_DrawLoading (void)
|
||||||
if (cls.downloadmethod)
|
if (cls.downloadmethod)
|
||||||
Draw_FunString(x+8, y+4, va("Downloading %s... %i%%",
|
Draw_FunString(x+8, y+4, va("Downloading %s... %i%%",
|
||||||
cls.downloadlocalname,
|
cls.downloadlocalname,
|
||||||
cls.downloadpercent));
|
(int)cls.downloadpercent));
|
||||||
|
|
||||||
if (tsize > 1024*1024*16)
|
if (tsize > 1024*1024*16)
|
||||||
{
|
{
|
||||||
|
@ -2234,7 +2234,7 @@ void SCR_BringDownConsole (void)
|
||||||
void SCR_TileClear (void)
|
void SCR_TileClear (void)
|
||||||
{
|
{
|
||||||
#ifdef PLUGINS
|
#ifdef PLUGINS
|
||||||
extern cvar_t plug_sbar;
|
// extern cvar_t plug_sbar;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (cl.splitclients>1)
|
if (cl.splitclients>1)
|
||||||
|
|
|
@ -1686,7 +1686,7 @@ void CL_SpawnCustomTEnd(custtentinst_t *info)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (t->netstyle & CTE_CUSTOMVELOCITY|CTE_CUSTOMDIRECTION)
|
if (t->netstyle & (CTE_CUSTOMVELOCITY|CTE_CUSTOMDIRECTION))
|
||||||
failed = P_RunParticleEffectType(info->pos, info->dir, info->count, t->particleeffecttype);
|
failed = P_RunParticleEffectType(info->pos, info->dir, info->count, t->particleeffecttype);
|
||||||
else
|
else
|
||||||
failed = P_RunParticleEffectType(info->pos, NULL, info->count, t->particleeffecttype);
|
failed = P_RunParticleEffectType(info->pos, NULL, info->count, t->particleeffecttype);
|
||||||
|
|
|
@ -1680,7 +1680,6 @@ char *Con_CopyConsole(qboolean nomarkup)
|
||||||
conchar_t *cur;
|
conchar_t *cur;
|
||||||
conline_t *l;
|
conline_t *l;
|
||||||
conchar_t *lend;
|
conchar_t *lend;
|
||||||
conchar_t col = CON_WHITEMASK;
|
|
||||||
char *result;
|
char *result;
|
||||||
int outlen, maxlen;
|
int outlen, maxlen;
|
||||||
int finalendoffset;
|
int finalendoffset;
|
||||||
|
|
|
@ -900,7 +900,6 @@ void Key_Console (unsigned int unicode, int key)
|
||||||
|
|
||||||
if ((key == K_MOUSE1 || key == K_MOUSE2))
|
if ((key == K_MOUSE1 || key == K_MOUSE2))
|
||||||
{
|
{
|
||||||
extern cvar_t vid_conwidth, vid_conheight;
|
|
||||||
int xpos, ypos;
|
int xpos, ypos;
|
||||||
xpos = (int)((mousecursor_x*vid.width)/(vid.pixelwidth*8));
|
xpos = (int)((mousecursor_x*vid.width)/(vid.pixelwidth*8));
|
||||||
ypos = (int)((mousecursor_y*vid.height)/(vid.pixelheight*8));
|
ypos = (int)((mousecursor_y*vid.height)/(vid.pixelheight*8));
|
||||||
|
|
|
@ -265,7 +265,7 @@ static void MD_Draw (int x, int y, struct menucustom_s *c, struct menu_s *m)
|
||||||
{
|
{
|
||||||
package_t *p;
|
package_t *p;
|
||||||
int fl;
|
int fl;
|
||||||
p = c->data;
|
p = c->dptr;
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
Draw_FunString (x+4, y, "^Ue080^Ue082");
|
Draw_FunString (x+4, y, "^Ue080^Ue082");
|
||||||
|
@ -303,7 +303,7 @@ static void MD_Draw (int x, int y, struct menucustom_s *c, struct menu_s *m)
|
||||||
static qboolean MD_Key (struct menucustom_s *c, struct menu_s *m, int key)
|
static qboolean MD_Key (struct menucustom_s *c, struct menu_s *m, int key)
|
||||||
{
|
{
|
||||||
package_t *p, *p2;
|
package_t *p, *p2;
|
||||||
p = c->data;
|
p = c->dptr;
|
||||||
if (key == K_ENTER || key == K_MOUSE1)
|
if (key == K_ENTER || key == K_MOUSE1)
|
||||||
{
|
{
|
||||||
p->flags ^= DPF_WANTTOINSTALL;
|
p->flags ^= DPF_WANTTOINSTALL;
|
||||||
|
@ -431,7 +431,7 @@ void M_AddItemsToDownloadMenu(menu_t *m)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
c = MC_AddCustom(m, 0, y, p);
|
c = MC_AddCustom(m, 0, y, p, 0);
|
||||||
c->draw = MD_Draw;
|
c->draw = MD_Draw;
|
||||||
c->key = MD_Key;
|
c->key = MD_Key;
|
||||||
c->common.width = 320;
|
c->common.width = 320;
|
||||||
|
|
|
@ -361,7 +361,7 @@ static void M_CheckMouseMove(void)
|
||||||
foundexclusive=true;
|
foundexclusive=true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(option = menu->options; option; option = option = option->common.next)
|
for(option = menu->options; option; option = option->common.next)
|
||||||
{
|
{
|
||||||
if (mousemoved && !bindingactive && !option->common.ishidden)
|
if (mousemoved && !bindingactive && !option->common.ishidden)
|
||||||
{
|
{
|
||||||
|
@ -454,7 +454,7 @@ static void MenuDrawItems(int xpos, int ypos, menuoption_t *option, menu_t *menu
|
||||||
if (p) R2D_ScalePic(xpos+option->common.posx, ypos+option->common.posy, option->common.width, option->common.height, p);
|
if (p) R2D_ScalePic(xpos+option->common.posx, ypos+option->common.posy, option->common.width, option->common.height, p);
|
||||||
break;
|
break;
|
||||||
case mt_childwindow:
|
case mt_childwindow:
|
||||||
MenuDrawItems(xpos+option->common.posx, ypos+option->common.posy, ((menu_t *)option->custom.data)->options, (menu_t *)option->custom.data);
|
MenuDrawItems(xpos+option->common.posx, ypos+option->common.posy, ((menu_t *)option->custom.dptr)->options, (menu_t *)option->custom.dptr);
|
||||||
break;
|
break;
|
||||||
case mt_box:
|
case mt_box:
|
||||||
Draw_TextBox(xpos+option->common.posx, ypos+option->common.posy, option->box.width, option->box.height);
|
Draw_TextBox(xpos+option->common.posx, ypos+option->common.posy, option->box.width, option->box.height);
|
||||||
|
@ -920,14 +920,15 @@ menubox_t *MC_AddBox(menu_t *menu, int x, int y, int width, int height)
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
menucustom_t *MC_AddCustom(menu_t *menu, int x, int y, void *data)
|
menucustom_t *MC_AddCustom(menu_t *menu, int x, int y, void *dptr, int dint)
|
||||||
{
|
{
|
||||||
menucustom_t *n = Z_Malloc(sizeof(menucustom_t));
|
menucustom_t *n = Z_Malloc(sizeof(menucustom_t));
|
||||||
n->common.type = mt_custom;
|
n->common.type = mt_custom;
|
||||||
n->common.iszone = true;
|
n->common.iszone = true;
|
||||||
n->common.posx = x;
|
n->common.posx = x;
|
||||||
n->common.posy = y;
|
n->common.posy = y;
|
||||||
n->data = data;
|
n->dptr = dptr;
|
||||||
|
n->dint = dint;
|
||||||
|
|
||||||
n->common.next = menu->options;
|
n->common.next = menu->options;
|
||||||
menu->options = (menuoption_t *)n;
|
menu->options = (menuoption_t *)n;
|
||||||
|
|
|
@ -215,7 +215,7 @@ static void SL_ServerDraw (int x, int y, menucustom_t *ths, menu_t *menu)
|
||||||
{
|
{
|
||||||
serverlist_t *info = (serverlist_t*)(menu + 1);
|
serverlist_t *info = (serverlist_t*)(menu + 1);
|
||||||
serverinfo_t *si;
|
serverinfo_t *si;
|
||||||
int thisone = (int)ths->data + info->scrollpos;
|
int thisone = ths->dint + info->scrollpos;
|
||||||
servertypes_t stype;
|
servertypes_t stype;
|
||||||
char adr[MAX_ADR_SIZE];
|
char adr[MAX_ADR_SIZE];
|
||||||
|
|
||||||
|
@ -407,9 +407,9 @@ static void SL_ServerPlayer (int x, int y, menucustom_t *ths, menu_t *menu)
|
||||||
if (selectedserver.inuse)
|
if (selectedserver.inuse)
|
||||||
{
|
{
|
||||||
if (selectedserver.detail)
|
if (selectedserver.detail)
|
||||||
if ((int)ths->data < selectedserver.detail->numplayers)
|
if (ths->dint < selectedserver.detail->numplayers)
|
||||||
{
|
{
|
||||||
int i = (int)ths->data;
|
int i = ths->dint;
|
||||||
R2D_ImagePaletteColour (Sbar_ColorForMap(selectedserver.detail->players[i].topc), 1.0);
|
R2D_ImagePaletteColour (Sbar_ColorForMap(selectedserver.detail->players[i].topc), 1.0);
|
||||||
R2D_FillBlock (x, y, 28, 4);
|
R2D_FillBlock (x, y, 28, 4);
|
||||||
R2D_ImagePaletteColour (Sbar_ColorForMap(selectedserver.detail->players[i].botc), 1.0);
|
R2D_ImagePaletteColour (Sbar_ColorForMap(selectedserver.detail->players[i].botc), 1.0);
|
||||||
|
@ -603,7 +603,7 @@ void M_Menu_ServerList2_f(void)
|
||||||
info = (serverlist_t*)(menu + 1);
|
info = (serverlist_t*)(menu + 1);
|
||||||
|
|
||||||
y = 8;
|
y = 8;
|
||||||
cust = MC_AddCustom(menu, 0, y, 0);
|
cust = MC_AddCustom(menu, 0, y, NULL, 0);
|
||||||
cust->draw = SL_TitlesDraw;
|
cust->draw = SL_TitlesDraw;
|
||||||
cust->key = SL_TitlesKey;
|
cust->key = SL_TitlesKey;
|
||||||
cust->common.height = 8;
|
cust->common.height = 8;
|
||||||
|
@ -611,7 +611,7 @@ void M_Menu_ServerList2_f(void)
|
||||||
|
|
||||||
info->visibleslots = (vid.height-16 - 64);
|
info->visibleslots = (vid.height-16 - 64);
|
||||||
|
|
||||||
cust = MC_AddCustom(menu, vid.width-8, 16, NULL);
|
cust = MC_AddCustom(menu, vid.width-8, 16, NULL, 0);
|
||||||
cust->draw = SL_SliderDraw;
|
cust->draw = SL_SliderDraw;
|
||||||
cust->key = SL_SliderKey;
|
cust->key = SL_SliderKey;
|
||||||
cust->common.height = info->visibleslots;
|
cust->common.height = info->visibleslots;
|
||||||
|
@ -620,7 +620,7 @@ void M_Menu_ServerList2_f(void)
|
||||||
info->visibleslots = (info->visibleslots-7)/8;
|
info->visibleslots = (info->visibleslots-7)/8;
|
||||||
for (i = 0, y = 16; i <= info->visibleslots; y +=8, i++)
|
for (i = 0, y = 16; i <= info->visibleslots; y +=8, i++)
|
||||||
{
|
{
|
||||||
cust = MC_AddCustom(menu, 0, y, (void*)i);
|
cust = MC_AddCustom(menu, 0, y, NULL, i);
|
||||||
cust->draw = SL_ServerDraw;
|
cust->draw = SL_ServerDraw;
|
||||||
cust->key = SL_ServerKey;
|
cust->key = SL_ServerKey;
|
||||||
cust->common.height = 8;
|
cust->common.height = 8;
|
||||||
|
@ -634,7 +634,7 @@ void M_Menu_ServerList2_f(void)
|
||||||
{
|
{
|
||||||
for (y = vid.height-64+8; y < vid.height; y += 8, i++)
|
for (y = vid.height-64+8; y < vid.height; y += 8, i++)
|
||||||
{
|
{
|
||||||
cust = MC_AddCustom(menu, x+16, y, (void*)i);
|
cust = MC_AddCustom(menu, x+16, y, NULL, i);
|
||||||
cust->draw = SL_ServerPlayer;
|
cust->draw = SL_ServerPlayer;
|
||||||
cust->key = NULL;
|
cust->key = NULL;
|
||||||
cust->common.height = 8;
|
cust->common.height = 8;
|
||||||
|
@ -773,7 +773,7 @@ void M_QuickConnect_f(void)
|
||||||
menu->key = M_QuickConnect_Key;
|
menu->key = M_QuickConnect_Key;
|
||||||
menu->remove = M_QuickConnect_Remove;
|
menu->remove = M_QuickConnect_Remove;
|
||||||
|
|
||||||
cust = MC_AddCustom(menu, 64, 64, NULL);
|
cust = MC_AddCustom(menu, 64, 64, NULL, 0);
|
||||||
cust->draw = M_QuickConnect_DrawStatus;
|
cust->draw = M_QuickConnect_DrawStatus;
|
||||||
cust->common.height = 8;
|
cust->common.height = 8;
|
||||||
cust->common.width = vid.width-8;
|
cust->common.width = vid.width-8;
|
||||||
|
|
|
@ -2687,7 +2687,6 @@ qboolean Media_UnregisterEncoder(struct plugin_s *plug, media_encoder_funcs_t *f
|
||||||
{
|
{
|
||||||
qboolean success = true;
|
qboolean success = true;
|
||||||
int i;
|
int i;
|
||||||
static media_decoder_funcs_t deadfuncs;
|
|
||||||
|
|
||||||
for (i = 0; i < sizeof(pluginencodersfunc)/sizeof(pluginencodersfunc[0]); i++)
|
for (i = 0; i < sizeof(pluginencodersfunc)/sizeof(pluginencodersfunc[0]); i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -356,7 +356,7 @@ void M_Menu_Setup_f (void)
|
||||||
(info->nameedit = MC_AddEdit(menu, 64, 40, "Your name", name.string));
|
(info->nameedit = MC_AddEdit(menu, 64, 40, "Your name", name.string));
|
||||||
(info->modeledit = MC_AddCvarCombo(menu, 64, 72, "model", &skin, (const char **)modeloptions, (const char **)modeloptions));
|
(info->modeledit = MC_AddCvarCombo(menu, 64, 72, "model", &skin, (const char **)modeloptions, (const char **)modeloptions));
|
||||||
info->modeledit->selectedoption = !strncmp(skin.string, "female", 6);
|
info->modeledit->selectedoption = !strncmp(skin.string, "female", 6);
|
||||||
cu = MC_AddCustom(menu, 172-16, 88+16, NULL);
|
cu = MC_AddCustom(menu, 172-16, 88+16, NULL, 0);
|
||||||
cu->draw = MSetupQ2_TransDraw;
|
cu->draw = MSetupQ2_TransDraw;
|
||||||
cu->key = MSetupQ2_ChangeSkin;
|
cu->key = MSetupQ2_ChangeSkin;
|
||||||
|
|
||||||
|
@ -420,7 +420,7 @@ void M_Menu_Setup_f (void)
|
||||||
else
|
else
|
||||||
(info->skinedit = MC_AddEdit(menu, 64, 72, "Your skin", skin.string));
|
(info->skinedit = MC_AddEdit(menu, 64, 72, "Your skin", skin.string));
|
||||||
|
|
||||||
ci = MC_AddCustom(menu, 172+32, 88, NULL);
|
ci = MC_AddCustom(menu, 172+32, 88, NULL, 0);
|
||||||
ci->draw = MSetup_TransDraw;
|
ci->draw = MSetup_TransDraw;
|
||||||
ci->key = NULL;
|
ci->key = NULL;
|
||||||
|
|
||||||
|
|
|
@ -65,8 +65,7 @@ qboolean M_Options_InvertMouse (menucheck_t *option, struct menu_s *menu, chk_se
|
||||||
//options menu.
|
//options menu.
|
||||||
void M_Menu_Options_f (void)
|
void M_Menu_Options_f (void)
|
||||||
{
|
{
|
||||||
extern cvar_t cl_standardchat;
|
extern cvar_t crosshair;
|
||||||
extern cvar_t cl_standardmsg, crosshair;
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
extern qboolean vid_isfullscreen;
|
extern qboolean vid_isfullscreen;
|
||||||
#endif
|
#endif
|
||||||
|
@ -238,7 +237,8 @@ menucombo_t *MC_AddCvarCombo(menu_t *menu, int x, int y, const char *caption, cv
|
||||||
void M_Menu_Audio_f (void)
|
void M_Menu_Audio_f (void)
|
||||||
{
|
{
|
||||||
menu_t *menu;
|
menu_t *menu;
|
||||||
extern cvar_t nosound, precache, snd_leftisright, snd_khz, snd_eax, snd_speakers, ambient_level, bgmvolume, snd_playersoundvolume, ambient_fade, cl_staticsounds, snd_inactive, _snd_mixahead, snd_usemultipledevices, snd_noextraupdate;
|
extern cvar_t nosound, snd_leftisright, snd_khz, snd_speakers, ambient_level, bgmvolume, snd_playersoundvolume, ambient_fade, cl_staticsounds, snd_inactive, _snd_mixahead, snd_usemultipledevices;
|
||||||
|
// extern cvar_t snd_noextraupdate, snd_eax, precache;
|
||||||
extern cvar_t cl_voip_play, cl_voip_send;
|
extern cvar_t cl_voip_play, cl_voip_send;
|
||||||
|
|
||||||
static const char *soundqualityoptions[] = {
|
static const char *soundqualityoptions[] = {
|
||||||
|
@ -324,9 +324,10 @@ void M_Menu_Audio_f (void)
|
||||||
void M_Menu_Particles_f (void)
|
void M_Menu_Particles_f (void)
|
||||||
{
|
{
|
||||||
menu_t *menu;
|
menu_t *menu;
|
||||||
extern cvar_t r_bouncysparks, r_part_rain, gl_part_flame, r_particlesystem, r_grenadetrail, r_rockettrail, r_part_sparks_textured, r_part_sparks_trifan, r_part_rain_quantity, r_particledesc, r_particle_tracelimit, r_part_contentswitch, r_bloodstains;
|
extern cvar_t r_bouncysparks, r_part_rain, gl_part_flame, r_grenadetrail, r_rockettrail, r_part_rain_quantity, r_particledesc, r_particle_tracelimit, r_part_contentswitch, r_bloodstains;
|
||||||
|
// extern cvar_t r_part_sparks_trifan, r_part_sparks_textured, r_particlesystem;
|
||||||
|
|
||||||
static const char *psystemopts[] =
|
/* static const char *psystemopts[] =
|
||||||
{
|
{
|
||||||
"Classic",
|
"Classic",
|
||||||
"Script",
|
"Script",
|
||||||
|
@ -340,7 +341,7 @@ void M_Menu_Particles_f (void)
|
||||||
"null",
|
"null",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
static const char *pdescopts[] =
|
static const char *pdescopts[] =
|
||||||
{
|
{
|
||||||
"Classic",
|
"Classic",
|
||||||
|
@ -889,10 +890,11 @@ void M_Menu_Lighting_f (void)
|
||||||
extern cvar_t r_vertexlight, r_vertexdlights;
|
extern cvar_t r_vertexlight, r_vertexdlights;
|
||||||
#endif
|
#endif
|
||||||
extern cvar_t r_stains, r_shadows, r_shadow_realtime_world, r_loadlits, r_dynamic;
|
extern cvar_t r_stains, r_shadows, r_shadow_realtime_world, r_loadlits, r_dynamic;
|
||||||
extern cvar_t r_lightstylesmooth, r_lightstylespeed, r_nolightdir;
|
extern cvar_t r_lightstylesmooth, r_nolightdir;
|
||||||
extern cvar_t r_shadow_realtime_world_lightmaps, r_shadow_realtime_dlight, r_shadow_realtime_dlight_shadows;
|
extern cvar_t r_shadow_realtime_dlight, r_shadow_realtime_dlight_shadows;
|
||||||
extern cvar_t r_fb_bmodels, r_fb_models, r_rocketlight, r_powerupglow;
|
extern cvar_t r_fb_models, r_rocketlight, r_powerupglow;
|
||||||
extern cvar_t v_powerupshell, r_explosionlight;
|
extern cvar_t v_powerupshell, r_explosionlight;
|
||||||
|
//extern cvar_t r_fb_bmodels, r_shadow_realtime_world_lightmaps, r_lightstylespeed;
|
||||||
|
|
||||||
static const char *lightingopts[] =
|
static const char *lightingopts[] =
|
||||||
{
|
{
|
||||||
|
@ -2108,18 +2110,29 @@ qboolean M_VideoApply (union menuoption_s *op, struct menu_s *menu, int key)
|
||||||
|
|
||||||
void M_Menu_Video_f (void)
|
void M_Menu_Video_f (void)
|
||||||
{
|
{
|
||||||
extern cvar_t v_contrast, vid_width, vid_height, vid_conwidth, vid_conheight;
|
extern cvar_t v_contrast, vid_conwidth, vid_conheight;
|
||||||
|
// extern cvar_t vid_width, vid_height, vid_preservegamma, vid_hardwaregamma, vid_desktopgamma;
|
||||||
extern cvar_t vid_fullscreen, vid_desktopsettings, vid_conautoscale;
|
extern cvar_t vid_fullscreen, vid_desktopsettings, vid_conautoscale;
|
||||||
extern cvar_t vid_desktopgamma, vid_hardwaregamma, vid_preservegamma;
|
extern cvar_t vid_bpp, vid_refreshrate, vid_multisample;
|
||||||
extern cvar_t vid_bpp, vid_refreshrate, vid_renderer, vid_multisample;
|
|
||||||
|
|
||||||
|
#if defined(GLQUAKE) && (defined(D3DQUAKE) || defined(SWQUAKE))
|
||||||
|
#define MULTIRENDERER
|
||||||
|
#endif
|
||||||
|
#ifdef MULTIRENDERER
|
||||||
|
extern cvar_t vid_renderer;
|
||||||
static const char *rendererops[] =
|
static const char *rendererops[] =
|
||||||
{
|
{
|
||||||
#ifdef GLQUAKE
|
#ifdef GLQUAKE
|
||||||
"OpenGL",
|
"OpenGL",
|
||||||
#endif
|
#endif
|
||||||
#ifdef D3DQUAKE
|
#ifdef D3D9QUAKE
|
||||||
"Direct3D",
|
"Direct3D 9",
|
||||||
|
#endif
|
||||||
|
#ifdef D3D11QUAKE
|
||||||
|
"Direct3D 11",
|
||||||
|
#endif
|
||||||
|
#ifdef SWQUAKE
|
||||||
|
"Software Rendering",
|
||||||
#endif
|
#endif
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
@ -2128,11 +2141,18 @@ void M_Menu_Video_f (void)
|
||||||
#ifdef GLQUAKE
|
#ifdef GLQUAKE
|
||||||
"gl",
|
"gl",
|
||||||
#endif
|
#endif
|
||||||
#ifdef D3DQUAKE
|
#ifdef D3D9QUAKE
|
||||||
"d3d",
|
"d3d9",
|
||||||
|
#endif
|
||||||
|
#ifdef D3D11QUAKE
|
||||||
|
"d3d11",
|
||||||
|
#endif
|
||||||
|
#ifdef SWQUAKE
|
||||||
|
"sw",
|
||||||
#endif
|
#endif
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
static const char *aaopts[] = {
|
static const char *aaopts[] = {
|
||||||
"1x",
|
"1x",
|
||||||
|
@ -2194,7 +2214,7 @@ void M_Menu_Video_f (void)
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
static const char *scalevalues[] = { "1", "1.5", "2", "2.5", "3", "4", "5", "6", NULL};
|
static const char *scalevalues[] = { "1", "1.5", "2", "2.5", "3", "4", "5", "6", NULL};
|
||||||
|
/*
|
||||||
static const char *vsyncoptions[] =
|
static const char *vsyncoptions[] =
|
||||||
{
|
{
|
||||||
"Off",
|
"Off",
|
||||||
|
@ -2202,11 +2222,11 @@ void M_Menu_Video_f (void)
|
||||||
"Wait for Display Enable",
|
"Wait for Display Enable",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
extern cvar_t _vid_wait_override;
|
||||||
|
*/
|
||||||
videomenuinfo_t *info;
|
videomenuinfo_t *info;
|
||||||
static char current3dres[32]; // enough to fit 1920x1200
|
static char current3dres[32]; // enough to fit 1920x1200
|
||||||
|
|
||||||
extern cvar_t _vid_wait_override;
|
|
||||||
|
|
||||||
int y;
|
int y;
|
||||||
int resmodechoice, res2dmodechoice;
|
int resmodechoice, res2dmodechoice;
|
||||||
|
@ -2251,7 +2271,7 @@ void M_Menu_Video_f (void)
|
||||||
MB_COMBOCVARRETURN("Color Depth", vid_bpp, bppopts, bppvalues, info->bppfixed, vid_bpp.description),
|
MB_COMBOCVARRETURN("Color Depth", vid_bpp, bppopts, bppvalues, info->bppfixed, vid_bpp.description),
|
||||||
MB_COMBOCVARRETURN("Refresh Rate", vid_refreshrate, refreshopts, refreshvalues, info->hzfixed, vid_refreshrate.description),
|
MB_COMBOCVARRETURN("Refresh Rate", vid_refreshrate, refreshopts, refreshvalues, info->hzfixed, vid_refreshrate.description),
|
||||||
MB_SPACING(-24), // really hacky...
|
MB_SPACING(-24), // really hacky...
|
||||||
// custom enteries
|
// custom entries
|
||||||
MB_EDITCVARSLIMRETURN("Width", "vid_width", info->width),
|
MB_EDITCVARSLIMRETURN("Width", "vid_width", info->width),
|
||||||
MB_EDITCVARSLIMRETURN("Height", "vid_height", info->height),
|
MB_EDITCVARSLIMRETURN("Height", "vid_height", info->height),
|
||||||
MB_EDITCVARSLIMRETURN("Color Depth", "vid_bpp", info->bpp),
|
MB_EDITCVARSLIMRETURN("Color Depth", "vid_bpp", info->bpp),
|
||||||
|
|
|
@ -702,7 +702,7 @@ void M_Menu_Demos_f (void)
|
||||||
MC_AddWhiteText(menu, 24, 8, "Choose a Demo", false);
|
MC_AddWhiteText(menu, 24, 8, "Choose a Demo", false);
|
||||||
MC_AddWhiteText(menu, 16, 24, "\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37", false);
|
MC_AddWhiteText(menu, 16, 24, "\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37", false);
|
||||||
|
|
||||||
info->list = MC_AddCustom(menu, 0, 32, NULL);
|
info->list = MC_AddCustom(menu, 0, 32, NULL, 0);
|
||||||
info->list->draw = M_DemoDraw;
|
info->list->draw = M_DemoDraw;
|
||||||
info->list->key = M_DemoKey;
|
info->list->key = M_DemoKey;
|
||||||
|
|
||||||
|
@ -744,7 +744,7 @@ void M_Menu_MediaFiles_f (void)
|
||||||
MC_AddWhiteText(menu, 24, 8, "Media List", false);
|
MC_AddWhiteText(menu, 24, 8, "Media List", false);
|
||||||
MC_AddWhiteText(menu, 16, 24, "\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37", false);
|
MC_AddWhiteText(menu, 16, 24, "\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37", false);
|
||||||
|
|
||||||
info->list = MC_AddCustom(menu, 0, 32, NULL);
|
info->list = MC_AddCustom(menu, 0, 32, NULL, 0);
|
||||||
info->list->draw = M_DemoDraw;
|
info->list->draw = M_DemoDraw;
|
||||||
info->list->key = M_DemoKey;
|
info->list->key = M_DemoKey;
|
||||||
|
|
||||||
|
|
|
@ -199,7 +199,8 @@ typedef struct {
|
||||||
|
|
||||||
typedef struct menucustom_s {
|
typedef struct menucustom_s {
|
||||||
menucommon_t common;
|
menucommon_t common;
|
||||||
void *data;
|
void *dptr;
|
||||||
|
int dint;
|
||||||
void (*draw) (int x, int y, struct menucustom_s *, struct menu_s *);
|
void (*draw) (int x, int y, struct menucustom_s *, struct menu_s *);
|
||||||
qboolean (*key) (struct menucustom_s *, struct menu_s *, int key);
|
qboolean (*key) (struct menucustom_s *, struct menu_s *, int key);
|
||||||
} menucustom_t;
|
} menucustom_t;
|
||||||
|
@ -305,7 +306,7 @@ menubutton_t *MC_AddCommand(menu_t *menu, int x, int y, char *text, qboolean (*c
|
||||||
menuedit_t *MC_AddEdit(menu_t *menu, int x, int y, char *text, char *def);
|
menuedit_t *MC_AddEdit(menu_t *menu, int x, int y, char *text, char *def);
|
||||||
menuedit_t *MC_AddEditCvar(menu_t *menu, int x, int y, char *text, char *name);
|
menuedit_t *MC_AddEditCvar(menu_t *menu, int x, int y, char *text, char *name);
|
||||||
menuedit_t *MC_AddEditCvarSlim(menu_t *menu, int x, int y, char *text, char *name);
|
menuedit_t *MC_AddEditCvarSlim(menu_t *menu, int x, int y, char *text, char *name);
|
||||||
menucustom_t *MC_AddCustom(menu_t *menu, int x, int y, void *data);
|
menucustom_t *MC_AddCustom(menu_t *menu, int x, int y, void *dptr, int dint);
|
||||||
menucombo_t *MC_AddCvarCombo(menu_t *menu, int x, int y, const char *caption, cvar_t *cvar, const char **ops, const char **values);
|
menucombo_t *MC_AddCvarCombo(menu_t *menu, int x, int y, const char *caption, cvar_t *cvar, const char **ops, const char **values);
|
||||||
|
|
||||||
typedef struct menubulk_s {
|
typedef struct menubulk_s {
|
||||||
|
|
|
@ -161,12 +161,14 @@ qboolean Master_CompareInteger(int a, int b, slist_test_t rule)
|
||||||
return a<=b;
|
return a<=b;
|
||||||
case SLIST_TEST_LESS:
|
case SLIST_TEST_LESS:
|
||||||
return a<b;
|
return a<b;
|
||||||
|
case SLIST_TEST_STARTSWITH:
|
||||||
case SLIST_TEST_EQUAL:
|
case SLIST_TEST_EQUAL:
|
||||||
return a==b;
|
return a==b;
|
||||||
case SLIST_TEST_GREATER:
|
case SLIST_TEST_GREATER:
|
||||||
return a>b;
|
return a>b;
|
||||||
case SLIST_TEST_GREATEREQUAL:
|
case SLIST_TEST_GREATEREQUAL:
|
||||||
return a>=b;
|
return a>=b;
|
||||||
|
case SLIST_TEST_NOTSTARTSWITH:
|
||||||
case SLIST_TEST_NOTEQUAL:
|
case SLIST_TEST_NOTEQUAL:
|
||||||
return a!=b;
|
return a!=b;
|
||||||
}
|
}
|
||||||
|
@ -176,6 +178,10 @@ qboolean Master_CompareString(char *a, char *b, slist_test_t rule)
|
||||||
{
|
{
|
||||||
switch(rule)
|
switch(rule)
|
||||||
{
|
{
|
||||||
|
case SLIST_TEST_STARTSWITH:
|
||||||
|
return strnicmp(a, b, strlen(b))==0;
|
||||||
|
case SLIST_TEST_NOTSTARTSWITH:
|
||||||
|
return strnicmp(a, b, strlen(b))!=0;
|
||||||
case SLIST_TEST_CONTAINS:
|
case SLIST_TEST_CONTAINS:
|
||||||
return !!strstr(a, b);
|
return !!strstr(a, b);
|
||||||
case SLIST_TEST_NOTCONTAIN:
|
case SLIST_TEST_NOTCONTAIN:
|
||||||
|
@ -2119,7 +2125,8 @@ void CL_MasterListParse(netadrtype_t adrtype, int type, qboolean slashpad)
|
||||||
((qbyte *)&info->adr.address)[i] = MSG_ReadByte();
|
((qbyte *)&info->adr.address)[i] = MSG_ReadByte();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// warning: enumeration value ‘NA_*’ not handled in switch
|
// warning: enumeration value 'NA_*' not handled in switch
|
||||||
|
case NA_WEBSOCKET:
|
||||||
case NA_INVALID:
|
case NA_INVALID:
|
||||||
case NA_LOOPBACK:
|
case NA_LOOPBACK:
|
||||||
case NA_BROADCAST_IP:
|
case NA_BROADCAST_IP:
|
||||||
|
|
|
@ -899,6 +899,12 @@ static void QCBUILTIN PF_R_DynamicLight_Add(pubprogfuncs_t *prinst, struct globa
|
||||||
dl->corona = 1;
|
dl->corona = 1;
|
||||||
else
|
else
|
||||||
dl->corona = 0;
|
dl->corona = 0;
|
||||||
|
dl->style = style;
|
||||||
|
Q_strncpyz(dl->cubemapname, cubemapname, sizeof(dl->cubemapname));
|
||||||
|
if (*dl->cubemapname)
|
||||||
|
dl->cubetexture = R_LoadReplacementTexture(dl->cubemapname, "", IF_CUBEMAP);
|
||||||
|
else
|
||||||
|
dl->cubetexture = r_nulltex;
|
||||||
|
|
||||||
G_FLOAT(OFS_RETURN) = dl - cl_dlights;
|
G_FLOAT(OFS_RETURN) = dl - cl_dlights;
|
||||||
}
|
}
|
||||||
|
|
|
@ -716,9 +716,9 @@ qboolean M_Vid_GetMode(int num, int *w, int *h);
|
||||||
//a bit pointless really
|
//a bit pointless really
|
||||||
void QCBUILTIN PF_cl_getresolution (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
|
void QCBUILTIN PF_cl_getresolution (pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||||
{
|
{
|
||||||
extern cvar_t vid_fullscreen;
|
// extern cvar_t vid_fullscreen;
|
||||||
float mode = G_FLOAT(OFS_PARM0);
|
float mode = G_FLOAT(OFS_PARM0);
|
||||||
qboolean forfullscreen = (prinst->callargc >= 2)?G_FLOAT(OFS_PARM1):vid_fullscreen.ival;
|
// qboolean forfullscreen = (prinst->callargc >= 2)?G_FLOAT(OFS_PARM1):vid_fullscreen.ival;
|
||||||
float *ret = G_VECTOR(OFS_RETURN);
|
float *ret = G_VECTOR(OFS_RETURN);
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
|
|
|
@ -200,7 +200,7 @@ static void bonemat_fromqcvectors(float *out, const float vx[3], const float vy[
|
||||||
out[10] = vz[2];
|
out[10] = vz[2];
|
||||||
out[11] = t[2];
|
out[11] = t[2];
|
||||||
}
|
}
|
||||||
static void bonemat_fromaxisorg(float *out, const vec3_t axis[3], const float t[3])
|
static void bonemat_fromaxisorg(float *out, vec3_t axis[3], const float t[3])
|
||||||
{
|
{
|
||||||
out[0] = axis[0][0];
|
out[0] = axis[0][0];
|
||||||
out[1] = axis[1][0];
|
out[1] = axis[1][0];
|
||||||
|
|
|
@ -389,8 +389,6 @@ void GLD3DRenderer_Init(void)
|
||||||
#if defined(GLQUAKE)
|
#if defined(GLQUAKE)
|
||||||
void GLRenderer_Init(void)
|
void GLRenderer_Init(void)
|
||||||
{
|
{
|
||||||
extern cvar_t gl_contrast;
|
|
||||||
|
|
||||||
//gl-specific video vars
|
//gl-specific video vars
|
||||||
Cvar_Register (&gl_workaround_ati_shadersource, GLRENDEREROPTIONS);
|
Cvar_Register (&gl_workaround_ati_shadersource, GLRENDEREROPTIONS);
|
||||||
Cvar_Register (&vid_gl_context_version, GLRENDEREROPTIONS);
|
Cvar_Register (&vid_gl_context_version, GLRENDEREROPTIONS);
|
||||||
|
@ -1386,6 +1384,11 @@ TRACE(("dbg: R_ApplyRenderer: efrags\n"));
|
||||||
"-----------------------------\n"
|
"-----------------------------\n"
|
||||||
"Dedicated console created\n");
|
"Dedicated console created\n");
|
||||||
break;
|
break;
|
||||||
|
case QR_SOFTWARE:
|
||||||
|
Con_Printf( "\n"
|
||||||
|
"-----------------------------\n"
|
||||||
|
"Software renderer initialized\n");
|
||||||
|
break;
|
||||||
|
|
||||||
case QR_OPENGL:
|
case QR_OPENGL:
|
||||||
Con_Printf( "\n"
|
Con_Printf( "\n"
|
||||||
|
|
|
@ -2633,7 +2633,7 @@ void Sbar_TeamOverlay (void)
|
||||||
// Draw_String(x, y, "------------ ---- ----- -------");
|
// Draw_String(x, y, "------------ ---- ----- -------");
|
||||||
x = l;
|
x = l;
|
||||||
#undef COLUMN
|
#undef COLUMN
|
||||||
#define COLUMN(title, cwidth, code) {char buf[64*6]; int t = (cwidth)/8; int c=0; while (t-->0) {buf[c++] = '^'; buf[c++] = 'U'; buf[c++] = 'e'; buf[c++] = '0'; buf[c++] = '1'; buf[c++] = (c==5?'d':(!t?'f':'e'));} buf[c] = 0; Draw_FunString(x, y, buf); x += cwidth + 8;}
|
#define COLUMN(title, cwidth, code) {char buf[64*6]; int t = (cwidth)/8; int c=0; while (t-->0) {buf[c++] = '^'; buf[c++] = 'U'; buf[c++] = 'e'; buf[c++] = '0'; buf[c++] = '1'; buf[c] = (c==5?'d':(!t?'f':'e')); c++;} buf[c] = 0; Draw_FunString(x, y, buf); x += cwidth + 8;}
|
||||||
ALL_TEAM_COLUMNS
|
ALL_TEAM_COLUMNS
|
||||||
// Draw_FunString(x, y, "^Ue01d^Ue01e^Ue01e^Ue01e^Ue01e^Ue01e^Ue01e^Ue01e^Ue01e^Ue01e^Ue01e^Ue01f ^Ue01d^Ue01e^Ue01e^Ue01f ^Ue01d^Ue01e^Ue01e^Ue01e^Ue01f ^Ue01d^Ue01e^Ue01e^Ue01e^Ue01e^Ue01e^Ue01f");
|
// Draw_FunString(x, y, "^Ue01d^Ue01e^Ue01e^Ue01e^Ue01e^Ue01e^Ue01e^Ue01e^Ue01e^Ue01e^Ue01e^Ue01f ^Ue01d^Ue01e^Ue01e^Ue01f ^Ue01d^Ue01e^Ue01e^Ue01e^Ue01f ^Ue01d^Ue01e^Ue01e^Ue01e^Ue01e^Ue01e^Ue01f");
|
||||||
y += 8;
|
y += 8;
|
||||||
|
|
|
@ -599,11 +599,11 @@ void alarm_handler(int x)
|
||||||
|
|
||||||
char *Sys_ConsoleInput(void)
|
char *Sys_ConsoleInput(void)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 1
|
||||||
static char text[256];
|
static char text[256];
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
if (cls.state == ca_dedicated)
|
// if (!qrenderer)
|
||||||
{
|
{
|
||||||
len = read (0, text, sizeof(text));
|
len = read (0, text, sizeof(text));
|
||||||
if (len < 1)
|
if (len < 1)
|
||||||
|
@ -741,6 +741,7 @@ qboolean Sys_GetDesktopParameters(int *width, int *height, int *bpp, int *refres
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef GLQUAKE
|
||||||
#define SYS_CLIPBOARD_SIZE 256
|
#define SYS_CLIPBOARD_SIZE 256
|
||||||
static char clipboard_buffer[SYS_CLIPBOARD_SIZE] = {0};
|
static char clipboard_buffer[SYS_CLIPBOARD_SIZE] = {0};
|
||||||
|
|
||||||
|
@ -755,6 +756,7 @@ void Sys_CloseClipboard(char *bf)
|
||||||
void Sys_SaveClipboard(char *text) {
|
void Sys_SaveClipboard(char *text) {
|
||||||
Q_strncpyz(clipboard_buffer, text, SYS_CLIPBOARD_SIZE);
|
Q_strncpyz(clipboard_buffer, text, SYS_CLIPBOARD_SIZE);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef MULTITHREAD
|
#ifdef MULTITHREAD
|
||||||
/* Thread creation calls */
|
/* Thread creation calls */
|
||||||
|
|
|
@ -84,7 +84,6 @@ static char OpenEditorFile[256];
|
||||||
|
|
||||||
qboolean editoractive; //(export)
|
qboolean editoractive; //(export)
|
||||||
qboolean editormodal; //doesn't return. (export)
|
qboolean editormodal; //doesn't return. (export)
|
||||||
static qboolean editorblocking;
|
|
||||||
static qboolean madechanges;
|
static qboolean madechanges;
|
||||||
static qboolean editenabled;
|
static qboolean editenabled;
|
||||||
static qboolean insertkeyhit=true;
|
static qboolean insertkeyhit=true;
|
||||||
|
@ -1227,7 +1226,7 @@ int QCLibEditor(pubprogfuncs_t *prfncs, char *filename, int line, int statement,
|
||||||
firstblock = GenAsm(cursorlinenum);
|
firstblock = GenAsm(cursorlinenum);
|
||||||
cursorblock = firstblock;
|
cursorblock = firstblock;
|
||||||
|
|
||||||
for (i = cursorlinenum; i > 0 && i > cursorlinenum - 20; i)
|
for (i = cursorlinenum; i > 0 && i > cursorlinenum - 20; )
|
||||||
{
|
{
|
||||||
i--;
|
i--;
|
||||||
firstblock->prev = GenAsm(i);
|
firstblock->prev = GenAsm(i);
|
||||||
|
|
|
@ -1348,8 +1348,8 @@ static void Alias_BuildSkeletalMesh(mesh_t *mesh, float *bonepose, galiasinfo_t
|
||||||
qbyte *fte_restrict bidx = (qbyte*)((char*)inf + inf->ofs_skel_idx);
|
qbyte *fte_restrict bidx = (qbyte*)((char*)inf + inf->ofs_skel_idx);
|
||||||
float *fte_restrict xyzin = (float*)((char*)inf + inf->ofs_skel_xyz);
|
float *fte_restrict xyzin = (float*)((char*)inf + inf->ofs_skel_xyz);
|
||||||
float *fte_restrict normin = (float*)((char*)inf + inf->ofs_skel_norm);
|
float *fte_restrict normin = (float*)((char*)inf + inf->ofs_skel_norm);
|
||||||
float *fte_restrict svect = (float*)((char*)inf + inf->ofs_skel_svect);
|
// float *fte_restrict svect = (float*)((char*)inf + inf->ofs_skel_svect);
|
||||||
float *fte_restrict tvect = (float*)((char*)inf + inf->ofs_skel_tvect);
|
// float *fte_restrict tvect = (float*)((char*)inf + inf->ofs_skel_tvect);
|
||||||
float *fte_restrict weight = (float*)((char*)inf + inf->ofs_skel_weight);
|
float *fte_restrict weight = (float*)((char*)inf + inf->ofs_skel_weight);
|
||||||
|
|
||||||
Alias_TransformVerticies_VN(bonepose, inf->numverts, bidx, weight, xyzin, xyzout, normin, normout);
|
Alias_TransformVerticies_VN(bonepose, inf->numverts, bidx, weight, xyzin, xyzout, normin, normout);
|
||||||
|
@ -4865,7 +4865,7 @@ qboolean Mod_LoadPSKModel(model_t *mod, void *buffer)
|
||||||
if (j == chunk->numrecords)
|
if (j == chunk->numrecords)
|
||||||
{
|
{
|
||||||
fail = true;
|
fail = true;
|
||||||
Con_Printf("PSK bone %s does not exist in PSA %s\n", boneinfo[i].name);
|
Con_Printf("PSK bone %s does not exist in PSA %s\n", boneinfo[i].name, basename);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2116,7 +2116,7 @@ unsigned int utf8_encode(void *out, unsigned int unicode, int maxlen)
|
||||||
unsigned int qchar_encode(char *out, unsigned int unicode, int maxlen)
|
unsigned int qchar_encode(char *out, unsigned int unicode, int maxlen)
|
||||||
{
|
{
|
||||||
static const char hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
|
static const char hex[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
|
||||||
if (((unicode >= 32 || unicode == '\n' || unicode == '\t' || unicode == '\r') && unicode < 128) || unicode >= 0xe000 && unicode <= 0xe0ff)
|
if (((unicode >= 32 || unicode == '\n' || unicode == '\t' || unicode == '\r') && unicode < 128) || (unicode >= 0xe000 && unicode <= 0xe0ff))
|
||||||
{ //quake compatible chars
|
{ //quake compatible chars
|
||||||
if (maxlen < 1)
|
if (maxlen < 1)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2671,8 +2671,6 @@ conchar_t *COM_ParseFunString(conchar_t defaultflags, const char *str, conchar_t
|
||||||
{
|
{
|
||||||
//we don't support the full 12bit colour depth (only 4-bit CGA)
|
//we don't support the full 12bit colour depth (only 4-bit CGA)
|
||||||
//so find the closest that we do support
|
//so find the closest that we do support
|
||||||
int best = 1;
|
|
||||||
float bd = 255*255*255;
|
|
||||||
int r, g, b;
|
int r, g, b;
|
||||||
if (str[2] >= '0' && str[2] <= '9')
|
if (str[2] >= '0' && str[2] <= '9')
|
||||||
r = (str[2]-'0');
|
r = (str[2]-'0');
|
||||||
|
|
|
@ -223,7 +223,7 @@ static void FSSTDIO_ClosePath(void *handle)
|
||||||
}
|
}
|
||||||
static qboolean FSSTDIO_PollChanges(void *handle)
|
static qboolean FSSTDIO_PollChanges(void *handle)
|
||||||
{
|
{
|
||||||
stdiopath_t *np = handle;
|
// stdiopath_t *np = handle;
|
||||||
return true; //can't verify that or not, so we have to assume the worst
|
return true; //can't verify that or not, so we have to assume the worst
|
||||||
}
|
}
|
||||||
static void *FSSTDIO_OpenPath(vfsfile_t *mustbenull, const char *desc)
|
static void *FSSTDIO_OpenPath(vfsfile_t *mustbenull, const char *desc)
|
||||||
|
|
|
@ -1198,8 +1198,10 @@ qboolean CMod_LoadTexInfo (lump_t *l) //yes I know these load from the same plac
|
||||||
{
|
{
|
||||||
out->flags = LittleLong (in->flags);
|
out->flags = LittleLong (in->flags);
|
||||||
|
|
||||||
for (j=0 ; j<8 ; j++)
|
for (j=0 ; j<4 ; j++)
|
||||||
out->vecs[0][j] = LittleFloat (in->vecs[0][j]);
|
out->vecs[0][j] = LittleFloat (in->vecs[0][j]);
|
||||||
|
for (j=0 ; j<4 ; j++)
|
||||||
|
out->vecs[1][j] = LittleFloat (in->vecs[1][j]);
|
||||||
len1 = Length (out->vecs[0]);
|
len1 = Length (out->vecs[0]);
|
||||||
len2 = Length (out->vecs[1]);
|
len2 = Length (out->vecs[1]);
|
||||||
len1 = (len1 + len2)/2;
|
len1 = (len1 + len2)/2;
|
||||||
|
@ -5934,7 +5936,7 @@ qboolean Q2BSP_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f,
|
||||||
}*/
|
}*/
|
||||||
unsigned int Q2BSP_PointContents(model_t *mod, vec3_t axis[3], vec3_t p)
|
unsigned int Q2BSP_PointContents(model_t *mod, vec3_t axis[3], vec3_t p)
|
||||||
{
|
{
|
||||||
int pc, ret = FTECONTENTS_EMPTY;
|
int pc;
|
||||||
pc = CM_PointContents (mod, p);
|
pc = CM_PointContents (mod, p);
|
||||||
return pc;
|
return pc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1642,7 +1642,6 @@ int FTENET_Generic_GetLocalAddress(ftenet_generic_connection_t *con, netadr_t *o
|
||||||
netadr_t adr;
|
netadr_t adr;
|
||||||
char adrs[MAX_ADR_SIZE];
|
char adrs[MAX_ADR_SIZE];
|
||||||
int b;
|
int b;
|
||||||
struct hostent *h;
|
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
|
|
||||||
if (getsockname (con->thesocket, (struct sockaddr*)&from, &fromsize) != -1)
|
if (getsockname (con->thesocket, (struct sockaddr*)&from, &fromsize) != -1)
|
||||||
|
@ -1730,6 +1729,7 @@ int FTENET_Generic_GetLocalAddress(ftenet_generic_connection_t *con, netadr_t *o
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
struct hostent *h;
|
||||||
h = gethostbyname(adrs);
|
h = gethostbyname(adrs);
|
||||||
b = 0;
|
b = 0;
|
||||||
#ifdef HAVE_IPV4
|
#ifdef HAVE_IPV4
|
||||||
|
|
|
@ -565,7 +565,7 @@ static void inline QVM_Return(qvm_t *vm, int size)
|
||||||
|
|
||||||
if(fp[1]>=vm->len_cs*2)
|
if(fp[1]>=vm->len_cs*2)
|
||||||
if ((size_t)(vm->cs+fp[1]) != (size_t)RETURNOFFSETMARKER) //this being false causes the program to quit.
|
if ((size_t)(vm->cs+fp[1]) != (size_t)RETURNOFFSETMARKER) //this being false causes the program to quit.
|
||||||
Sys_Error("VM run time error: program returned to hyperspace (%p, %p)\n", (char*)vm->cs, (char*)fp[1]);
|
Sys_Error("VM run time error: program returned to hyperspace (%p, %#x)\n", (char*)vm->cs, fp[1]);
|
||||||
if(fp[1]<0)
|
if(fp[1]<0)
|
||||||
if ((size_t)(vm->cs+fp[1]) != (size_t)RETURNOFFSETMARKER)
|
if ((size_t)(vm->cs+fp[1]) != (size_t)RETURNOFFSETMARKER)
|
||||||
Sys_Error("VM run time error: program returned to negative hyperspace\n");
|
Sys_Error("VM run time error: program returned to negative hyperspace\n");
|
||||||
|
|
|
@ -145,27 +145,39 @@ local int unzlocal_getShortSane(vfsfile_t *fin, unsigned short *pi)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local int unzlocal_getShort(vfsfile_t *fin,unsigned long *pi) {
|
local int unzlocal_getShort(vfsfile_t *fin,unsigned long *pi)
|
||||||
|
{
|
||||||
unsigned short c;
|
unsigned short c;
|
||||||
int err = VFS_READ(fin, &c, 2);
|
int err = VFS_READ(fin, &c, 2);
|
||||||
if (err==2) {
|
if (err==2)
|
||||||
|
{
|
||||||
*pi = LittleShort(c);
|
*pi = LittleShort(c);
|
||||||
return UNZ_OK;
|
return UNZ_OK;
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*pi = 0;
|
||||||
if (VFS_TELL(fin) != VFS_GETLEN(fin)) return UNZ_ERRNO;
|
if (VFS_TELL(fin) != VFS_GETLEN(fin)) return UNZ_ERRNO;
|
||||||
else return UNZ_EOF;
|
else return UNZ_EOF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
local int unzlocal_getLong(vfsfile_t *fin,unsigned long *pi) {
|
local int unzlocal_getLong(vfsfile_t *fin,unsigned long *pi)
|
||||||
|
{
|
||||||
unsigned int c;
|
unsigned int c;
|
||||||
int err = VFS_READ(fin, &c, 4);
|
int err = VFS_READ(fin, &c, 4);
|
||||||
if (err==4) {
|
if (err==4)
|
||||||
|
{
|
||||||
*pi = LittleLong(c);
|
*pi = LittleLong(c);
|
||||||
return UNZ_OK;
|
return UNZ_OK;
|
||||||
} else {
|
}
|
||||||
if (VFS_TELL(fin) != VFS_GETLEN(fin)) return UNZ_ERRNO;
|
else
|
||||||
else return UNZ_EOF;
|
{
|
||||||
|
*pi = 0;
|
||||||
|
if (VFS_TELL(fin) != VFS_GETLEN(fin))
|
||||||
|
return UNZ_ERRNO;
|
||||||
|
else
|
||||||
|
return UNZ_EOF;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1153,6 +1153,7 @@ void RotateLightVector(const vec3_t *axis, const vec3_t origin, const vec3_t lig
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(RTLIGHTS)
|
#if defined(RTLIGHTS)
|
||||||
|
/*
|
||||||
static void GL_LightMesh (mesh_t *mesh, vec3_t lightpos, vec3_t colours, float radius)
|
static void GL_LightMesh (mesh_t *mesh, vec3_t lightpos, vec3_t colours, float radius)
|
||||||
{
|
{
|
||||||
vec3_t dir;
|
vec3_t dir;
|
||||||
|
@ -1216,6 +1217,7 @@ static void GL_LightMesh (mesh_t *mesh, vec3_t lightpos, vec3_t colours, float r
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
//courtesy of DP
|
//courtesy of DP
|
||||||
static void R_BuildBumpVectors(const float *v0, const float *v1, const float *v2, const float *tc0, const float *tc1, const float *tc2, float *svector3f, float *tvector3f, float *normal3f)
|
static void R_BuildBumpVectors(const float *v0, const float *v1, const float *v2, const float *tc0, const float *tc1, const float *tc2, float *svector3f, float *tvector3f, float *normal3f)
|
||||||
|
|
|
@ -217,7 +217,7 @@ static void BE_PolyOffset(qboolean pushdepth)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef FORCESTATE
|
#ifndef FORCESTATE
|
||||||
if (((int*)&shaderstate.curpolyoffset)[0] != ((int*)&po)[0] || ((int*)&shaderstate.curpolyoffset)[1] != ((int*)&po)[1])
|
if (shaderstate.curpolyoffset.factor != po.factor || shaderstate.curpolyoffset.unit != po.unit)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
shaderstate.curpolyoffset = po;
|
shaderstate.curpolyoffset = po;
|
||||||
|
@ -2534,7 +2534,6 @@ static void BE_SubmitMeshChain(void)
|
||||||
|
|
||||||
static void DrawPass(const shaderpass_t *pass)
|
static void DrawPass(const shaderpass_t *pass)
|
||||||
{
|
{
|
||||||
extern cvar_t temp1;
|
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
int tmu;
|
int tmu;
|
||||||
int lastpass = pass->numMergedPasses;
|
int lastpass = pass->numMergedPasses;
|
||||||
|
@ -3073,6 +3072,8 @@ void GLBE_SelectMode(backendmode_t mode)
|
||||||
shaderstate.flags = 0;
|
shaderstate.flags = 0;
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
|
default:
|
||||||
|
break;
|
||||||
case BEM_DEPTHONLY:
|
case BEM_DEPTHONLY:
|
||||||
GL_DeSelectProgram();
|
GL_DeSelectProgram();
|
||||||
/*BEM_DEPTHONLY does support mesh writing, but its not the only way its used... FIXME!*/
|
/*BEM_DEPTHONLY does support mesh writing, but its not the only way its used... FIXME!*/
|
||||||
|
@ -3189,7 +3190,7 @@ void GLBE_SelectEntity(entity_t *ent)
|
||||||
shaderstate.lastuniform = 0;
|
shaderstate.lastuniform = 0;
|
||||||
shaderstate.curtime = shaderstate.updatetime - shaderstate.curentity->shaderTime;
|
shaderstate.curtime = shaderstate.updatetime - shaderstate.curentity->shaderTime;
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
static void BE_SelectFog(vec3_t colour, float alpha, float density)
|
static void BE_SelectFog(vec3_t colour, float alpha, float density)
|
||||||
{
|
{
|
||||||
float zscale;
|
float zscale;
|
||||||
|
@ -3202,7 +3203,7 @@ static void BE_SelectFog(vec3_t colour, float alpha, float density)
|
||||||
|
|
||||||
qglColor4f(colour[0], colour[1], colour[2], alpha);
|
qglColor4f(colour[0], colour[1], colour[2], alpha);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#ifdef RTLIGHTS
|
#ifdef RTLIGHTS
|
||||||
static qboolean GLBE_RegisterLightShader(int mode)
|
static qboolean GLBE_RegisterLightShader(int mode)
|
||||||
{
|
{
|
||||||
|
@ -3295,7 +3296,7 @@ void GLBE_PushOffsetShadow(qboolean pushdepth)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef FORCESTATE
|
#ifndef FORCESTATE
|
||||||
if (((int*)&shaderstate.curpolyoffset)[0] != ((int*)&po)[0] || ((int*)&shaderstate.curpolyoffset)[1] != ((int*)&po)[1])
|
if (shaderstate.curpolyoffset.factor != po.factor || shaderstate.curpolyoffset.unit != po.unit)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
shaderstate.curpolyoffset = po;
|
shaderstate.curpolyoffset = po;
|
||||||
|
@ -4140,7 +4141,6 @@ void GLBE_RenderToTexture(texid_t sourcecol, texid_t sourcedepth, texid_t destco
|
||||||
|
|
||||||
void GLBE_DrawLightPrePass(qbyte *vis)
|
void GLBE_DrawLightPrePass(qbyte *vis)
|
||||||
{
|
{
|
||||||
extern cvar_t temp1;
|
|
||||||
if (!shaderstate.initeddepthnorm)
|
if (!shaderstate.initeddepthnorm)
|
||||||
{
|
{
|
||||||
shaderstate.initeddepthnorm = true;
|
shaderstate.initeddepthnorm = true;
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include <ctype.h>
|
||||||
|
|
||||||
void Font_Init(void);
|
void Font_Init(void);
|
||||||
void Font_Shutdown(void);
|
void Font_Shutdown(void);
|
||||||
|
|
|
@ -3253,7 +3253,6 @@ qboolean Terr_LoadTerrainModel (model_t *mod, void *buffer)
|
||||||
vec3_t skyaxis;
|
vec3_t skyaxis;
|
||||||
char shadername[MAX_QPATH];
|
char shadername[MAX_QPATH];
|
||||||
char skyname[MAX_QPATH];
|
char skyname[MAX_QPATH];
|
||||||
int numsegsx = 0, numsegsy = 0;
|
|
||||||
int sectsize = 0;
|
int sectsize = 0;
|
||||||
|
|
||||||
COM_FileBase(mod->name, shadername, sizeof(shadername));
|
COM_FileBase(mod->name, shadername, sizeof(shadername));
|
||||||
|
|
|
@ -702,8 +702,6 @@ void R_HalfLife_WalkMeshes(entity_t *rent, batch_t *b, batch_t **batches)
|
||||||
hlmdl_bodypart_t *bodypart = (hlmdl_bodypart_t *) ((qbyte *) model.header + model.header->bodypartindex) + body;
|
hlmdl_bodypart_t *bodypart = (hlmdl_bodypart_t *) ((qbyte *) model.header + model.header->bodypartindex) + body;
|
||||||
int bodyindex = (0 / bodypart->base) % bodypart->nummodels;
|
int bodyindex = (0 / bodypart->base) % bodypart->nummodels;
|
||||||
hlmdl_model_t *amodel = (hlmdl_model_t *) ((qbyte *) model.header + bodypart->modelindex) + bodyindex;
|
hlmdl_model_t *amodel = (hlmdl_model_t *) ((qbyte *) model.header + bodypart->modelindex) + bodyindex;
|
||||||
qbyte *bone = ((qbyte *) model.header + amodel->vertinfoindex);
|
|
||||||
vec3_t *verts = (vec3_t *) ((qbyte *) model.header + amodel->vertindex);
|
|
||||||
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
|
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,6 @@ needs almost the entire 256k of stack space!
|
||||||
|
|
||||||
void GLSCR_UpdateScreen (void)
|
void GLSCR_UpdateScreen (void)
|
||||||
{
|
{
|
||||||
extern cvar_t vid_conheight;
|
|
||||||
int uimenu;
|
int uimenu;
|
||||||
#ifdef TEXTEDITOR
|
#ifdef TEXTEDITOR
|
||||||
extern qboolean editormodal;
|
extern qboolean editormodal;
|
||||||
|
|
|
@ -160,7 +160,7 @@ skipwhite:
|
||||||
|
|
||||||
if (len == MAX_TOKEN_CHARS)
|
if (len == MAX_TOKEN_CHARS)
|
||||||
{
|
{
|
||||||
Con_DPrintf ("Token exceeded %i chars, discarded.\n", MAX_TOKEN_CHARS);
|
Con_DPrintf ("Token exceeded %i chars, discarded.\n", (int)MAX_TOKEN_CHARS);
|
||||||
len = 0;
|
len = 0;
|
||||||
}
|
}
|
||||||
com_token[len] = 0;
|
com_token[len] = 0;
|
||||||
|
|
|
@ -287,24 +287,30 @@ static void SH_FreeShadowMesh_(shadowmesh_t *sm)
|
||||||
|
|
||||||
switch (qrenderer)
|
switch (qrenderer)
|
||||||
{
|
{
|
||||||
#ifdef GLQUAKE
|
case QR_NONE:
|
||||||
|
case QR_SOFTWARE:
|
||||||
|
case QR_DIRECT3D11:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
case QR_OPENGL:
|
case QR_OPENGL:
|
||||||
|
#ifdef GLQUAKE
|
||||||
if (qglDeleteBuffersARB)
|
if (qglDeleteBuffersARB)
|
||||||
qglDeleteBuffersARB(2, sm->vebo);
|
qglDeleteBuffersARB(2, sm->vebo);
|
||||||
sm->vebo[0] = 0;
|
sm->vebo[0] = 0;
|
||||||
sm->vebo[1] = 0;
|
sm->vebo[1] = 0;
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef D3D9QUAKE
|
break;
|
||||||
case QR_DIRECT3D9:
|
case QR_DIRECT3D9:
|
||||||
|
#ifdef D3D9QUAKE
|
||||||
if (sm->d3d_ibuffer)
|
if (sm->d3d_ibuffer)
|
||||||
IDirect3DIndexBuffer9_Release(sm->d3d_ibuffer);
|
IDirect3DIndexBuffer9_Release(sm->d3d_ibuffer);
|
||||||
sm->d3d_ibuffer = NULL;
|
sm->d3d_ibuffer = NULL;
|
||||||
if (sm->d3d_vbuffer)
|
if (sm->d3d_vbuffer)
|
||||||
IDirect3DVertexBuffer9_Release(sm->d3d_vbuffer);
|
IDirect3DVertexBuffer9_Release(sm->d3d_vbuffer);
|
||||||
sm->d3d_vbuffer = NULL;
|
sm->d3d_vbuffer = NULL;
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void SH_FreeShadowMesh(shadowmesh_t *sm)
|
void SH_FreeShadowMesh(shadowmesh_t *sm)
|
||||||
|
@ -425,8 +431,14 @@ static struct shadowmesh_s *SHM_FinishShadowMesh(dlight_t *dl)
|
||||||
{
|
{
|
||||||
switch (qrenderer)
|
switch (qrenderer)
|
||||||
{
|
{
|
||||||
#ifdef GLQUAKE
|
case QR_NONE:
|
||||||
|
case QR_SOFTWARE:
|
||||||
|
case QR_DIRECT3D11:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
case QR_OPENGL:
|
case QR_OPENGL:
|
||||||
|
#ifdef GLQUAKE
|
||||||
qglGenBuffersARB(2, sh_shmesh->vebo);
|
qglGenBuffersARB(2, sh_shmesh->vebo);
|
||||||
|
|
||||||
GL_DeselectVAO();
|
GL_DeselectVAO();
|
||||||
|
@ -435,10 +447,10 @@ static struct shadowmesh_s *SHM_FinishShadowMesh(dlight_t *dl)
|
||||||
|
|
||||||
GL_SelectEBO(sh_shmesh->vebo[1]);
|
GL_SelectEBO(sh_shmesh->vebo[1]);
|
||||||
qglBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, sizeof(*sh_shmesh->indicies) * sh_shmesh->numindicies, sh_shmesh->indicies, GL_STATIC_DRAW_ARB);
|
qglBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, sizeof(*sh_shmesh->indicies) * sh_shmesh->numindicies, sh_shmesh->indicies, GL_STATIC_DRAW_ARB);
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef D3D9QUAKE
|
break;
|
||||||
case QR_DIRECT3D9:
|
case QR_DIRECT3D9:
|
||||||
|
#ifdef D3D9QUAKE
|
||||||
if (sh_shmesh->numindicies && sh_shmesh->numverts)
|
if (sh_shmesh->numindicies && sh_shmesh->numverts)
|
||||||
{
|
{
|
||||||
void *map;
|
void *map;
|
||||||
|
@ -453,8 +465,8 @@ static struct shadowmesh_s *SHM_FinishShadowMesh(dlight_t *dl)
|
||||||
IDirect3DVertexBuffer9_Unlock(sh_shmesh->d3d_vbuffer);
|
IDirect3DVertexBuffer9_Unlock(sh_shmesh->d3d_vbuffer);
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Z_Free(sh_shmesh->verts);
|
Z_Free(sh_shmesh->verts);
|
||||||
|
@ -1429,11 +1441,17 @@ typedef struct
|
||||||
} srect_t;
|
} srect_t;
|
||||||
static void Sh_Scissor (srect_t r)
|
static void Sh_Scissor (srect_t r)
|
||||||
{
|
{
|
||||||
float xs = vid.pixelwidth / (float)vid.width, ys = vid.pixelheight / (float)vid.height;
|
//float xs = vid.pixelwidth / (float)vid.width, ys = vid.pixelheight / (float)vid.height;
|
||||||
switch(qrenderer)
|
switch(qrenderer)
|
||||||
{
|
{
|
||||||
#ifdef GLQUAKE
|
case QR_NONE:
|
||||||
|
case QR_SOFTWARE:
|
||||||
|
case QR_DIRECT3D11:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
case QR_OPENGL:
|
case QR_OPENGL:
|
||||||
|
#ifdef GLQUAKE
|
||||||
qglScissor(
|
qglScissor(
|
||||||
floor(r_refdef.pxrect.x + r.x*r_refdef.pxrect.width),
|
floor(r_refdef.pxrect.x + r.x*r_refdef.pxrect.width),
|
||||||
floor((r_refdef.pxrect.y + r.y*r_refdef.pxrect.height) - r_refdef.pxrect.height),
|
floor((r_refdef.pxrect.y + r.y*r_refdef.pxrect.height) - r_refdef.pxrect.height),
|
||||||
|
@ -1446,10 +1464,10 @@ static void Sh_Scissor (srect_t r)
|
||||||
qglDepthBoundsEXT(r.dmin, r.dmax);
|
qglDepthBoundsEXT(r.dmin, r.dmax);
|
||||||
qglEnable(GL_DEPTH_BOUNDS_TEST_EXT);
|
qglEnable(GL_DEPTH_BOUNDS_TEST_EXT);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef D3D9QUAKE
|
break;
|
||||||
case QR_DIRECT3D9:
|
case QR_DIRECT3D9:
|
||||||
|
#ifdef D3D9QUAKE
|
||||||
{
|
{
|
||||||
RECT rect;
|
RECT rect;
|
||||||
rect.left = r.x;
|
rect.left = r.x;
|
||||||
|
@ -1458,25 +1476,27 @@ static void Sh_Scissor (srect_t r)
|
||||||
rect.bottom = r.y + r.height;
|
rect.bottom = r.y + r.height;
|
||||||
IDirect3DDevice9_SetScissorRect(pD3DDev9, &rect);
|
IDirect3DDevice9_SetScissorRect(pD3DDev9, &rect);
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static void Sh_ScissorOff (void)
|
static void Sh_ScissorOff (void)
|
||||||
{
|
{
|
||||||
switch(qrenderer)
|
switch(qrenderer)
|
||||||
{
|
{
|
||||||
#ifdef GLQUAKE
|
default:
|
||||||
|
break;
|
||||||
case QR_OPENGL:
|
case QR_OPENGL:
|
||||||
|
#ifdef GLQUAKE
|
||||||
qglDisable(GL_SCISSOR_TEST);
|
qglDisable(GL_SCISSOR_TEST);
|
||||||
if (qglDepthBoundsEXT)
|
if (qglDepthBoundsEXT)
|
||||||
qglDisable(GL_DEPTH_BOUNDS_TEST_EXT);
|
qglDisable(GL_DEPTH_BOUNDS_TEST_EXT);
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef D3D9QUAKE
|
break;
|
||||||
case QR_DIRECT3D9:
|
case QR_DIRECT3D9:
|
||||||
break;
|
#ifdef D3D9QUAKE
|
||||||
#endif
|
#endif
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1532,7 +1552,7 @@ static qboolean Sh_ScissorForSphere(vec3_t center, float radius, vrect_t *rect)
|
||||||
#define BoxesOverlap(a,b,c,d) ((a)[0] <= (d)[0] && (b)[0] >= (c)[0] && (a)[1] <= (d)[1] && (b)[1] >= (c)[1] && (a)[2] <= (d)[2] && (b)[2] >= (c)[2])
|
#define BoxesOverlap(a,b,c,d) ((a)[0] <= (d)[0] && (b)[0] >= (c)[0] && (a)[1] <= (d)[1] && (b)[1] >= (c)[1] && (a)[2] <= (d)[2] && (b)[2] >= (c)[2])
|
||||||
static qboolean Sh_ScissorForBox(vec3_t mins, vec3_t maxs, srect_t *r)
|
static qboolean Sh_ScissorForBox(vec3_t mins, vec3_t maxs, srect_t *r)
|
||||||
{
|
{
|
||||||
static const edge[12][2] =
|
static const int edge[12][2] =
|
||||||
{
|
{
|
||||||
{0, 1}, {0, 2}, {1, 3}, {2, 3},
|
{0, 1}, {0, 2}, {1, 3}, {2, 3},
|
||||||
{4, 5}, {4, 6}, {5, 7}, {6, 7},
|
{4, 5}, {4, 6}, {5, 7}, {6, 7},
|
||||||
|
@ -1997,16 +2017,18 @@ GL_CullFace(0);
|
||||||
|
|
||||||
switch(qrenderer)
|
switch(qrenderer)
|
||||||
{
|
{
|
||||||
#ifdef GLQUAKE
|
default:
|
||||||
|
break;
|
||||||
case QR_OPENGL:
|
case QR_OPENGL:
|
||||||
|
#ifdef GLQUAKE
|
||||||
GLBE_BaseEntTextures();
|
GLBE_BaseEntTextures();
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef D3D9QUAKE
|
break;
|
||||||
case QR_DIRECT3D9:
|
case QR_DIRECT3D9:
|
||||||
|
#ifdef D3D9QUAKE
|
||||||
D3D9BE_BaseEntTextures();
|
D3D9BE_BaseEntTextures();
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
r_refdef.externalview = oxv;
|
r_refdef.externalview = oxv;
|
||||||
|
@ -2275,16 +2297,18 @@ static void Sh_DrawEntLighting(dlight_t *light, vec3_t colour)
|
||||||
|
|
||||||
switch(qrenderer)
|
switch(qrenderer)
|
||||||
{
|
{
|
||||||
#ifdef GLQUAKE
|
default:
|
||||||
|
break;
|
||||||
case QR_OPENGL:
|
case QR_OPENGL:
|
||||||
|
#ifdef GLQUAKE
|
||||||
GLBE_BaseEntTextures();
|
GLBE_BaseEntTextures();
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef D3D9QUAKE
|
break;
|
||||||
case QR_DIRECT3D9:
|
case QR_DIRECT3D9:
|
||||||
|
#ifdef D3D9QUAKE
|
||||||
D3D9BE_BaseEntTextures();
|
D3D9BE_BaseEntTextures();
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2416,16 +2440,22 @@ static void Sh_DrawStencilLightShadows(dlight_t *dl, qbyte *lvis, qbyte *vvis, q
|
||||||
{
|
{
|
||||||
switch (qrenderer)
|
switch (qrenderer)
|
||||||
{
|
{
|
||||||
#ifdef D3D9QUAKE
|
case QR_NONE:
|
||||||
|
case QR_SOFTWARE:
|
||||||
|
case QR_DIRECT3D11:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
case QR_DIRECT3D9:
|
case QR_DIRECT3D9:
|
||||||
|
#ifdef D3D9QUAKE
|
||||||
D3D9BE_RenderShadowBuffer(sm->numverts, sm->d3d_vbuffer, sm->numindicies, sm->d3d_ibuffer);
|
D3D9BE_RenderShadowBuffer(sm->numverts, sm->d3d_vbuffer, sm->numindicies, sm->d3d_ibuffer);
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef GLQUAKE
|
break;
|
||||||
case QR_OPENGL:
|
case QR_OPENGL:
|
||||||
|
#ifdef GLQUAKE
|
||||||
GLBE_RenderShadowBuffer(sm->numverts, sm->vebo[0], sm->verts, sm->numindicies, sm->vebo[1], sm->indicies);
|
GLBE_RenderShadowBuffer(sm->numverts, sm->vebo[0], sm->verts, sm->numindicies, sm->vebo[1], sm->indicies);
|
||||||
break;
|
|
||||||
#endif
|
#endif
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!r_drawentities.value)
|
if (!r_drawentities.value)
|
||||||
|
@ -2545,6 +2575,8 @@ static qboolean Sh_DrawStencilLight(dlight_t *dl, vec3_t colour, qbyte *vvis)
|
||||||
|
|
||||||
switch(qrenderer)
|
switch(qrenderer)
|
||||||
{
|
{
|
||||||
|
default:
|
||||||
|
break;
|
||||||
#ifdef GLQUAKE
|
#ifdef GLQUAKE
|
||||||
case QR_OPENGL:
|
case QR_OPENGL:
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,6 +30,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
|
||||||
#include "quakedef.h"
|
#include "quakedef.h"
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
#include <X11/Xatom.h>
|
||||||
#include "glquake.h"
|
#include "glquake.h"
|
||||||
|
|
||||||
#include <GL/glx.h>
|
#include <GL/glx.h>
|
||||||
|
@ -52,16 +54,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define WARP_WIDTH 320
|
|
||||||
#define WARP_HEIGHT 200
|
|
||||||
|
|
||||||
static Display *vid_dpy = NULL;
|
static Display *vid_dpy = NULL;
|
||||||
static Cursor vid_nullcursor;
|
static Cursor vid_nullcursor;
|
||||||
static Window vid_window;
|
static Window vid_window;
|
||||||
|
static Window vid_decoywindow; //for legacy mode, this is a boring window that we can reparent into as needed
|
||||||
|
static Window vid_root;
|
||||||
static GLXContext ctx = NULL;
|
static GLXContext ctx = NULL;
|
||||||
int scrnum;
|
static int scrnum;
|
||||||
|
|
||||||
static qboolean vidglx_fullscreen;
|
extern cvar_t vid_conautoscale;
|
||||||
|
|
||||||
static float old_windowed_mouse = 0;
|
static float old_windowed_mouse = 0;
|
||||||
|
|
||||||
|
@ -76,32 +77,42 @@ static int dgamouse = 0;
|
||||||
#define X_MASK (KEY_MASK | MOUSE_MASK | ResizeRequest | StructureNotifyMask | FocusChangeMask | VisibilityChangeMask)
|
#define X_MASK (KEY_MASK | MOUSE_MASK | ResizeRequest | StructureNotifyMask | FocusChangeMask | VisibilityChangeMask)
|
||||||
|
|
||||||
|
|
||||||
|
#define FULLSCREEN_VMODE 1 //using xf86 vidmode
|
||||||
|
#define FULLSCREEN_VMODEACTIVE 2 //xf86 vidmode currently forced
|
||||||
|
#define FULLSCREEN_LEGACY 4 //override redirect used
|
||||||
|
#define FULLSCREEN_WM 8 //fullscreen hint used
|
||||||
|
#define FULLSCREEN_ACTIVE 16 //currently fullscreen
|
||||||
|
static int fullscreenflags;
|
||||||
|
static int fullscreenwidth;
|
||||||
|
static int fullscreenheight;
|
||||||
|
|
||||||
#ifdef WITH_VMODE
|
#ifdef WITH_VMODE
|
||||||
static int vidmode_ext = 0;
|
static int vidmode_ext = 0;
|
||||||
static XF86VidModeModeInfo **vidmodes;
|
static XF86VidModeModeInfo **vidmodes;
|
||||||
static int num_vidmodes;
|
static int num_vidmodes;
|
||||||
static qboolean vidmode_active = false;
|
|
||||||
static int vidmode_usemode = -1; //so that it can be reset if they switch away.
|
static int vidmode_usemode = -1; //so that it can be reset if they switch away.
|
||||||
|
|
||||||
unsigned short originalramps[3][256];
|
static unsigned short originalramps[3][256];
|
||||||
qboolean originalapplied; //states that the origionalramps arrays are valid, and contain stuff that we should revert to on close
|
static qboolean originalapplied; //states that the origionalramps arrays are valid, and contain stuff that we should revert to on close
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void X_GoFullscreen(void);
|
||||||
|
void X_GoWindowed(void);
|
||||||
|
/*when alt-tabbing or whatever, the window manager creates a window, then destroys it again, resulting in weird focus events that trigger mode switches and grabs. using a timer reduces the weirdness and allows alt-tab to work properly. or at least better than it was working. that's the theory anyway*/
|
||||||
|
static unsigned int modeswitchtime;
|
||||||
|
static int modeswitchpending;
|
||||||
|
|
||||||
extern cvar_t _windowed_mouse;
|
extern cvar_t _windowed_mouse;
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
|
||||||
float gldepthmin, gldepthmax;
|
//qboolean is8bit = false;
|
||||||
|
//qboolean isPermedia = false;
|
||||||
const char *gl_vendor;
|
|
||||||
const char *gl_renderer;
|
|
||||||
const char *gl_version;
|
|
||||||
const char *gl_extensions;
|
|
||||||
|
|
||||||
qboolean is8bit = false;
|
|
||||||
qboolean isPermedia = false;
|
|
||||||
qboolean mouseactive = false;
|
|
||||||
qboolean ActiveApp = false;
|
qboolean ActiveApp = false;
|
||||||
|
static qboolean gracefulexit;
|
||||||
|
|
||||||
|
#define SYS_CLIPBOARD_SIZE 512
|
||||||
|
char clipboard_buffer[SYS_CLIPBOARD_SIZE];
|
||||||
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
@ -341,7 +352,7 @@ static void uninstall_grabs(void)
|
||||||
// XSync(vid_dpy, True);
|
// XSync(vid_dpy, True);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClearAllStates (void)
|
static void ClearAllStates (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -357,14 +368,11 @@ void ClearAllStates (void)
|
||||||
|
|
||||||
static void GetEvent(void)
|
static void GetEvent(void)
|
||||||
{
|
{
|
||||||
XEvent event;
|
XEvent event, rep;
|
||||||
int b;
|
int b;
|
||||||
unsigned int uc;
|
unsigned int uc;
|
||||||
qboolean wantwindowed;
|
|
||||||
qboolean x11violations = true;
|
qboolean x11violations = true;
|
||||||
|
Window mw;
|
||||||
if (!vid_dpy)
|
|
||||||
return;
|
|
||||||
|
|
||||||
XNextEvent(vid_dpy, &event);
|
XNextEvent(vid_dpy, &event);
|
||||||
|
|
||||||
|
@ -372,10 +380,24 @@ static void GetEvent(void)
|
||||||
case ResizeRequest:
|
case ResizeRequest:
|
||||||
vid.pixelwidth = event.xresizerequest.width;
|
vid.pixelwidth = event.xresizerequest.width;
|
||||||
vid.pixelheight = event.xresizerequest.height;
|
vid.pixelheight = event.xresizerequest.height;
|
||||||
|
Cvar_ForceCallback(&vid_conautoscale);
|
||||||
|
// if (fullscreenflags & FULLSCREEN_ACTIVE)
|
||||||
|
// XMoveWindow(vid_dpy, vid_window, 0, 0);
|
||||||
break;
|
break;
|
||||||
case ConfigureNotify:
|
case ConfigureNotify:
|
||||||
|
if (event.xconfigurerequest.window == vid_window)
|
||||||
|
{
|
||||||
vid.pixelwidth = event.xconfigurerequest.width;
|
vid.pixelwidth = event.xconfigurerequest.width;
|
||||||
vid.pixelheight = event.xconfigurerequest.height;
|
vid.pixelheight = event.xconfigurerequest.height;
|
||||||
|
Cvar_ForceCallback(&vid_conautoscale);
|
||||||
|
}
|
||||||
|
else if (event.xconfigurerequest.window == vid_decoywindow)
|
||||||
|
{
|
||||||
|
if (!(fullscreenflags & FULLSCREEN_ACTIVE))
|
||||||
|
XResizeWindow(vid_dpy, vid_window, event.xconfigurerequest.width, event.xconfigurerequest.height);
|
||||||
|
}
|
||||||
|
// if (fullscreenflags & FULLSCREEN_ACTIVE)
|
||||||
|
// XMoveWindow(vid_dpy, vid_window, 0, 0);
|
||||||
break;
|
break;
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
b = XLateKey(&event.xkey, &uc);
|
b = XLateKey(&event.xkey, &uc);
|
||||||
|
@ -446,14 +468,16 @@ static void GetEvent(void)
|
||||||
|
|
||||||
if (b>=0)
|
if (b>=0)
|
||||||
IN_KeyEvent(0, true, b, 0);
|
IN_KeyEvent(0, true, b, 0);
|
||||||
#ifdef WITH_VMODE
|
|
||||||
if (vidmode_ext && vidmode_usemode>=0)
|
/*
|
||||||
|
if (fullscreenflags & FULLSCREEN_LEGACY)
|
||||||
|
if (fullscreenflags & FULLSCREEN_VMODE)
|
||||||
if (!ActiveApp)
|
if (!ActiveApp)
|
||||||
{ //KDE doesn't seem to like us, in that you can't alt-tab back or click to activate.
|
{ //KDE doesn't seem to like us, in that you can't alt-tab back or click to activate.
|
||||||
//This allows us to steal input focus back from the window manager
|
//This allows us to steal input focus back from the window manager
|
||||||
XSetInputFocus(vid_dpy, vid_window, RevertToParent, CurrentTime);
|
XSetInputFocus(vid_dpy, vid_window, RevertToParent, CurrentTime);
|
||||||
}
|
}
|
||||||
#endif
|
*/
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
|
@ -492,43 +516,50 @@ static void GetEvent(void)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FocusIn:
|
case FocusIn:
|
||||||
|
//activeapp is if the game window is focused
|
||||||
ActiveApp = true;
|
ActiveApp = true;
|
||||||
#ifdef WITH_VMODE
|
|
||||||
if (vidmode_ext && vidmode_usemode>=0)
|
//but change modes to track the desktop window
|
||||||
|
// if (!(fullscreenflags & FULLSCREEN_ACTIVE) || event.xfocus.window != vid_decoywindow)
|
||||||
{
|
{
|
||||||
if (!vidmode_active)
|
modeswitchpending = 1;
|
||||||
{
|
modeswitchtime = Sys_Milliseconds() + 1500; /*fairly slow, to make sure*/
|
||||||
// change to the mode
|
|
||||||
XF86VidModeSwitchToMode(vid_dpy, scrnum, vidmodes[vidmode_usemode]);
|
|
||||||
vidmode_active = true;
|
|
||||||
// Move the viewport to top left
|
|
||||||
}
|
}
|
||||||
XF86VidModeSetViewPort(vid_dpy, scrnum, 0, 0);
|
|
||||||
}
|
//we we're focusing onto the game window and we're currently fullscreen, hide the other one so alt-tab won't select that instead of a real alternate app.
|
||||||
#endif
|
// if ((fullscreenflags & FULLSCREEN_ACTIVE) && (fullscreenflags & FULLSCREEN_LEGACY) && event.xfocus.window == vid_window)
|
||||||
Cvar_ForceCallback(&v_gamma);
|
// XUnmapWindow(vid_dpy, vid_decoywindow);
|
||||||
break;
|
break;
|
||||||
case FocusOut:
|
case FocusOut:
|
||||||
|
//if we're already active, the decoy window shouldn't be focused anyway.
|
||||||
|
if ((fullscreenflags & FULLSCREEN_ACTIVE) && event.xfocus.window == vid_decoywindow)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef WITH_VMODE
|
#ifdef WITH_VMODE
|
||||||
if (originalapplied)
|
if (originalapplied)
|
||||||
XF86VidModeSetGammaRamp(vid_dpy, scrnum, 256, originalramps[0], originalramps[1], originalramps[2]);
|
XF86VidModeSetGammaRamp(vid_dpy, scrnum, 256, originalramps[0], originalramps[1], originalramps[2]);
|
||||||
|
|
||||||
if (!COM_CheckParm("-stayactive"))
|
|
||||||
{ //a parameter that leaves the program fullscreen if you taskswitch.
|
|
||||||
//sounds pointless, works great with two moniters. :D
|
|
||||||
if (originalapplied)
|
|
||||||
XF86VidModeSetGammaRamp(vid_dpy, scrnum, 256, originalramps[0], originalramps[1], originalramps[2]);
|
|
||||||
if (vidmode_active)
|
|
||||||
{
|
|
||||||
XF86VidModeSwitchToMode(vid_dpy, scrnum, vidmodes[0]);
|
|
||||||
vidmode_active = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
mw = vid_window;
|
||||||
|
if ((fullscreenflags & FULLSCREEN_LEGACY) && (fullscreenflags & FULLSCREEN_ACTIVE))
|
||||||
|
mw = vid_decoywindow;
|
||||||
|
|
||||||
|
if (event.xfocus.window == mw)
|
||||||
|
{
|
||||||
ActiveApp = false;
|
ActiveApp = false;
|
||||||
|
if (old_windowed_mouse)
|
||||||
|
{
|
||||||
|
Con_DPrintf("uninstall grabs\n");
|
||||||
|
uninstall_grabs();
|
||||||
|
XUndefineCursor(vid_dpy, vid_window);
|
||||||
|
old_windowed_mouse = false;
|
||||||
|
}
|
||||||
ClearAllStates();
|
ClearAllStates();
|
||||||
|
}
|
||||||
|
modeswitchpending = -1;
|
||||||
|
modeswitchtime = Sys_Milliseconds() + 100; /*fairly fast, so we don't unapply stuff when switching to other progs with delays*/
|
||||||
break;
|
break;
|
||||||
case ClientMessage:
|
case ClientMessage:
|
||||||
{
|
{
|
||||||
|
@ -537,7 +568,10 @@ static void GetEvent(void)
|
||||||
{
|
{
|
||||||
char *protname = XGetAtomName(vid_dpy, event.xclient.data.l[0]);
|
char *protname = XGetAtomName(vid_dpy, event.xclient.data.l[0]);
|
||||||
if (!strcmp(protname, "WM_DELETE_WINDOW"))
|
if (!strcmp(protname, "WM_DELETE_WINDOW"))
|
||||||
Cmd_ExecuteString("menu_quit", RESTRICT_LOCAL);
|
{
|
||||||
|
Cmd_ExecuteString("menu_quit prompt", RESTRICT_LOCAL);
|
||||||
|
XSetInputFocus(vid_dpy, vid_window, RevertToParent, CurrentTime);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
Con_Printf("Got message %s\n", protname);
|
Con_Printf("Got message %s\n", protname);
|
||||||
XFree(protname);
|
XFree(protname);
|
||||||
|
@ -547,36 +581,39 @@ static void GetEvent(void)
|
||||||
XFree(name);
|
XFree(name);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
// Con_Printf("%x\n", event.type);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
wantwindowed = !!_windowed_mouse.value;
|
#if 1
|
||||||
if (!ActiveApp)
|
case SelectionRequest: //needed for copy-to-clipboard
|
||||||
wantwindowed = false;
|
|
||||||
if (Key_MouseShouldBeFree() && !vidglx_fullscreen)
|
|
||||||
wantwindowed = false;
|
|
||||||
|
|
||||||
if (old_windowed_mouse != wantwindowed)
|
|
||||||
{
|
{
|
||||||
old_windowed_mouse = wantwindowed;
|
Atom xa_string = XInternAtom(vid_dpy, "UTF8_STRING", false);
|
||||||
|
memset(&rep, 0, sizeof(rep));
|
||||||
if (!wantwindowed)
|
if (event.xselectionrequest.property == None)
|
||||||
|
event.xselectionrequest.property = XInternAtom(vid_dpy, "foobar2000", false);
|
||||||
|
if (event.xselectionrequest.property != None && event.xselectionrequest.target == xa_string)
|
||||||
{
|
{
|
||||||
Con_DPrintf("uninstall grabs\n");
|
XChangeProperty(vid_dpy, event.xselectionrequest.requestor, event.xselectionrequest.property, event.xselectionrequest.target, 8, PropModeReplace, (void*)clipboard_buffer, strlen(clipboard_buffer));
|
||||||
/* ungrab the pointer */
|
rep.xselection.property = event.xselectionrequest.property;
|
||||||
uninstall_grabs();
|
|
||||||
XUndefineCursor(vid_dpy, vid_window);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Con_DPrintf("install grabs\n");
|
rep.xselection.property = None;
|
||||||
/* grab the pointer */
|
|
||||||
install_grabs();
|
|
||||||
/*hide the cursor*/
|
|
||||||
XDefineCursor(vid_dpy, vid_window, vid_nullcursor);
|
|
||||||
}
|
}
|
||||||
|
rep.xselection.type = SelectionNotify;
|
||||||
|
rep.xselection.serial = 0;
|
||||||
|
rep.xselection.send_event = true;
|
||||||
|
rep.xselection.display = rep.xselection.display;
|
||||||
|
rep.xselection.requestor = event.xselectionrequest.requestor;
|
||||||
|
rep.xselection.selection = event.xselectionrequest.selection;
|
||||||
|
rep.xselection.target = event.xselectionrequest.target;
|
||||||
|
rep.xselection.time = event.xselectionrequest.time;
|
||||||
|
XSendEvent(vid_dpy, event.xselectionrequest.requestor, 0, 0, &rep);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
default:
|
||||||
|
// Con_Printf("%x\n", event.type);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -610,10 +647,11 @@ void GLVID_Shutdown(void)
|
||||||
if (vid_nullcursor)
|
if (vid_nullcursor)
|
||||||
XFreeCursor(vid_dpy, vid_nullcursor);
|
XFreeCursor(vid_dpy, vid_nullcursor);
|
||||||
#ifdef WITH_VMODE
|
#ifdef WITH_VMODE
|
||||||
if (vid_dpy) {
|
if (vid_dpy)
|
||||||
if (vidmode_active)
|
{
|
||||||
|
if (fullscreenflags & FULLSCREEN_VMODEACTIVE)
|
||||||
XF86VidModeSwitchToMode(vid_dpy, scrnum, vidmodes[0]);
|
XF86VidModeSwitchToMode(vid_dpy, scrnum, vidmodes[0]);
|
||||||
vidmode_active = false;
|
fullscreenflags &= ~FULLSCREEN_VMODEACTIVE;
|
||||||
|
|
||||||
if (vidmodes)
|
if (vidmodes)
|
||||||
XFree(vidmodes);
|
XFree(vidmodes);
|
||||||
|
@ -639,11 +677,16 @@ void signal_handler(int sig)
|
||||||
Sys_Quit();
|
Sys_Quit();
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
void signal_handler_graceful(int sig)
|
||||||
|
{
|
||||||
|
gracefulexit = true;
|
||||||
|
// signal(sig, signal_handler);
|
||||||
|
}
|
||||||
|
|
||||||
void InitSig(void)
|
void InitSig(void)
|
||||||
{
|
{
|
||||||
signal(SIGHUP, signal_handler);
|
signal(SIGHUP, signal_handler);
|
||||||
signal(SIGINT, signal_handler);
|
signal(SIGINT, signal_handler_graceful);
|
||||||
signal(SIGQUIT, signal_handler);
|
signal(SIGQUIT, signal_handler);
|
||||||
signal(SIGILL, signal_handler);
|
signal(SIGILL, signal_handler);
|
||||||
signal(SIGTRAP, signal_handler);
|
signal(SIGTRAP, signal_handler);
|
||||||
|
@ -712,7 +755,7 @@ void GLVID_SetPalette (unsigned char *palette)
|
||||||
//
|
//
|
||||||
// 8 8 8 encoding
|
// 8 8 8 encoding
|
||||||
//
|
//
|
||||||
Con_Printf("Converting 8to24\n");
|
Con_DPrintf("Converting 8to24\n");
|
||||||
|
|
||||||
pal = palette;
|
pal = palette;
|
||||||
table = d_8to24rgbtable;
|
table = d_8to24rgbtable;
|
||||||
|
@ -755,13 +798,180 @@ void GL_EndRendering (void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
qboolean GLVID_Is8bit(void)
|
#include "bymorphed.h"
|
||||||
|
void X_StoreIcon(Window wnd)
|
||||||
{
|
{
|
||||||
return is8bit;
|
int i;
|
||||||
|
unsigned long data[64*64+2];
|
||||||
|
unsigned int *indata = (unsigned int*)icon.pixel_data;
|
||||||
|
Atom propname = XInternAtom(vid_dpy, "_NET_WM_ICON", false);
|
||||||
|
Atom proptype = XInternAtom(vid_dpy, "CARDINAL", false);
|
||||||
|
|
||||||
|
data[0] = icon.width;
|
||||||
|
data[1] = icon.height;
|
||||||
|
for (i = 0; i < data[0]*data[1]; i++)
|
||||||
|
data[i+2] = indata[i];
|
||||||
|
|
||||||
|
XChangeProperty(vid_dpy, wnd, propname, proptype, 32, PropModeReplace, (void*)data, data[0]*data[1]+2);
|
||||||
|
}
|
||||||
|
|
||||||
|
void X_GoFullscreen(void)
|
||||||
|
{
|
||||||
|
XEvent xev;
|
||||||
|
|
||||||
|
//for NETWM window managers
|
||||||
|
memset(&xev, 0, sizeof(xev));
|
||||||
|
xev.type = ClientMessage;
|
||||||
|
xev.xclient.window = vid_window;
|
||||||
|
xev.xclient.message_type = XInternAtom(vid_dpy, "_NET_WM_STATE", False);
|
||||||
|
xev.xclient.format = 32;
|
||||||
|
xev.xclient.data.l[0] = 1; //add
|
||||||
|
xev.xclient.data.l[1] = XInternAtom(vid_dpy, "_NET_WM_STATE_FULLSCREEN", False);
|
||||||
|
xev.xclient.data.l[2] = 0;
|
||||||
|
XSync(vid_dpy, False);
|
||||||
|
XSendEvent(vid_dpy, DefaultRootWindow(vid_dpy), False, SubstructureNotifyMask, &xev);
|
||||||
|
XSync(vid_dpy, False);
|
||||||
|
|
||||||
|
//for any other window managers, and broken NETWM
|
||||||
|
XMoveResizeWindow(vid_dpy, vid_window, 0, 0, fullscreenwidth, fullscreenheight);
|
||||||
|
XSync(vid_dpy, False);
|
||||||
|
}
|
||||||
|
void X_GoWindowed(void)
|
||||||
|
{
|
||||||
|
XEvent xev;
|
||||||
|
XFlush(vid_dpy);
|
||||||
|
XSync(vid_dpy, False);
|
||||||
|
|
||||||
|
memset(&xev, 0, sizeof(xev));
|
||||||
|
xev.type = ClientMessage;
|
||||||
|
xev.xclient.window = vid_window;
|
||||||
|
xev.xclient.message_type = XInternAtom(vid_dpy, "_NET_WM_STATE", False);
|
||||||
|
xev.xclient.format = 32;
|
||||||
|
xev.xclient.data.l[0] = 0; //remove
|
||||||
|
xev.xclient.data.l[1] = XInternAtom(vid_dpy, "_NET_WM_STATE_FULLSCREEN", False);
|
||||||
|
xev.xclient.data.l[2] = 0;
|
||||||
|
XSendEvent(vid_dpy, DefaultRootWindow(vid_dpy), False, SubstructureNotifyMask, &xev);
|
||||||
|
XSync(vid_dpy, False);
|
||||||
|
|
||||||
|
//XMoveResizeWindow(vid_dpy, vid_window, 0, 0, 640, 480);
|
||||||
|
}
|
||||||
|
qboolean X_CheckWMFullscreenAvailable(void)
|
||||||
|
{
|
||||||
|
//root window must have _NET_SUPPORTING_WM_CHECK which is a Window created by the WM
|
||||||
|
//the WM's window must have _NET_WM_NAME set, which is the name of the window manager
|
||||||
|
//if we can find those, then the window manager has not crashed.
|
||||||
|
//if we can then find _NET_WM_STATE_FULLSCREEN in the _NET_SUPPORTED atom list on the root, then we can get fullscreen mode from the WM
|
||||||
|
//and we'll have no alt-tab issues whatsoever.
|
||||||
|
|
||||||
|
Atom xa_net_supporting_wm_check = XInternAtom(vid_dpy, "_NET_SUPPORTING_WM_CHECK", False);
|
||||||
|
Atom xa_net_wm_name = XInternAtom(vid_dpy, "_NET_WM_NAME", False);
|
||||||
|
Atom xa_net_supported = XInternAtom(vid_dpy, "_NET_SUPPORTED", False);
|
||||||
|
Atom xa_net_wm_state_fullscreen = XInternAtom(vid_dpy, "_NET_WM_STATE_FULLSCREEN", False);
|
||||||
|
Window wmwindow;
|
||||||
|
unsigned char *prop;
|
||||||
|
unsigned long bytes_after, nitems;
|
||||||
|
Atom type;
|
||||||
|
int format;
|
||||||
|
qboolean success = false;
|
||||||
|
unsigned char *wmname;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
|
||||||
|
if (XGetWindowProperty(vid_dpy, vid_root, xa_net_supporting_wm_check, 0, 16384, False, AnyPropertyType, &type, &format, &nitems, &bytes_after, &prop) != Success || prop == NULL)
|
||||||
|
{
|
||||||
|
Con_Printf("Window manager not identified\n");
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
wmwindow = *(Window *)prop;
|
||||||
|
XFree(prop);
|
||||||
|
|
||||||
|
if (XGetWindowProperty(vid_dpy, wmwindow, xa_net_wm_name, 0, 16384, False, AnyPropertyType, &type, &format, &nitems, &bytes_after, &wmname) != Success || wmname == NULL)
|
||||||
|
{
|
||||||
|
Con_Printf("Window manager crashed or something\n");
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (XGetWindowProperty(vid_dpy, vid_root, xa_net_supported, 0, 16384, False, AnyPropertyType, &type, &format, &nitems, &bytes_after, &prop) != Success || prop == NULL)
|
||||||
|
{
|
||||||
|
Con_Printf("Window manager \"%s\" support nothing\n", wmname);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (i = 0; i < nitems; i++)
|
||||||
|
{
|
||||||
|
// Con_Printf("supported: %s\n", XGetAtomName(vid_dpy, ((Atom*)prop)[i]));
|
||||||
|
if (((Atom*)prop)[i] == xa_net_wm_state_fullscreen)
|
||||||
|
{
|
||||||
|
success = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!success)
|
||||||
|
Con_Printf("Window manager \"%s\" does not appear to support fullscreen\n", wmname);
|
||||||
|
else
|
||||||
|
Con_Printf("Window manager \"%s\" supports fullscreen\n", wmname);
|
||||||
|
XFree(prop);
|
||||||
|
}
|
||||||
|
XFree(wmname);
|
||||||
|
}
|
||||||
|
return success;
|
||||||
|
}
|
||||||
|
|
||||||
|
Window X_CreateWindow(qboolean override, XVisualInfo *visinfo, unsigned int width, unsigned int height)
|
||||||
|
{
|
||||||
|
Window wnd;
|
||||||
|
XSetWindowAttributes attr;
|
||||||
|
XSizeHints szhints;
|
||||||
|
unsigned int mask;
|
||||||
|
Atom prots[1];
|
||||||
|
|
||||||
|
/* window attributes */
|
||||||
|
attr.background_pixel = 0;
|
||||||
|
attr.border_pixel = 0;
|
||||||
|
attr.colormap = XCreateColormap(vid_dpy, vid_root, visinfo->visual, AllocNone);
|
||||||
|
attr.event_mask = X_MASK;
|
||||||
|
attr.backing_store = NotUseful;
|
||||||
|
attr.save_under = False;
|
||||||
|
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask | CWBackingStore |CWSaveUnder;
|
||||||
|
|
||||||
|
// override redirect prevents the windowmanager from finding out about us, and thus will not apply borders to our window.
|
||||||
|
if (override)
|
||||||
|
{
|
||||||
|
mask |= CWOverrideRedirect;
|
||||||
|
attr.override_redirect = True;
|
||||||
|
}
|
||||||
|
|
||||||
|
memset(&szhints, 0, sizeof(szhints));
|
||||||
|
szhints.flags = PMinSize;
|
||||||
|
szhints.min_width = 320;
|
||||||
|
szhints.min_height = 200;
|
||||||
|
szhints.x = 0;
|
||||||
|
szhints.y = 0;
|
||||||
|
szhints.width = width;
|
||||||
|
szhints.height = height;
|
||||||
|
|
||||||
|
wnd = XCreateWindow(vid_dpy, vid_root, 0, 0, width, height,
|
||||||
|
0, visinfo->depth, InputOutput,
|
||||||
|
visinfo->visual, mask, &attr);
|
||||||
|
/*ask the window manager to stop triggering bugs in Xlib*/
|
||||||
|
prots[0] = XInternAtom(vid_dpy, "WM_DELETE_WINDOW", False);
|
||||||
|
XSetWMProtocols(vid_dpy, wnd, prots, sizeof(prots)/sizeof(prots[0]));
|
||||||
|
XSetWMNormalHints(vid_dpy, wnd, &szhints);
|
||||||
|
/*set caption*/
|
||||||
|
XStoreName(vid_dpy, wnd, "FTE QuakeWorld");
|
||||||
|
XSetIconName(vid_dpy, wnd, "FTEQW");
|
||||||
|
X_StoreIcon(wnd);
|
||||||
|
/*make it visible*/
|
||||||
|
XMapWindow(vid_dpy, wnd);
|
||||||
|
|
||||||
|
return wnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
|
qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
|
||||||
{
|
{
|
||||||
|
int width = info->width; //can override these if vmode isn't available
|
||||||
|
int height = info->height;
|
||||||
int i;
|
int i;
|
||||||
int attrib[] = {
|
int attrib[] = {
|
||||||
GLX_RGBA,
|
GLX_RGBA,
|
||||||
|
@ -773,15 +983,11 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
|
||||||
GLX_STENCIL_SIZE, 8,
|
GLX_STENCIL_SIZE, 8,
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
XSetWindowAttributes attr;
|
|
||||||
unsigned long mask;
|
|
||||||
Window root;
|
|
||||||
#ifdef USE_EGL
|
#ifdef USE_EGL
|
||||||
XVisualInfo vinfodef;
|
XVisualInfo vinfodef;
|
||||||
#endif
|
#endif
|
||||||
XVisualInfo *visinfo;
|
XVisualInfo *visinfo;
|
||||||
qboolean fullscreen = false;
|
qboolean fullscreen = false;
|
||||||
Atom prots[1];
|
|
||||||
|
|
||||||
#ifdef WITH_VMODE
|
#ifdef WITH_VMODE
|
||||||
int MajorVersion, MinorVersion;
|
int MajorVersion, MinorVersion;
|
||||||
|
@ -807,26 +1013,6 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// interpret command-line params
|
|
||||||
|
|
||||||
// set vid parameters
|
|
||||||
if ((i = COM_CheckParm("-conwidth")) != 0)
|
|
||||||
vid.width = Q_atoi(com_argv[i+1]);
|
|
||||||
else
|
|
||||||
vid.width = 640;
|
|
||||||
|
|
||||||
vid.width &= ~7; // make it a multiple of eight
|
|
||||||
|
|
||||||
if (vid.width < 320)
|
|
||||||
vid.width = 320;
|
|
||||||
|
|
||||||
// pick a conheight that matches with correct aspect
|
|
||||||
vid.height = vid.width*3 / 4;
|
|
||||||
|
|
||||||
if ((i = COM_CheckParm("-conheight")) != 0)
|
|
||||||
vid.height = Q_atoi(com_argv[i+1]);
|
|
||||||
if (vid.height < 200)
|
|
||||||
vid.height = 200;
|
|
||||||
if (!vid_dpy)
|
if (!vid_dpy)
|
||||||
vid_dpy = XOpenDisplay(NULL);
|
vid_dpy = XOpenDisplay(NULL);
|
||||||
if (!vid_dpy)
|
if (!vid_dpy)
|
||||||
|
@ -836,7 +1022,7 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
|
||||||
}
|
}
|
||||||
|
|
||||||
scrnum = DefaultScreen(vid_dpy);
|
scrnum = DefaultScreen(vid_dpy);
|
||||||
root = RootWindow(vid_dpy, scrnum);
|
vid_root = RootWindow(vid_dpy, scrnum);
|
||||||
|
|
||||||
#ifdef WITH_VMODE //find out if it's supported on this pc.
|
#ifdef WITH_VMODE //find out if it's supported on this pc.
|
||||||
MajorVersion = MinorVersion = 0;
|
MajorVersion = MinorVersion = 0;
|
||||||
|
@ -851,6 +1037,8 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
fullscreenflags = 0;
|
||||||
|
|
||||||
#ifdef WITH_VMODE
|
#ifdef WITH_VMODE
|
||||||
vidmode_usemode = -1;
|
vidmode_usemode = -1;
|
||||||
if (vidmode_ext)
|
if (vidmode_ext)
|
||||||
|
@ -866,12 +1054,12 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
|
||||||
|
|
||||||
for (i = 0; i < num_vidmodes; i++)
|
for (i = 0; i < num_vidmodes; i++)
|
||||||
{
|
{
|
||||||
if (info->width > vidmodes[i]->hdisplay ||
|
if (width > vidmodes[i]->hdisplay ||
|
||||||
info->height > vidmodes[i]->vdisplay)
|
height > vidmodes[i]->vdisplay)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
x = info->width - vidmodes[i]->hdisplay;
|
x = width - vidmodes[i]->hdisplay;
|
||||||
y = info->height - vidmodes[i]->vdisplay;
|
y = height - vidmodes[i]->vdisplay;
|
||||||
dist = (x * x) + (y * y);
|
dist = (x * x) + (y * y);
|
||||||
if (dist < best_dist)
|
if (dist < best_dist)
|
||||||
{
|
{
|
||||||
|
@ -880,22 +1068,42 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (best_fit != -1 && (!best_dist || COM_CheckParm("-fullscreen")))
|
if (best_fit != -1)
|
||||||
{
|
{
|
||||||
// change to the mode
|
// change to the mode
|
||||||
XF86VidModeSwitchToMode(vid_dpy, scrnum, vidmodes[vidmode_usemode=best_fit]);
|
if (XF86VidModeSwitchToMode(vid_dpy, scrnum, vidmodes[vidmode_usemode=best_fit]))
|
||||||
vidmode_active = true;
|
{
|
||||||
|
width = vidmodes[best_fit]->hdisplay;
|
||||||
|
height = vidmodes[best_fit]->vdisplay;
|
||||||
// Move the viewport to top left
|
// Move the viewport to top left
|
||||||
XF86VidModeSetViewPort(vid_dpy, scrnum, 0, 0);
|
XF86VidModeSetViewPort(vid_dpy, scrnum, 0, 0);
|
||||||
|
XSync(vid_dpy, False);
|
||||||
|
|
||||||
|
fullscreenflags |= FULLSCREEN_VMODE | FULLSCREEN_VMODEACTIVE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fullscreen = 0;
|
Con_Printf("Failed to apply mode %i*%i\n", vidmodes[best_fit]->hdisplay, vidmodes[best_fit]->vdisplay);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
vidglx_fullscreen = fullscreen;
|
if (fullscreen)
|
||||||
|
{
|
||||||
|
if (!(fullscreenflags & FULLSCREEN_VMODE))
|
||||||
|
{
|
||||||
|
//if we can't actually change the mode, our fullscreen is the size of the root window
|
||||||
|
XWindowAttributes xwa;
|
||||||
|
XGetWindowAttributes(vid_dpy, DefaultRootWindow(vid_dpy), &xwa);
|
||||||
|
width = xwa.width;
|
||||||
|
height = xwa.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (X_CheckWMFullscreenAvailable())
|
||||||
|
fullscreenflags |= FULLSCREEN_WM;
|
||||||
|
else
|
||||||
|
fullscreenflags |= FULLSCREEN_LEGACY;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef USE_EGL
|
#ifdef USE_EGL
|
||||||
visinfo = &vinfodef;
|
visinfo = &vinfodef;
|
||||||
|
@ -912,43 +1120,21 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* window attributes */
|
|
||||||
attr.background_pixel = 0;
|
|
||||||
attr.border_pixel = 0;
|
|
||||||
attr.colormap = XCreateColormap(vid_dpy, root, visinfo->visual, AllocNone);
|
|
||||||
attr.event_mask = X_MASK;
|
|
||||||
mask = CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
|
|
||||||
|
|
||||||
#ifdef WITH_VMODE //get rid of borders
|
|
||||||
// fullscreen
|
|
||||||
if (vidmode_active) {
|
|
||||||
mask = CWBackPixel | CWColormap | CWSaveUnder | CWBackingStore |
|
|
||||||
CWEventMask | CWOverrideRedirect;
|
|
||||||
attr.override_redirect = True;
|
|
||||||
attr.backing_store = NotUseful;
|
|
||||||
attr.save_under = False;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
vid_window = XCreateWindow(vid_dpy, root, 0, 0, info->width, info->height,
|
|
||||||
0, visinfo->depth, InputOutput,
|
|
||||||
visinfo->visual, mask, &attr);
|
|
||||||
|
|
||||||
ActiveApp = false;
|
ActiveApp = false;
|
||||||
/*ask the window manager to stop triggering bugs in Xlib*/
|
if (fullscreenflags & FULLSCREEN_LEGACY)
|
||||||
prots[0] = XInternAtom(vid_dpy, "WM_DELETE_WINDOW", False);
|
{
|
||||||
XSetWMProtocols(vid_dpy, vid_window, prots, sizeof(prots)/sizeof(prots[0]));
|
vid_decoywindow = X_CreateWindow(false, visinfo, 640, 480);
|
||||||
/*set caption*/
|
vid_window = X_CreateWindow(true, visinfo, width, height);
|
||||||
XStoreName(vid_dpy, vid_window, FULLENGINENAME);
|
}
|
||||||
/*make it visibl*/
|
else
|
||||||
XMapWindow(vid_dpy, vid_window);
|
vid_window = X_CreateWindow(false, visinfo, width, height);
|
||||||
/*put it somewhere*/
|
|
||||||
XMoveWindow(vid_dpy, vid_window, 0, 0);
|
|
||||||
|
|
||||||
//XFree(visinfo);
|
CL_UpdateWindowTitle();
|
||||||
|
/*make it visible*/
|
||||||
|
|
||||||
#ifdef WITH_VMODE
|
#ifdef WITH_VMODE
|
||||||
if (vidmode_active) {
|
if (fullscreen & FULLSCREEN_VMODE)
|
||||||
|
{
|
||||||
XRaiseWindow(vid_dpy, vid_window);
|
XRaiseWindow(vid_dpy, vid_window);
|
||||||
XWarpPointer(vid_dpy, None, vid_window, 0, 0, 0, 0, 0, 0);
|
XWarpPointer(vid_dpy, None, vid_window, 0, 0, 0, 0, 0, 0);
|
||||||
XFlush(vid_dpy);
|
XFlush(vid_dpy);
|
||||||
|
@ -1008,17 +1194,19 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
|
||||||
|
|
||||||
InitSig(); // trap evil signals
|
InitSig(); // trap evil signals
|
||||||
|
|
||||||
vid.pixelwidth = info->width;
|
//probably going to be resized in the event handler
|
||||||
vid.pixelheight = info->height;
|
vid.pixelwidth = fullscreenwidth = width;
|
||||||
|
vid.pixelheight = fullscreenheight = height;
|
||||||
if (vid.height > info->height)
|
|
||||||
vid.height = info->height;
|
|
||||||
if (vid.width > info->width)
|
|
||||||
vid.width = info->width;
|
|
||||||
|
|
||||||
vid.numpages = 2;
|
vid.numpages = 2;
|
||||||
|
|
||||||
Con_SafePrintf ("Video mode %dx%d initialized.\n", info->width, info->height);
|
Con_SafePrintf ("Video mode %dx%d initialized.\n", width, height);
|
||||||
|
if (fullscreenflags & FULLSCREEN_WM)
|
||||||
|
X_GoFullscreen();
|
||||||
|
if (fullscreenflags & FULLSCREEN_LEGACY)
|
||||||
|
XMoveResizeWindow(vid_dpy, vid_window, 0, 0, fullscreenwidth, fullscreenheight);
|
||||||
|
if (fullscreenflags)
|
||||||
|
fullscreenflags |= FULLSCREEN_ACTIVE;
|
||||||
|
|
||||||
vid.recalc_refdef = 1; // force a surface cache flush
|
vid.recalc_refdef = 1; // force a surface cache flush
|
||||||
|
|
||||||
|
@ -1030,15 +1218,131 @@ qboolean GLVID_Init (rendererstate_t *info, unsigned char *palette)
|
||||||
else
|
else
|
||||||
XSetInputFocus(vid_dpy, vid_window, RevertToParent, CurrentTime);
|
XSetInputFocus(vid_dpy, vid_window, RevertToParent, CurrentTime);
|
||||||
XRaiseWindow(vid_dpy, vid_window);
|
XRaiseWindow(vid_dpy, vid_window);
|
||||||
|
if (fullscreenflags & FULLSCREEN_LEGACY)
|
||||||
|
XMoveResizeWindow(vid_dpy, vid_window, 0, 0, fullscreenwidth, fullscreenheight);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sys_SendKeyEvents(void)
|
void Sys_SendKeyEvents(void)
|
||||||
{
|
{
|
||||||
if (vid_dpy && vid_window) {
|
if (gracefulexit)
|
||||||
|
{
|
||||||
|
Cbuf_AddText("\nquit\n", RESTRICT_LOCAL);
|
||||||
|
gracefulexit = false;
|
||||||
|
}
|
||||||
|
if (vid_dpy && vid_window)
|
||||||
|
{
|
||||||
|
qboolean wantwindowed;
|
||||||
|
|
||||||
while (XPending(vid_dpy))
|
while (XPending(vid_dpy))
|
||||||
GetEvent();
|
GetEvent();
|
||||||
|
|
||||||
|
if (modeswitchpending && modeswitchtime < Sys_Milliseconds())
|
||||||
|
{
|
||||||
|
if (old_windowed_mouse)
|
||||||
|
{
|
||||||
|
Con_DPrintf("uninstall grabs\n");
|
||||||
|
uninstall_grabs();
|
||||||
|
XUndefineCursor(vid_dpy, vid_window);
|
||||||
|
old_windowed_mouse = false;
|
||||||
|
}
|
||||||
|
if (modeswitchpending > 0)
|
||||||
|
{
|
||||||
|
//entering fullscreen mode
|
||||||
|
#ifdef WITH_VMODE
|
||||||
|
if (fullscreenflags & FULLSCREEN_VMODE)
|
||||||
|
{
|
||||||
|
if (!(fullscreenflags & FULLSCREEN_VMODEACTIVE))
|
||||||
|
{
|
||||||
|
// change to the mode
|
||||||
|
XF86VidModeSwitchToMode(vid_dpy, scrnum, vidmodes[vidmode_usemode]);
|
||||||
|
fullscreenflags |= FULLSCREEN_VMODEACTIVE;
|
||||||
|
// Move the viewport to top left
|
||||||
|
}
|
||||||
|
XF86VidModeSetViewPort(vid_dpy, scrnum, 0, 0);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
Cvar_ForceCallback(&v_gamma);
|
||||||
|
|
||||||
|
/*release the mouse now, because we're paranoid about clip regions*/
|
||||||
|
if (fullscreenflags & FULLSCREEN_WM)
|
||||||
|
X_GoFullscreen();
|
||||||
|
if (fullscreenflags & FULLSCREEN_LEGACY)
|
||||||
|
{
|
||||||
|
XMoveWindow(vid_dpy, vid_window, 0, 0);
|
||||||
|
XReparentWindow(vid_dpy, vid_window, vid_root, 0, 0);
|
||||||
|
//XUnmapWindow(vid_dpy, vid_decoywindow);
|
||||||
|
//make sure we have it
|
||||||
|
XSetInputFocus(vid_dpy, vid_window, RevertToParent, CurrentTime);
|
||||||
|
XRaiseWindow(vid_dpy, vid_window);
|
||||||
|
XMoveResizeWindow(vid_dpy, vid_window, 0, 0, fullscreenwidth, fullscreenheight);
|
||||||
|
}
|
||||||
|
if (fullscreenflags)
|
||||||
|
fullscreenflags |= FULLSCREEN_ACTIVE;
|
||||||
|
}
|
||||||
|
if (modeswitchpending < 0)
|
||||||
|
{
|
||||||
|
//leave fullscreen mode
|
||||||
|
if (!COM_CheckParm("-stayactive"))
|
||||||
|
{ //a parameter that leaves the program fullscreen if you taskswitch.
|
||||||
|
//sounds pointless, works great with two moniters. :D
|
||||||
|
if (fullscreenflags & FULLSCREEN_VMODE)
|
||||||
|
{
|
||||||
|
if (originalapplied)
|
||||||
|
XF86VidModeSetGammaRamp(vid_dpy, scrnum, 256, originalramps[0], originalramps[1], originalramps[2]);
|
||||||
|
if (fullscreenflags & FULLSCREEN_VMODEACTIVE)
|
||||||
|
{
|
||||||
|
XF86VidModeSwitchToMode(vid_dpy, scrnum, vidmodes[0]);
|
||||||
|
fullscreenflags &= ~FULLSCREEN_VMODEACTIVE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fullscreenflags & FULLSCREEN_WM)
|
||||||
|
X_GoWindowed();
|
||||||
|
if (fullscreenflags & FULLSCREEN_LEGACY)
|
||||||
|
{
|
||||||
|
XMapWindow(vid_dpy, vid_decoywindow);
|
||||||
|
XReparentWindow(vid_dpy, vid_window, vid_decoywindow, 0, 0);
|
||||||
|
XResizeWindow(vid_dpy, vid_decoywindow, 640, 480);
|
||||||
|
}
|
||||||
|
fullscreenflags &= ~FULLSCREEN_ACTIVE;
|
||||||
|
}
|
||||||
|
modeswitchpending = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (modeswitchpending)
|
||||||
|
return;
|
||||||
|
|
||||||
|
wantwindowed = !!_windowed_mouse.value;
|
||||||
|
if (!ActiveApp)
|
||||||
|
wantwindowed = false;
|
||||||
|
if (Key_MouseShouldBeFree() && !fullscreenflags)
|
||||||
|
wantwindowed = false;
|
||||||
|
|
||||||
|
if (old_windowed_mouse != wantwindowed)
|
||||||
|
{
|
||||||
|
old_windowed_mouse = wantwindowed;
|
||||||
|
|
||||||
|
if (!wantwindowed)
|
||||||
|
{
|
||||||
|
Con_DPrintf("uninstall grabs\n");
|
||||||
|
/* ungrab the pointer */
|
||||||
|
uninstall_grabs();
|
||||||
|
XUndefineCursor(vid_dpy, vid_window);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Con_DPrintf("install grabs\n");
|
||||||
|
/* grab the pointer */
|
||||||
|
if (fullscreenflags & FULLSCREEN_ACTIVE)
|
||||||
|
install_grabs();
|
||||||
|
else
|
||||||
|
uninstall_grabs(); //don't grab the mouse when fullscreen. its a: not needed. b: breaks gnome's alt-tab.
|
||||||
|
/*hide the cursor*/
|
||||||
|
XDefineCursor(vid_dpy, vid_window, vid_nullcursor);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1072,3 +1376,41 @@ void GLVID_SetCaption(char *text)
|
||||||
XStoreName(vid_dpy, vid_window, text);
|
XStoreName(vid_dpy, vid_window, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
char *Sys_GetClipboard(void)
|
||||||
|
{
|
||||||
|
Atom xa_clipboard = XInternAtom(vid_dpy, "PRIMARY", false);
|
||||||
|
Atom xa_string = XInternAtom(vid_dpy, "UTF8_STRING", false);
|
||||||
|
Window clipboardowner = XGetSelectionOwner(vid_dpy, xa_clipboard);
|
||||||
|
if (clipboardowner != None && clipboardowner != vid_window)
|
||||||
|
{
|
||||||
|
int fmt;
|
||||||
|
Atom type;
|
||||||
|
unsigned long nitems, bytesleft;
|
||||||
|
unsigned char *data;
|
||||||
|
XConvertSelection(vid_dpy, xa_clipboard, xa_string, None, vid_window, CurrentTime);
|
||||||
|
XFlush(vid_dpy);
|
||||||
|
XGetWindowProperty(vid_dpy, vid_window, xa_string, 0, 0, False, AnyPropertyType, &type, &fmt, &nitems, &bytesleft, &data);
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
return clipboard_buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Sys_CloseClipboard(char *bf)
|
||||||
|
{
|
||||||
|
if (bf == clipboard_buffer)
|
||||||
|
return;
|
||||||
|
|
||||||
|
XFree(bf);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Sys_SaveClipboard(char *text)
|
||||||
|
{
|
||||||
|
Atom xa_clipboard = XInternAtom(vid_dpy, "PRIMARY", false);
|
||||||
|
Q_strncpyz(clipboard_buffer, text, SYS_CLIPBOARD_SIZE);
|
||||||
|
XSetSelectionOwner(vid_dpy, xa_clipboard, vid_window, CurrentTime);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ void HTTP_ServerShutdown(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct HTTP_active_connections_s {
|
typedef struct HTTP_active_connections_s {
|
||||||
int datasock;
|
SOCKET datasock;
|
||||||
vfsfile_t *file;
|
vfsfile_t *file;
|
||||||
struct HTTP_active_connections_s *next;
|
struct HTTP_active_connections_s *next;
|
||||||
|
|
||||||
|
@ -88,19 +88,19 @@ typedef struct HTTP_active_connections_s {
|
||||||
qboolean close;
|
qboolean close;
|
||||||
|
|
||||||
char *inbuffer;
|
char *inbuffer;
|
||||||
int inbuffersize;
|
unsigned int inbuffersize;
|
||||||
int inbufferused;
|
unsigned int inbufferused;
|
||||||
|
|
||||||
char *outbuffer;
|
char *outbuffer;
|
||||||
int outbuffersize;
|
unsigned int outbuffersize;
|
||||||
int outbufferused;
|
unsigned int outbufferused;
|
||||||
} HTTP_active_connections_t;
|
} HTTP_active_connections_t;
|
||||||
static HTTP_active_connections_t *HTTP_ServerConnections;
|
static HTTP_active_connections_t *HTTP_ServerConnections;
|
||||||
static int httpconnectioncount;
|
static int httpconnectioncount;
|
||||||
|
|
||||||
static void ExpandInBuffer(HTTP_active_connections_t *cl, int quant, qboolean fixedsize)
|
static void ExpandInBuffer(HTTP_active_connections_t *cl, unsigned int quant, qboolean fixedsize)
|
||||||
{
|
{
|
||||||
int newsize;
|
unsigned int newsize;
|
||||||
if (fixedsize)
|
if (fixedsize)
|
||||||
newsize = quant;
|
newsize = quant;
|
||||||
else
|
else
|
||||||
|
@ -111,9 +111,9 @@ static void ExpandInBuffer(HTTP_active_connections_t *cl, int quant, qboolean fi
|
||||||
cl->inbuffer = IWebRealloc(cl->inbuffer, newsize);
|
cl->inbuffer = IWebRealloc(cl->inbuffer, newsize);
|
||||||
cl->inbuffersize = newsize;
|
cl->inbuffersize = newsize;
|
||||||
}
|
}
|
||||||
static void ExpandOutBuffer(HTTP_active_connections_t *cl, int quant, qboolean fixedsize)
|
static void ExpandOutBuffer(HTTP_active_connections_t *cl, unsigned int quant, qboolean fixedsize)
|
||||||
{
|
{
|
||||||
int newsize;
|
unsigned int newsize;
|
||||||
if (fixedsize)
|
if (fixedsize)
|
||||||
newsize = quant;
|
newsize = quant;
|
||||||
else
|
else
|
||||||
|
@ -133,7 +133,7 @@ void HTTP_RunExisting (void)
|
||||||
char resource[256];
|
char resource[256];
|
||||||
char mode[8];
|
char mode[8];
|
||||||
qboolean hostspecified;
|
qboolean hostspecified;
|
||||||
int contentlen;
|
unsigned int contentlen;
|
||||||
|
|
||||||
int HTTPmarkup; //version
|
int HTTPmarkup; //version
|
||||||
int localerrno;
|
int localerrno;
|
||||||
|
@ -171,7 +171,7 @@ void HTTP_RunExisting (void)
|
||||||
case HTTP_WAITINGFORREQUEST:
|
case HTTP_WAITINGFORREQUEST:
|
||||||
if (cl->outbufferused)
|
if (cl->outbufferused)
|
||||||
Sys_Error("Persistant connection was waiting for input with unsent output");
|
Sys_Error("Persistant connection was waiting for input with unsent output");
|
||||||
ammount = cl->inbuffersize - cl->inbufferused - 1;
|
ammount = cl->inbuffersize-1 - cl->inbufferused;
|
||||||
if (ammount < 128)
|
if (ammount < 128)
|
||||||
{
|
{
|
||||||
if (cl->inbuffersize>128*1024)
|
if (cl->inbuffersize>128*1024)
|
||||||
|
@ -181,7 +181,7 @@ void HTTP_RunExisting (void)
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpandInBuffer(cl, 1500, false);
|
ExpandInBuffer(cl, 1500, false);
|
||||||
ammount = cl->inbuffersize - cl->inbufferused - 1;
|
ammount = cl->inbuffersize-1 - cl->inbufferused;
|
||||||
}
|
}
|
||||||
if (cl->modeswitched)
|
if (cl->modeswitched)
|
||||||
{
|
{
|
||||||
|
@ -278,7 +278,7 @@ cont:
|
||||||
if (!strnicmp(msg, "Host: ", 6)) //parse needed header fields
|
if (!strnicmp(msg, "Host: ", 6)) //parse needed header fields
|
||||||
hostspecified = true;
|
hostspecified = true;
|
||||||
else if (!strnicmp(msg, "Content-Length: ", 16)) //parse needed header fields
|
else if (!strnicmp(msg, "Content-Length: ", 16)) //parse needed header fields
|
||||||
contentlen = atoi(msg+16);
|
contentlen = strtoul(msg+16, NULL, 0);
|
||||||
else if (!strnicmp(msg, "Transfer-Encoding: ", 18)) //parse needed header fields
|
else if (!strnicmp(msg, "Transfer-Encoding: ", 18)) //parse needed header fields
|
||||||
{
|
{
|
||||||
cl->closeaftertransaction = true;
|
cl->closeaftertransaction = true;
|
||||||
|
|
|
@ -108,12 +108,12 @@ void *PRAddressableExtend(progfuncs_t *progfuncs, int ammount)
|
||||||
prinst.addressablesize = newsize;
|
prinst.addressablesize = newsize;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
char *newblock;
|
|
||||||
int newsize = (prinst.addressableused + ammount + 1024*1024) & ~(1024*1024-1);
|
int newsize = (prinst.addressableused + ammount + 1024*1024) & ~(1024*1024-1);
|
||||||
newblock = realloc(newblock, prinst.addressablesize);
|
char *newblock = malloc(newsize);
|
||||||
if (newblock)
|
if (newblock)
|
||||||
{
|
{
|
||||||
PRAddressableRelocate(progfuncs, prinst.addressablehunk, newblock, prinst.addressableused);
|
PRAddressableRelocate(progfuncs, prinst.addressablehunk, newblock, prinst.addressableused);
|
||||||
|
free(prinst.addressablehunk);
|
||||||
prinst.addressablehunk = newblock;
|
prinst.addressablehunk = newblock;
|
||||||
prinst.addressablesize = newsize;
|
prinst.addressablesize = newsize;
|
||||||
}
|
}
|
||||||
|
@ -163,10 +163,10 @@ static void PF_fmem_unlink(progfuncs_t *pr, qcmemfreeblock_t *p)
|
||||||
np->prev = p->prev;
|
np->prev = p->prev;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
static void PR_memvalidate (progfuncs_t *progfuncs)
|
static void PR_memvalidate (progfuncs_t *progfuncs)
|
||||||
{
|
{
|
||||||
qcmemfreeblock_t *p;
|
qcmemfreeblock_t *p;
|
||||||
qcmemusedblock_t *ub = NULL;
|
|
||||||
unsigned int b,l;
|
unsigned int b,l;
|
||||||
|
|
||||||
b = prinst.mfreelist;
|
b = prinst.mfreelist;
|
||||||
|
@ -182,7 +182,7 @@ static void PR_memvalidate (progfuncs_t *progfuncs)
|
||||||
p = (qcmemfreeblock_t*)(progfuncs->funcs.stringtable + b);
|
p = (qcmemfreeblock_t*)(progfuncs->funcs.stringtable + b);
|
||||||
|
|
||||||
if (p->prev != l ||
|
if (p->prev != l ||
|
||||||
p->next && p->next < b + p->size ||
|
(p->next && p->next < b + p->size) ||
|
||||||
p->next >= prinst.addressableused ||
|
p->next >= prinst.addressableused ||
|
||||||
b + p->size >= prinst.addressableused ||
|
b + p->size >= prinst.addressableused ||
|
||||||
p->prev >= b)
|
p->prev >= b)
|
||||||
|
@ -195,6 +195,7 @@ static void PR_memvalidate (progfuncs_t *progfuncs)
|
||||||
b = p->next;
|
b = p->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
static void *PDECL PR_memalloc (pubprogfuncs_t *ppf, unsigned int size)
|
static void *PDECL PR_memalloc (pubprogfuncs_t *ppf, unsigned int size)
|
||||||
{
|
{
|
||||||
progfuncs_t *progfuncs = (progfuncs_t*)ppf;
|
progfuncs_t *progfuncs = (progfuncs_t*)ppf;
|
||||||
|
@ -216,7 +217,7 @@ static void *PDECL PR_memalloc (pubprogfuncs_t *ppf, unsigned int size)
|
||||||
p = (qcmemfreeblock_t*)(progfuncs->funcs.stringtable + b);
|
p = (qcmemfreeblock_t*)(progfuncs->funcs.stringtable + b);
|
||||||
if (p->size >= size)
|
if (p->size >= size)
|
||||||
{
|
{
|
||||||
if (p->next && p->next < b + p->size ||
|
if ((p->next && p->next < b + p->size) ||
|
||||||
p->next >= prinst.addressableused ||
|
p->next >= prinst.addressableused ||
|
||||||
b + p->size >= prinst.addressableused ||
|
b + p->size >= prinst.addressableused ||
|
||||||
p->prev >= b)
|
p->prev >= b)
|
||||||
|
@ -297,10 +298,10 @@ static void PDECL PR_memfree (pubprogfuncs_t *ppf, void *memptr)
|
||||||
{
|
{
|
||||||
//the empty string is a point of contention. while we can detect it from fteqcc, its best to not give any special favours (other than nicer debugging, where possible)
|
//the empty string is a point of contention. while we can detect it from fteqcc, its best to not give any special favours (other than nicer debugging, where possible)
|
||||||
//we might not actually spot it from other qccs, so warning about it where possible is probably a very good thing.
|
//we might not actually spot it from other qccs, so warning about it where possible is probably a very good thing.
|
||||||
printf("PF_memfree: unable to free the non-null empty string constant\n", ptr, prinst.addressableused);
|
printf("PF_memfree: unable to free the non-null empty string constant at %x\n", ptr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
printf("PF_memfree: pointer invalid - out of range (%u >= %u)\n", ptr, prinst.addressableused);
|
printf("PF_memfree: pointer invalid - out of range (%x >= %x)\n", ptr, prinst.addressableused);
|
||||||
PR_StackTrace(&progfuncs->funcs);
|
PR_StackTrace(&progfuncs->funcs);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -764,7 +765,7 @@ struct edict_s *PDECL ProgsToEdict (pubprogfuncs_t *ppf, int progs)
|
||||||
}
|
}
|
||||||
int PDECL EdictToProgs (pubprogfuncs_t *ppf, struct edict_s *ed)
|
int PDECL EdictToProgs (pubprogfuncs_t *ppf, struct edict_s *ed)
|
||||||
{
|
{
|
||||||
progfuncs_t *progfuncs = (progfuncs_t*)ppf;
|
// progfuncs_t *progfuncs = (progfuncs_t*)ppf;
|
||||||
return EDICT_TO_PROG(progfuncs, ed);
|
return EDICT_TO_PROG(progfuncs, ed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,6 +129,8 @@ void PDECL PR_GenerateStatementString (pubprogfuncs_t *ppf, int statementnum, ch
|
||||||
arg[1] = ((dstatement32_t*)current_progstate->statements + statementnum)->b;
|
arg[1] = ((dstatement32_t*)current_progstate->statements + statementnum)->b;
|
||||||
arg[2] = ((dstatement32_t*)current_progstate->statements + statementnum)->c;
|
arg[2] = ((dstatement32_t*)current_progstate->statements + statementnum)->c;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (current_progstate->linenums)
|
if (current_progstate->linenums)
|
||||||
|
|
|
@ -363,6 +363,11 @@ skipwhite:
|
||||||
data++;
|
data++;
|
||||||
}
|
}
|
||||||
else if (c=='\"'||c=='\0')
|
else if (c=='\"'||c=='\0')
|
||||||
|
{
|
||||||
|
if (len < sizeof(qcc_token)-1)
|
||||||
|
qcc_token[len++] = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (len >= sizeof(qcc_token)-1)
|
if (len >= sizeof(qcc_token)-1)
|
||||||
;
|
;
|
||||||
else
|
else
|
||||||
|
@ -888,6 +893,9 @@ static char *decodeUTF(int type, unsigned char *inputf, unsigned int inbytes, in
|
||||||
w = 4;
|
w = 4;
|
||||||
maxperchar = 4;
|
maxperchar = 4;
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
*outlen = inbytes;
|
||||||
|
return inputf;
|
||||||
}
|
}
|
||||||
chars = inbytes / w;
|
chars = inbytes / w;
|
||||||
utf8 = start = qccHunkAlloc(chars * maxperchar + 2);
|
utf8 = start = qccHunkAlloc(chars * maxperchar + 2);
|
||||||
|
@ -895,6 +903,7 @@ static char *decodeUTF(int type, unsigned char *inputf, unsigned int inbytes, in
|
||||||
{
|
{
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
|
default:
|
||||||
case UTF16LE:
|
case UTF16LE:
|
||||||
inc = *inputf++;
|
inc = *inputf++;
|
||||||
inc|= (*inputf++)<<8;
|
inc|= (*inputf++)<<8;
|
||||||
|
|
|
@ -3191,7 +3191,7 @@ PR_ParseFunctionCall
|
||||||
*/
|
*/
|
||||||
QCC_def_t *QCC_PR_ParseFunctionCall (QCC_def_t *func) //warning, the func could have no name set if it's a field call.
|
QCC_def_t *QCC_PR_ParseFunctionCall (QCC_def_t *func) //warning, the func could have no name set if it's a field call.
|
||||||
{
|
{
|
||||||
QCC_def_t *e, *d, *old = {0}, *oself, *out; // warning: ‘old’ may be used uninitialized in this function
|
QCC_def_t *e, *d, *oself, *out;
|
||||||
int arg;
|
int arg;
|
||||||
QCC_type_t *t, *p;
|
QCC_type_t *t, *p;
|
||||||
int extraparms=false;
|
int extraparms=false;
|
||||||
|
@ -3265,13 +3265,16 @@ QCC_def_t *QCC_PR_ParseFunctionCall (QCC_def_t *func) //warning, the func could
|
||||||
QCC_PR_Lex();
|
QCC_PR_Lex();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
QCC_PR_ParseErrorPrintDef (ERR_TYPEMISMATCHPARM, func, "_() intrinsic accepts only a string immediate", 1);
|
QCC_PR_ParseErrorPrintDef (ERR_TYPEMISMATCHPARM, func, "_() intrinsic accepts only a string immediate", 1);
|
||||||
|
d = NULL;
|
||||||
|
}
|
||||||
QCC_PR_Expect(")");
|
QCC_PR_Expect(")");
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
if (!strcmp(func->name, "random"))
|
if (!strcmp(func->name, "random"))
|
||||||
{
|
{
|
||||||
old = NULL;
|
QCC_def_t *old = NULL;
|
||||||
if (!func->initialized)
|
if (!func->initialized)
|
||||||
func->initialized = 3;
|
func->initialized = 3;
|
||||||
func->references++;
|
func->references++;
|
||||||
|
@ -3418,6 +3421,7 @@ QCC_def_t *QCC_PR_ParseFunctionCall (QCC_def_t *func) //warning, the func could
|
||||||
}
|
}
|
||||||
if (!strcmp(func->name, "randomv"))
|
if (!strcmp(func->name, "randomv"))
|
||||||
{
|
{
|
||||||
|
QCC_def_t *old;
|
||||||
out = NULL;
|
out = NULL;
|
||||||
if (!func->initialized)
|
if (!func->initialized)
|
||||||
func->initialized = 3;
|
func->initialized = 3;
|
||||||
|
@ -3446,6 +3450,7 @@ QCC_def_t *QCC_PR_ParseFunctionCall (QCC_def_t *func) //warning, the func could
|
||||||
|
|
||||||
if (QCC_OPCodeValid(&pr_opcodes[OP_RANDV0]))
|
if (QCC_OPCodeValid(&pr_opcodes[OP_RANDV0]))
|
||||||
{
|
{
|
||||||
|
old = NULL;
|
||||||
if(def_ret.temp->used)
|
if(def_ret.temp->used)
|
||||||
out = QCC_GetTemp(type_vector);
|
out = QCC_GetTemp(type_vector);
|
||||||
else
|
else
|
||||||
|
@ -3610,6 +3615,7 @@ QCC_def_t *QCC_PR_ParseFunctionCall (QCC_def_t *func) //warning, the func could
|
||||||
}
|
}
|
||||||
else if (!strcmp(func->name, "spawn"))
|
else if (!strcmp(func->name, "spawn"))
|
||||||
{
|
{
|
||||||
|
QCC_def_t *old;
|
||||||
QCC_type_t *rettype;
|
QCC_type_t *rettype;
|
||||||
if (QCC_PR_CheckToken(")"))
|
if (QCC_PR_CheckToken(")"))
|
||||||
{
|
{
|
||||||
|
@ -4389,6 +4395,8 @@ QCC_def_t *QCC_PR_ParseArrayPointer (QCC_def_t *d, pbool allowarrayassign)
|
||||||
i = G_INT(tmp->ofs);
|
i = G_INT(tmp->ofs);
|
||||||
else if (tmp->type->type == ev_float)
|
else if (tmp->type->type == ev_float)
|
||||||
i = G_FLOAT(tmp->ofs);
|
i = G_FLOAT(tmp->ofs);
|
||||||
|
else
|
||||||
|
i = -1;
|
||||||
if (i < 0 || i >= 3)
|
if (i < 0 || i >= 3)
|
||||||
QCC_PR_ParseErrorPrintDef(0, d, "(vector) array index out of bounds");
|
QCC_PR_ParseErrorPrintDef(0, d, "(vector) array index out of bounds");
|
||||||
}
|
}
|
||||||
|
@ -4410,6 +4418,8 @@ QCC_def_t *QCC_PR_ParseArrayPointer (QCC_def_t *d, pbool allowarrayassign)
|
||||||
i = G_INT(tmp->ofs);
|
i = G_INT(tmp->ofs);
|
||||||
else if (tmp->type->type == ev_float)
|
else if (tmp->type->type == ev_float)
|
||||||
i = G_FLOAT(tmp->ofs);
|
i = G_FLOAT(tmp->ofs);
|
||||||
|
else
|
||||||
|
i = -1;
|
||||||
if (i < 0 || i >= ((!idx)?d->arraysize:t->arraysize))
|
if (i < 0 || i >= ((!idx)?d->arraysize:t->arraysize))
|
||||||
QCC_PR_ParseErrorPrintDef(0, d, "(constant) array index out of bounds");
|
QCC_PR_ParseErrorPrintDef(0, d, "(constant) array index out of bounds");
|
||||||
}
|
}
|
||||||
|
@ -5128,7 +5138,10 @@ QCC_def_t *QCC_PR_Term (int exprflags)
|
||||||
e2->type = e->type->aux_type;
|
e2->type = e->type->aux_type;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
e2 = NULL;
|
||||||
QCC_PR_ParseError (ERR_BADNOTTYPE, "type mismatch for *");
|
QCC_PR_ParseError (ERR_BADNOTTYPE, "type mismatch for *");
|
||||||
|
}
|
||||||
return e2;
|
return e2;
|
||||||
}
|
}
|
||||||
else if (QCC_PR_CheckToken ("-"))
|
else if (QCC_PR_CheckToken ("-"))
|
||||||
|
@ -7054,7 +7067,7 @@ static pbool QCC_FuncJumpsTo(int first, int last, int statement)
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
static pbool QCC_FuncJumpsToRange(int first, int last, int firstr, int lastr)
|
static pbool QCC_FuncJumpsToRange(int first, int last, int firstr, int lastr)
|
||||||
{
|
{
|
||||||
int st;
|
int st;
|
||||||
|
@ -7105,7 +7118,7 @@ static pbool QCC_FuncJumpsToRange(int first, int last, int firstr, int lastr)
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
#if 0
|
#if 0
|
||||||
void QCC_CompoundJumps(int first, int last)
|
void QCC_CompoundJumps(int first, int last)
|
||||||
{
|
{
|
||||||
|
|
|
@ -244,7 +244,7 @@ int ParsePrecompilerIf(int level)
|
||||||
{
|
{
|
||||||
CompilerConstant_t *c;
|
CompilerConstant_t *c;
|
||||||
int eval = 0;
|
int eval = 0;
|
||||||
pbool notted = false;
|
// pbool notted = false;
|
||||||
|
|
||||||
//single term end-of-chain
|
//single term end-of-chain
|
||||||
if (level == PPI_VALUE)
|
if (level == PPI_VALUE)
|
||||||
|
@ -384,7 +384,7 @@ static void QCC_PR_SkipToEndOfLine(void)
|
||||||
}
|
}
|
||||||
if (*pr_file_p == '\n')
|
if (*pr_file_p == '\n')
|
||||||
pr_source_line++;
|
pr_source_line++;
|
||||||
*pr_file_p++;
|
pr_file_p++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (*pr_file_p == '/' && pr_file_p[1] == '/' && handlecomments)
|
else if (*pr_file_p == '/' && pr_file_p[1] == '/' && handlecomments)
|
||||||
|
|
|
@ -1363,6 +1363,7 @@ strofs = (strofs+3)&~3;
|
||||||
break;
|
break;
|
||||||
case QCF_DARKPLACES:
|
case QCF_DARKPLACES:
|
||||||
case QCF_FTE:
|
case QCF_FTE:
|
||||||
|
case QCF_FTEH2:
|
||||||
case QCF_FTEDEBUG:
|
case QCF_FTEDEBUG:
|
||||||
progs.version = PROG_EXTENDEDVERSION;
|
progs.version = PROG_EXTENDEDVERSION;
|
||||||
|
|
||||||
|
|
|
@ -7351,7 +7351,7 @@ static void QCBUILTIN PF_h2starteffect(pubprogfuncs_t *prinst, struct globalvars
|
||||||
|
|
||||||
static void QCBUILTIN PF_h2endeffect(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
|
static void QCBUILTIN PF_h2endeffect(pubprogfuncs_t *prinst, struct globalvars_s *pr_globals)
|
||||||
{
|
{
|
||||||
int ign = G_FLOAT(OFS_PARM0);
|
// int ign = G_FLOAT(OFS_PARM0);
|
||||||
int index = G_FLOAT(OFS_PARM1);
|
int index = G_FLOAT(OFS_PARM1);
|
||||||
|
|
||||||
Con_DPrintf("Stop effect %i\n", index);
|
Con_DPrintf("Stop effect %i\n", index);
|
||||||
|
@ -10556,7 +10556,7 @@ void PR_DumpPlatform_f(void)
|
||||||
{"SLIST_TEST_NOTEQUAL", "const float", MENU, SLIST_TEST_NOTEQUAL},
|
{"SLIST_TEST_NOTEQUAL", "const float", MENU, SLIST_TEST_NOTEQUAL},
|
||||||
{"SLIST_TEST_STARTSWITH", "const float", MENU, SLIST_TEST_STARTSWITH},
|
{"SLIST_TEST_STARTSWITH", "const float", MENU, SLIST_TEST_STARTSWITH},
|
||||||
{"SLIST_TEST_NOTSTARTSWITH", "const float", MENU, SLIST_TEST_NOTSTARTSWITH},
|
{"SLIST_TEST_NOTSTARTSWITH", "const float", MENU, SLIST_TEST_NOTSTARTSWITH},
|
||||||
NULL
|
{NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
targ = 0;
|
targ = 0;
|
||||||
|
|
|
@ -529,10 +529,10 @@ typedef struct client_s
|
||||||
qboolean csqcactive;
|
qboolean csqcactive;
|
||||||
#ifdef PROTOCOL_VERSION_FTE
|
#ifdef PROTOCOL_VERSION_FTE
|
||||||
qboolean pextknown;
|
qboolean pextknown;
|
||||||
unsigned long fteprotocolextensions;
|
unsigned int fteprotocolextensions;
|
||||||
unsigned long fteprotocolextensions2;
|
unsigned int fteprotocolextensions2;
|
||||||
#endif
|
#endif
|
||||||
unsigned long zquake_extensions;
|
unsigned int zquake_extensions;
|
||||||
unsigned int max_net_ents; /*highest entity number the client can receive (limited by either protocol or client's buffer size)*/
|
unsigned int max_net_ents; /*highest entity number the client can receive (limited by either protocol or client's buffer size)*/
|
||||||
unsigned int maxmodels; /*max models supported by whatever the protocol is*/
|
unsigned int maxmodels; /*max models supported by whatever the protocol is*/
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,9 @@ int numnails;
|
||||||
int nailcount = 0;
|
int nailcount = 0;
|
||||||
extern int sv_nailmodel, sv_supernailmodel, sv_playermodel;
|
extern int sv_nailmodel, sv_supernailmodel, sv_playermodel;
|
||||||
|
|
||||||
|
#ifdef SERVER_DEMO_PLAYBACK
|
||||||
qboolean demonails;
|
qboolean demonails;
|
||||||
|
#endif
|
||||||
|
|
||||||
static edict_t *csqcent[MAX_EDICTS];
|
static edict_t *csqcent[MAX_EDICTS];
|
||||||
static int csqcnuments;
|
static int csqcnuments;
|
||||||
|
@ -122,7 +124,9 @@ qboolean SV_AddNailUpdate (edict_t *ent)
|
||||||
if (sv_nailhack.value)
|
if (sv_nailhack.value)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
#ifdef SERVER_DEMO_PLAYBACK
|
||||||
demonails = false;
|
demonails = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (numnails == MAX_NAILS)
|
if (numnails == MAX_NAILS)
|
||||||
return true;
|
return true;
|
||||||
|
@ -131,7 +135,7 @@ qboolean SV_AddNailUpdate (edict_t *ent)
|
||||||
numnails++;
|
numnails++;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#ifdef SERVER_DEMO_PLAYBACK
|
||||||
qboolean SV_DemoNailUpdate (int i)
|
qboolean SV_DemoNailUpdate (int i)
|
||||||
{
|
{
|
||||||
demonails = true;
|
demonails = true;
|
||||||
|
@ -142,6 +146,7 @@ qboolean SV_DemoNailUpdate (int i)
|
||||||
numnails++;
|
numnails++;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void SV_EmitNailUpdate (sizebuf_t *msg, qboolean recorder)
|
void SV_EmitNailUpdate (sizebuf_t *msg, qboolean recorder)
|
||||||
{
|
{
|
||||||
|
@ -2891,7 +2896,7 @@ void SV_Snapshot_BuildStateQ1(entity_state_t *state, edict_t *ent, client_t *cli
|
||||||
state->lightpflags = ent->xv->pflags;
|
state->lightpflags = ent->xv->pflags;
|
||||||
state->u.q1.traileffectnum = ent->xv->traileffectnum;
|
state->u.q1.traileffectnum = ent->xv->traileffectnum;
|
||||||
|
|
||||||
if (!ent->xv->gravitydir[0] && !ent->xv->gravitydir[1] && !ent->xv->gravitydir[2] || (ent->xv->gravitydir[2] == -1))
|
if ((!ent->xv->gravitydir[0] && !ent->xv->gravitydir[1] && !ent->xv->gravitydir[2]) || (ent->xv->gravitydir[2] == -1))
|
||||||
{
|
{
|
||||||
state->u.q1.gravitydir[0] = 0;
|
state->u.q1.gravitydir[0] = 0;
|
||||||
state->u.q1.gravitydir[1] = 0;
|
state->u.q1.gravitydir[1] = 0;
|
||||||
|
|
|
@ -2595,8 +2595,8 @@ client_t *SVC_DirectConnect(void)
|
||||||
|
|
||||||
if (ISNQCLIENT(newcl))
|
if (ISNQCLIENT(newcl))
|
||||||
{
|
{
|
||||||
//FIXME: we should delay this until we actually have a name.
|
//FIXME: we should delay this until we actually have a name, because right now they'll be called unnamed or unconnected or something
|
||||||
SV_BroadcastPrintf(PRINT_LOW, "New client connected\n", newcl->name);
|
SV_BroadcastPrintf(PRINT_LOW, "New client connected\n");
|
||||||
}
|
}
|
||||||
else if (redirect)
|
else if (redirect)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,12 +30,6 @@ void SV_MVDStop_f (void);
|
||||||
|
|
||||||
#define demo_size_padding 0x1000
|
#define demo_size_padding 0x1000
|
||||||
|
|
||||||
|
|
||||||
//#define MIN_MVD_MEMORY 0x100000
|
|
||||||
//#define MAXSIZE (demobuffer->end < demobuffer->last ? \
|
|
||||||
// demobuffer->start - demobuffer->end : \
|
|
||||||
// demobuffer->maxsize - demobuffer->end)
|
|
||||||
|
|
||||||
static void SV_DemoDir_Callback(struct cvar_s *var, char *oldvalue);
|
static void SV_DemoDir_Callback(struct cvar_s *var, char *oldvalue);
|
||||||
|
|
||||||
cvar_t sv_demoUseCache = CVARD("sv_demoUseCache", "0", "If set, demo data will be flushed only periodically");
|
cvar_t sv_demoUseCache = CVARD("sv_demoUseCache", "0", "If set, demo data will be flushed only periodically");
|
||||||
|
@ -2245,7 +2239,7 @@ void SV_MVDEasyRecord_f (void)
|
||||||
{
|
{
|
||||||
char *c;
|
char *c;
|
||||||
Q_strncpyz (name, Cmd_Argv(1), sizeof(name));
|
Q_strncpyz (name, Cmd_Argv(1), sizeof(name));
|
||||||
while(c = strchr(name, ':'))
|
while((c = strchr(name, ':')))
|
||||||
*c = '-';
|
*c = '-';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -425,7 +425,6 @@ void SVNQ_New_f (void)
|
||||||
int i;
|
int i;
|
||||||
int maxplayers = 0;
|
int maxplayers = 0;
|
||||||
int op;
|
int op;
|
||||||
extern cvar_t pr_maxedicts;
|
|
||||||
unsigned int protext1 = 0, protext2 = 0, protmain = 0, protfl = 0;
|
unsigned int protext1 = 0, protext2 = 0, protmain = 0, protfl = 0;
|
||||||
|
|
||||||
host_client->send_message = true;
|
host_client->send_message = true;
|
||||||
|
@ -3494,7 +3493,7 @@ void SV_Rate_f (void)
|
||||||
{
|
{
|
||||||
int rate = SV_RateForClient(host_client);
|
int rate = SV_RateForClient(host_client);
|
||||||
if (!rate)
|
if (!rate)
|
||||||
SV_ClientPrintf (host_client, PRINT_HIGH, "Effective rate is unlimited\n", rate);
|
SV_ClientPrintf (host_client, PRINT_HIGH, "Effective rate is unlimited\n");
|
||||||
else
|
else
|
||||||
SV_ClientPrintf (host_client, PRINT_HIGH, "Effective rate %i\n", rate);
|
SV_ClientPrintf (host_client, PRINT_HIGH, "Effective rate %i\n", rate);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -550,6 +550,7 @@ static q2trace_t VARGS SVQ2_Trace (vec3_t start, vec3_t mins, vec3_t maxs, vec3_
|
||||||
ret.surface = tr.surface;
|
ret.surface = tr.surface;
|
||||||
ret.fraction = tr.fraction;
|
ret.fraction = tr.fraction;
|
||||||
VectorCopy(tr.endpos, ret.endpos);
|
VectorCopy(tr.endpos, ret.endpos);
|
||||||
|
memset(&ret.plane, 0, sizeof(ret.plane));
|
||||||
VectorCopy(tr.plane.normal, ret.plane.normal);
|
VectorCopy(tr.plane.normal, ret.plane.normal);
|
||||||
ret.plane.dist = tr.plane.dist;
|
ret.plane.dist = tr.plane.dist;
|
||||||
ret.ent = tr.ent;
|
ret.ent = tr.ent;
|
||||||
|
|
Loading…
Reference in a new issue