Fix web+android targets. Fix some relatively recent quake2 bugs.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5695 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
c949500da8
commit
80474cc3be
10 changed files with 162 additions and 124 deletions
|
@ -3468,6 +3468,17 @@ static void PM_PromptApplyChanges(void)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_CLIENT
|
||||
static void PM_AddSubList_Callback(void *ctx, promptbutton_t opt)
|
||||
{
|
||||
if (opt == PROMPT_YES)
|
||||
{
|
||||
PM_AddSubList(ctx, "", true, true);
|
||||
PM_WriteInstalledPackages();
|
||||
}
|
||||
Z_Free(ctx);
|
||||
}
|
||||
#endif
|
||||
|
||||
//names packages that were listed from the manifest.
|
||||
//if 'mark' is true, then this is an initial install.
|
||||
|
@ -3547,8 +3558,12 @@ void PM_Command_f(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_CLIENT
|
||||
Menu_Prompt(PM_AddSubList_Callback, Z_StrDup(Cmd_Argv(2)), va("Add updates source?\n%s", Cmd_Argv(2)), "Confirm", NULL, "Cancel");
|
||||
#else
|
||||
PM_AddSubList(Cmd_Argv(2), "", true, true);
|
||||
PM_WriteInstalledPackages();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#ifdef VKQUAKE
|
||||
//we need some types available elsewhere, but don't really want to have to include the entire vulkan api everywhere.
|
||||
//unfortunately, vulkan's handle types are not well defined.
|
||||
#if defined(__LP64__) || defined(_WIN64)
|
||||
#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
|
||||
#define VulkanAPIRandomness void*
|
||||
#elif defined(_MSC_VER) && _MSC_VER < 1300
|
||||
#define VulkanAPIRandomness __int64
|
||||
|
|
|
@ -57,19 +57,10 @@ typedef struct vrsetup_s
|
|||
} d3d;
|
||||
|
||||
struct
|
||||
{ //sometimes pointers, sometimes ints. nasty datatypes that suck. this is hideous.
|
||||
#ifndef VulkanAPIRandomness
|
||||
#if defined(__LP64__) || defined(_WIN64)
|
||||
#define VulkanAPIRandomness void*
|
||||
#elif defined(_MSC_VER) && _MSC_VER < 1300
|
||||
#define VulkanAPIRandomness __int64
|
||||
#else
|
||||
#define VulkanAPIRandomness long long
|
||||
#endif
|
||||
#endif
|
||||
VulkanAPIRandomness instance;
|
||||
VulkanAPIRandomness physicaldevice;
|
||||
VulkanAPIRandomness device;
|
||||
{ //these are ALWAYS pointers in vulkan (annoyingly unlike many of its typedefs).
|
||||
void *instance;
|
||||
void *physicaldevice;
|
||||
void *device;
|
||||
unsigned int queuefamily;
|
||||
unsigned int queueindex;
|
||||
} vk;
|
||||
|
|
|
@ -702,6 +702,25 @@ static qboolean FS_Manifest_ParseTokens(ftemanifest_t *man)
|
|||
{
|
||||
int i;
|
||||
char *newdir = Cmd_Argv(1);
|
||||
qboolean basegame = !Q_strcasecmp(cmd, "basegame");
|
||||
|
||||
for (i = 0; i < sizeof(man->gamepath) / sizeof(man->gamepath[0]); i++)
|
||||
{
|
||||
if (man->gamepath[i].path)
|
||||
{
|
||||
if (!Q_strcasecmp(man->gamepath[i].path, newdir))
|
||||
{
|
||||
if (basegame && !(man->gamepath[i].flags & GAMEDIR_BASEGAME))
|
||||
{
|
||||
Z_Free(man->gamepath[i].path);
|
||||
man->gamepath[i].path = NULL; //if we're adding a basegame when there's a mod game with the same name then drop the redundant mod name
|
||||
man->gamepath[i].flags = 0;
|
||||
}
|
||||
else
|
||||
return true; //already in there, don't add a conflicting one.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < sizeof(man->gamepath) / sizeof(man->gamepath[0]); i++)
|
||||
{
|
||||
|
|
|
@ -435,7 +435,7 @@ void R_RotateForEntity (float *m, float *modelview, const entity_t *e, const mod
|
|||
R_SetupGL
|
||||
=============
|
||||
*/
|
||||
static void R_SetupGL (vec3_t axisorigin[4], vec4_t fovoverrides, texid_t fbo)
|
||||
static void R_SetupGL (vec3_t axisorigin[4], vec4_t fovoverrides, float projmatrix[16]/*for webvr*/, texid_t fbo)
|
||||
{
|
||||
int x, x2, y2, y, w, h;
|
||||
vec3_t newa;
|
||||
|
@ -559,6 +559,14 @@ static void R_SetupGL (vec3_t axisorigin[4], vec4_t fovoverrides, texid_t fbo)
|
|||
r_refdef.pxrect.maxheight = vid.fbpheight;
|
||||
}
|
||||
|
||||
if (projmatrix)
|
||||
{
|
||||
memcpy(r_refdef.m_projection_std, projmatrix, sizeof(r_refdef.m_projection_std));
|
||||
memcpy(r_refdef.m_projection_view, projmatrix, sizeof(r_refdef.m_projection_view));
|
||||
r_refdef.flipcull = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fovoverrides)
|
||||
{
|
||||
fov_l = fovoverrides[0];
|
||||
|
@ -601,25 +609,6 @@ static void R_SetupGL (vec3_t axisorigin[4], vec4_t fovoverrides, texid_t fbo)
|
|||
fov_u = fov_y / 2;
|
||||
}
|
||||
|
||||
GL_ViewportUpdate();
|
||||
|
||||
#ifdef FTE_TARGET_WEB
|
||||
if (r_refdef.stereomethod == STEREO_WEBVR)
|
||||
{
|
||||
float vm[16], em[16];
|
||||
emscriptenfte_getvreyedata(i, r_refdef.m_projection_std, em);
|
||||
memcpy(r_refdef.m_projection_view, r_refdef.m_projection_std, sizeof(r_refdef.m_projection_view));
|
||||
Matrix4x4_Identity(em);
|
||||
|
||||
Matrix4x4_CM_ModelViewMatrixFromAxis(vm, vpn, vright, vup, r_origin);
|
||||
Matrix4_Multiply(vm, em, r_refdef.m_view);
|
||||
//fixme: read the axis+org back out...
|
||||
|
||||
// Matrix4x4_CM_ModelViewMatrixFromAxis(r_refdef.m_view, vpn, vright, vup, r_origin);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if (r_refdef.useperspective)
|
||||
{
|
||||
int stencilshadows = Sh_StencilShadowsActive();
|
||||
|
@ -652,14 +641,16 @@ static void R_SetupGL (vec3_t axisorigin[4], vec4_t fovoverrides, texid_t fbo)
|
|||
}
|
||||
|
||||
Matrix4x4_CM_ModelViewMatrixFromAxis(r_refdef.m_view, vpn, vright, vup, r_origin);
|
||||
}
|
||||
|
||||
//bias the viewmodel depth range to a third: -1 through -0.333 (instead of -1 to 1)
|
||||
r_refdef.m_projection_view[2+4*0] *= 0.333;
|
||||
r_refdef.m_projection_view[2+4*1] *= 0.333;
|
||||
r_refdef.m_projection_view[2+4*2] *= 0.333;
|
||||
r_refdef.m_projection_view[2+4*3] *= 0.333;
|
||||
r_refdef.m_projection_view[14] -= 0.666;
|
||||
//FIXME: bias, so that we use -1 to -.333 range instead of -.333 to 0.333
|
||||
}
|
||||
|
||||
GL_ViewportUpdate();
|
||||
}
|
||||
|
||||
if (qglLoadMatrixf)
|
||||
|
@ -754,7 +745,7 @@ static void R_RenderEyeScene (texid_t rendertarget, vec4_t fovoverride, vec3_t a
|
|||
vid.fbpheight = rendertarget->height;
|
||||
}
|
||||
|
||||
R_SetupGL (axisorigin, fovoverride, rendertarget);
|
||||
R_SetupGL (axisorigin, fovoverride, NULL, rendertarget);
|
||||
R_RenderScene_Internal();
|
||||
|
||||
if (rendertarget)
|
||||
|
@ -811,9 +802,25 @@ static void R_RenderScene (void)
|
|||
qglClear (GL_DEPTH_BUFFER_BIT);
|
||||
r_framecount++;
|
||||
|
||||
R_SetupGL (NULL, NULL, NULL);
|
||||
R_SetupGL (NULL, NULL, NULL, NULL);
|
||||
R_RenderScene_Internal();
|
||||
}
|
||||
#ifdef FTE_TARGET_WEB
|
||||
else if (r_refdef.stereomethod == STEREO_WEBVR)
|
||||
{
|
||||
float projmatrix[16], eyematrix[16];
|
||||
GL_ForceDepthWritable();
|
||||
qglClear (GL_DEPTH_BUFFER_BIT);
|
||||
r_framecount++;
|
||||
|
||||
for (i = 0; i < stereoframes; i++)
|
||||
{
|
||||
emscriptenfte_getvreyedata(i, projmatrix, eyematrix);
|
||||
R_SetupGL (eyematrix, NULL, projmatrix, NULL);
|
||||
R_RenderScene_Internal();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else for (i = 0; i < stereoframes; i++)
|
||||
{
|
||||
switch (stereomode)
|
||||
|
@ -880,7 +887,7 @@ static void R_RenderScene (void)
|
|||
axisorg[3][0] = 0;
|
||||
axisorg[3][1] = stereooffset[i];
|
||||
axisorg[3][2] = 0;
|
||||
R_SetupGL (axisorg, NULL, NULL);
|
||||
R_SetupGL (axisorg, NULL, NULL, NULL);
|
||||
R_RenderScene_Internal ();
|
||||
}
|
||||
|
||||
|
|
|
@ -311,7 +311,7 @@ void VID_Register(void)
|
|||
gles1rendererinfo.description = "OpenGL ES 1";
|
||||
memset(&gles1rendererinfo.name, 0, sizeof(gles1rendererinfo.name)); //make sure there's no 'gl' etc names.
|
||||
gles1rendererinfo.name[0] = "gles1";
|
||||
R_RegisterRenderer(&gles1rendererinfo);
|
||||
R_RegisterRenderer(NULL, &gles1rendererinfo);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -4652,11 +4652,13 @@ YOU SHOULD NOT EDIT THIS FILE BY HAND
|
|||
"vec4 skybox = textureCube(s_reflectcube, pos);\n"
|
||||
|
||||
//Fun question: should sky be fogged as if infinite, or as if an actual surface?
|
||||
"#ifdef FOG\n"
|
||||
"#if 1\n"
|
||||
"skybox.rgb = mix(skybox.rgb, w_fogcolour_ float(r_skyfog)*w_fogalpha); //flat fog ignoring actual geometry\n"
|
||||
"#else\n"
|
||||
"skybox.rgb = mix(skybox.rgb, fog3(skybox.rgb), float(r_skyfog)); //fog in terms of actual geometry distance\n"
|
||||
"#endif\n"
|
||||
"#endif\n"
|
||||
"gl_FragColor = skybox;\n"
|
||||
"}\n"
|
||||
"#endif\n"
|
||||
|
|
|
@ -2065,6 +2065,8 @@ void SV_Begin_Core(client_t *split)
|
|||
#endif
|
||||
|
||||
if (split->spawned)
|
||||
{
|
||||
if (svprogfuncs)
|
||||
{
|
||||
//NEH_RESTOREGAME
|
||||
//officially RestoreGame tells the mod when the game has been loaded.
|
||||
|
@ -2081,6 +2083,7 @@ void SV_Begin_Core(client_t *split)
|
|||
|
||||
SV_SendFixAngle(split, NULL, FIXANGLE_FIXED, false);
|
||||
split->edict->v->fixangle = FIXANGLE_NO; //no point doing it again
|
||||
}
|
||||
return;
|
||||
}
|
||||
split->spawned = true;
|
||||
|
@ -2248,7 +2251,8 @@ void SV_Begin_Core(client_t *split)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
SV_SendFixAngle(split, NULL, FIXANGLE_FIXED, false);
|
||||
split->edict->v->fixangle = FIXANGLE_NO; //no point doing it again
|
||||
|
||||
#ifdef HAVE_LEGACY
|
||||
split->dp_ping = NULL;
|
||||
|
@ -2259,9 +2263,7 @@ void SV_Begin_Core(client_t *split)
|
|||
split->dp_pl = (float*)sv.world.progs->GetEdictFieldValue(sv.world.progs, split->edict, "ping_packetloss", ev_float, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
SV_SendFixAngle(split, NULL, FIXANGLE_FIXED, false);
|
||||
split->edict->v->fixangle = FIXANGLE_NO; //no point doing it again
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -343,7 +343,7 @@ static int SVQ2_FindIndex (const char *name, int start, int max, int overflowtyp
|
|||
case 1:
|
||||
overflowstrings = sv.strings.q2_extramodels;
|
||||
max = countof(sv.strings.q2_extramodels);
|
||||
i++; //do not allow 255 to be allocated, ever. just live with the gap.
|
||||
i++; //do not allow 255 to be allocated, ever. just live with the gap (255 means special things).
|
||||
start = 0x8000;
|
||||
break;
|
||||
case 2:
|
||||
|
|
|
@ -37,11 +37,13 @@ void main ()
|
|||
vec4 skybox = textureCube(s_reflectcube, pos);
|
||||
|
||||
//Fun question: should sky be fogged as if infinite, or as if an actual surface?
|
||||
#ifdef FOG
|
||||
#if 1
|
||||
skybox.rgb = mix(skybox.rgb, w_fogcolour_ float(r_skyfog)*w_fogalpha); //flat fog ignoring actual geometry
|
||||
#else
|
||||
skybox.rgb = mix(skybox.rgb, fog3(skybox.rgb), float(r_skyfog)); //fog in terms of actual geometry distance
|
||||
#endif
|
||||
#endif
|
||||
gl_FragColor = skybox;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue