This commit is contained in:
Steam Deck User 2023-03-13 17:40:22 -04:00
commit fa9657111b
9 changed files with 190 additions and 96 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@ assets/vita/eboot.bin
*.nacl *.nacl
*.sfo *.sfo
*.bin *.bin
*.o

View File

@ -1184,12 +1184,10 @@ void CL_ParseWeaponFire (void)
kick[1] = MSG_ReadCoord (cl.protocolflags)/5; kick[1] = MSG_ReadCoord (cl.protocolflags)/5;
kick[2] = MSG_ReadCoord (cl.protocolflags)/5; kick[2] = MSG_ReadCoord (cl.protocolflags)/5;
if (!(cl.perks & 64)) {
cl.gun_kick[0] += kick[0]; cl.gun_kick[0] += kick[0];
cl.gun_kick[1] += kick[1]; cl.gun_kick[1] += kick[1];
cl.gun_kick[2] += kick[2]; cl.gun_kick[2] += kick[2];
} }
}
/* /*
=================== ===================
CL_ParseLimbUpdate CL_ParseLimbUpdate

View File

@ -1166,9 +1166,9 @@ R_RenderScene
void R_RenderScene (void) void R_RenderScene (void)
{ {
R_SetupScene (); //johnfitz -- this does everything that should be done once per call to RenderScene R_SetupScene (); //johnfitz -- this does everything that should be done once per call to RenderScene
#ifndef VITA
Fog_EnableGFog (); //johnfitz Fog_EnableGFog (); //johnfitz
#endif
Sky_DrawSky (); //johnfitz Sky_DrawSky (); //johnfitz
R_DrawWorld (); R_DrawWorld ();
@ -1188,9 +1188,9 @@ void R_RenderScene (void)
R_DrawParticles (); R_DrawParticles ();
QMB_DrawParticles(); QMB_DrawParticles();
#ifndef VITA
Fog_DisableGFog (); //johnfitz Fog_DisableGFog (); //johnfitz
#endif
R_DrawViewModel (); //johnfitz -- moved here from R_RenderView R_DrawViewModel (); //johnfitz -- moved here from R_RenderView
R_DrawView2Model (); R_DrawView2Model ();

View File

@ -1026,5 +1026,7 @@ void Sky_DrawSky (void)
glDepthMask(1); glDepthMask(1);
glDepthFunc(GL_LEQUAL); glDepthFunc(GL_LEQUAL);
} }
#ifndef VITA
Fog_EnableGFog (); Fog_EnableGFog ();
#endif
} }

View File

@ -107,6 +107,14 @@ typedef struct
usermap_t custom_maps[50]; usermap_t custom_maps[50];
#define BASE_MAP_COUNT 3
char* base_maps [] =
{
"ndu",
"warehouse",
"christmas_special"
};
enum m_state_e m_state; enum m_state_e m_state;
int old_m_state; int old_m_state;
@ -1691,6 +1699,7 @@ void Map_Finder(void)
DIR* dir; DIR* dir;
struct dirent* ent; struct dirent* ent;
char map_dir[MAX_OSPATH]; char map_dir[MAX_OSPATH];
qboolean breakaway;
for (int i = 0; i < 50; i++) { for (int i = 0; i < 50; i++) {
custom_maps[i].occupied = false; custom_maps[i].occupied = false;
@ -1706,9 +1715,32 @@ void Map_Finder(void)
{ {
while ((ent = readdir(dir))) while ((ent = readdir(dir)))
{ {
if(!strcmp(COM_FileGetExtension(ent->d_name),"bsp") || !strcmp(COM_FileGetExtension(ent->d_name),"BSP")) { if(!strcmp(COM_FileGetExtension(ent->d_name),"bsp") || !strcmp(COM_FileGetExtension(ent->d_name),"BSP"))
{
breakaway = false;
char ntype[32]; char ntype[32];
COM_StripExtension(ent->d_name, ntype, sizeof(ntype)); COM_StripExtension(ent->d_name, ntype, sizeof(ntype));
for (int j = 0; j < BASE_MAP_COUNT; j++)
{
if (breakaway == true)
break;
if(!strcmp(ntype, base_maps[j]))
{
//Con_Printf("ntype: %s\n base_map: %s\n", ntype, base_maps[j]);
breakaway = true;
}
}
if (breakaway == true)
{
//Con_Printf("Breaking away at ntype: %s\n", ntype);
continue;
}
else
{
//Con_Printf("Success at ntype: %s\n", ntype);
custom_maps[user_maps_num].occupied = true; custom_maps[user_maps_num].occupied = true;
custom_maps[user_maps_num].map_name = malloc(sizeof(char)*32); custom_maps[user_maps_num].map_name = malloc(sizeof(char)*32);
sprintf(custom_maps[user_maps_num].map_name, "%s", ntype); sprintf(custom_maps[user_maps_num].map_name, "%s", ntype);
@ -1776,6 +1808,7 @@ void Map_Finder(void)
user_maps_num = user_maps_num + 1; user_maps_num = user_maps_num + 1;
} }
} }
}
closedir(dir); closedir(dir);
} }
custom_map_pages = (int)ceil((double)(user_maps_num + 1)/15); custom_map_pages = (int)ceil((double)(user_maps_num + 1)/15);

View File

@ -312,17 +312,15 @@ static void PF_setmodel (void)
/* /*
================= =================
PF_bprint PF_bprint
broadcast print to everyone on server broadcast print to everyone on server
bprint(style, value)
bprint(value)
================= =================
*/ */
static void PF_bprint (void) void PF_bprint (void)
{ {
char *s; //
float style = G_FLOAT(OFS_PARM0);
s = PF_VarString(0); char *s = PF_VarString(1);
SV_BroadcastPrintf ("%s", s); SV_BroadcastPrintf ("%s", s);
} }

View File

@ -1191,9 +1191,13 @@ void R_DrawAliasModel (entity_t *e)
glBlendFunc (GL_ONE, GL_ONE); glBlendFunc (GL_ONE, GL_ONE);
glDepthMask(GL_FALSE); glDepthMask(GL_FALSE);
glColor3f(entalpha,entalpha,entalpha); glColor3f(entalpha,entalpha,entalpha);
#ifndef VITA
Fog_StartAdditive (); Fog_StartAdditive ();
#endif
GL_DrawAliasFrame (paliashdr, lerpdata); GL_DrawAliasFrame (paliashdr, lerpdata);
#ifndef VITA
Fog_StopAdditive (); Fog_StopAdditive ();
#endif
glDepthMask(GL_TRUE); glDepthMask(GL_TRUE);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_BLEND); glDisable(GL_BLEND);
@ -1254,9 +1258,13 @@ void R_DrawAliasModel (entity_t *e)
glDepthMask(GL_FALSE); glDepthMask(GL_FALSE);
shading = false; shading = false;
glColor3f(entalpha,entalpha,entalpha); glColor3f(entalpha,entalpha,entalpha);
#ifndef VITA
Fog_StartAdditive (); Fog_StartAdditive ();
#endif
GL_DrawAliasFrame (paliashdr, lerpdata); GL_DrawAliasFrame (paliashdr, lerpdata);
#ifndef VITA
Fog_StopAdditive (); Fog_StopAdditive ();
#endif
glDepthMask(GL_TRUE); glDepthMask(GL_TRUE);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_BLEND); glDisable(GL_BLEND);
@ -1273,9 +1281,13 @@ void R_DrawAliasModel (entity_t *e)
glEnable(GL_BLEND); glEnable(GL_BLEND);
glBlendFunc (GL_ONE, GL_ONE); glBlendFunc (GL_ONE, GL_ONE);
glDepthMask(GL_FALSE); glDepthMask(GL_FALSE);
#ifndef VITA
Fog_StartAdditive (); Fog_StartAdditive ();
#endif
GL_DrawAliasFrame (paliashdr, lerpdata); GL_DrawAliasFrame (paliashdr, lerpdata);
#ifndef VITA
Fog_StopAdditive (); Fog_StopAdditive ();
#endif
glDepthMask(GL_TRUE); glDepthMask(GL_TRUE);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@ -1290,9 +1302,13 @@ void R_DrawAliasModel (entity_t *e)
glDepthMask(GL_FALSE); glDepthMask(GL_FALSE);
shading = false; shading = false;
glColor3f(entalpha,entalpha,entalpha); glColor3f(entalpha,entalpha,entalpha);
#ifndef VITA
Fog_StartAdditive (); Fog_StartAdditive ();
#endif
GL_DrawAliasFrame (paliashdr, lerpdata); GL_DrawAliasFrame (paliashdr, lerpdata);
#ifndef VITA
Fog_StopAdditive (); Fog_StopAdditive ();
#endif
glDepthMask(GL_TRUE); glDepthMask(GL_TRUE);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_BLEND); glDisable(GL_BLEND);
@ -1331,9 +1347,13 @@ void R_DrawAliasModel (entity_t *e)
glDepthMask(GL_FALSE); glDepthMask(GL_FALSE);
shading = false; shading = false;
glColor3f(entalpha,entalpha,entalpha); glColor3f(entalpha,entalpha,entalpha);
#ifndef VITA
Fog_StartAdditive (); Fog_StartAdditive ();
#endif
GL_DrawAliasFrame (paliashdr, lerpdata); GL_DrawAliasFrame (paliashdr, lerpdata);
#ifndef VITA
Fog_StopAdditive (); Fog_StopAdditive ();
#endif
glDepthMask(GL_TRUE); glDepthMask(GL_TRUE);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_BLEND); glDisable(GL_BLEND);

View File

@ -370,10 +370,14 @@ void R_DrawSequentialPoly (msurface_t *s)
else //case 3: texture in one pass, lightmap in second pass using 2x modulation blend func, fog in third pass else //case 3: texture in one pass, lightmap in second pass using 2x modulation blend func, fog in third pass
{ {
//first pass -- texture with no fog //first pass -- texture with no fog
#ifndef VITA
Fog_DisableGFog (); Fog_DisableGFog ();
#endif VITA
GL_Bind (t->gltexture); GL_Bind (t->gltexture);
DrawGLPoly (s->polys); DrawGLPoly (s->polys);
#ifndef VITA
Fog_EnableGFog (); Fog_EnableGFog ();
#endif
rs_brushpasses++; rs_brushpasses++;
//second pass -- lightmap with black fog, modulate blended //second pass -- lightmap with black fog, modulate blended
@ -382,7 +386,9 @@ void R_DrawSequentialPoly (msurface_t *s)
glDepthMask (GL_FALSE); glDepthMask (GL_FALSE);
glEnable (GL_BLEND); glEnable (GL_BLEND);
glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR); //2x modulate glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR); //2x modulate
#ifndef VITA
Fog_StartAdditive (); Fog_StartAdditive ();
#endif
#ifdef VITA #ifdef VITA
glBegin(GL_TRIANGLE_FAN); glBegin(GL_TRIANGLE_FAN);
#else #else
@ -395,10 +401,13 @@ void R_DrawSequentialPoly (msurface_t *s)
glVertex3fv (v); glVertex3fv (v);
} }
glEnd (); glEnd ();
#ifndef VITA
Fog_StopAdditive (); Fog_StopAdditive ();
#endif
rs_brushpasses++; rs_brushpasses++;
//third pass -- black geo with normal fog, additive blended //third pass -- black geo with normal fog, additive blended
#ifndef VITA
if (Fog_GetDensity() > 0) if (Fog_GetDensity() > 0)
{ {
glBlendFunc(GL_ONE, GL_ONE); //add glBlendFunc(GL_ONE, GL_ONE); //add
@ -409,6 +418,7 @@ void R_DrawSequentialPoly (msurface_t *s)
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
rs_brushpasses++; rs_brushpasses++;
} }
#endif
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable (GL_BLEND); glDisable (GL_BLEND);
@ -451,10 +461,14 @@ void R_DrawSequentialPoly (msurface_t *s)
else //case 6: texture in one pass, lightmap in a second pass, fog in third pass else //case 6: texture in one pass, lightmap in a second pass, fog in third pass
{ {
//first pass -- texture with no fog //first pass -- texture with no fog
#ifndef VITA
Fog_DisableGFog (); Fog_DisableGFog ();
#endif
GL_Bind (t->gltexture); GL_Bind (t->gltexture);
DrawGLPoly (s->polys); DrawGLPoly (s->polys);
#ifndef VITA
Fog_EnableGFog (); Fog_EnableGFog ();
#endif
rs_brushpasses++; rs_brushpasses++;
//second pass -- lightmap with black fog, modulate blended //second pass -- lightmap with black fog, modulate blended
@ -463,7 +477,9 @@ void R_DrawSequentialPoly (msurface_t *s)
glDepthMask (GL_FALSE); glDepthMask (GL_FALSE);
glEnable (GL_BLEND); glEnable (GL_BLEND);
glBlendFunc (GL_ZERO, GL_SRC_COLOR); //modulate glBlendFunc (GL_ZERO, GL_SRC_COLOR); //modulate
#ifndef VITA
Fog_StartAdditive (); Fog_StartAdditive ();
#endif
#ifdef VITA #ifdef VITA
glBegin(GL_TRIANGLE_FAN); glBegin(GL_TRIANGLE_FAN);
#else #else
@ -476,9 +492,11 @@ void R_DrawSequentialPoly (msurface_t *s)
glVertex3fv (v); glVertex3fv (v);
} }
glEnd (); glEnd ();
#ifndef VITA
Fog_StopAdditive (); Fog_StopAdditive ();
#endif
rs_brushpasses++; rs_brushpasses++;
#ifndef VITA
//third pass -- black geo with normal fog, additive blended //third pass -- black geo with normal fog, additive blended
if (Fog_GetDensity() > 0) if (Fog_GetDensity() > 0)
{ {
@ -490,7 +508,7 @@ void R_DrawSequentialPoly (msurface_t *s)
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
rs_brushpasses++; rs_brushpasses++;
} }
#endif
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable (GL_BLEND); glDisable (GL_BLEND);
glDepthMask (GL_TRUE); glDepthMask (GL_TRUE);
@ -517,9 +535,13 @@ fullbrights:
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glColor3f (entalpha, entalpha, entalpha); glColor3f (entalpha, entalpha, entalpha);
GL_Bind (t->fullbright); GL_Bind (t->fullbright);
#ifndef VITA
Fog_StartAdditive (); Fog_StartAdditive ();
#endif
DrawGLPoly (s->polys); DrawGLPoly (s->polys);
#ifndef VITA
Fog_StopAdditive (); Fog_StopAdditive ();
#endif
glColor3f(1, 1, 1); glColor3f(1, 1, 1);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

View File

@ -1197,24 +1197,32 @@ void R_DrawTextureChains (qmodel_t *model, entity_t *ent, texchain_t chain)
//to make fog work with multipass lightmapping, need to do one pass //to make fog work with multipass lightmapping, need to do one pass
//with no fog, one modulate pass with black fog, and one additive //with no fog, one modulate pass with black fog, and one additive
//pass with black geometry and normal fog //pass with black geometry and normal fog
#ifndef VITA
Fog_DisableGFog (); Fog_DisableGFog ();
#endif
R_DrawTextureChains_TextureOnly (model, ent, chain); R_DrawTextureChains_TextureOnly (model, ent, chain);
#ifndef VITA
Fog_EnableGFog (); Fog_EnableGFog ();
#endif
glDepthMask (GL_FALSE); glDepthMask (GL_FALSE);
glEnable (GL_BLEND); glEnable (GL_BLEND);
glBlendFunc (GL_DST_COLOR, GL_SRC_COLOR); //2x modulate glBlendFunc (GL_DST_COLOR, GL_SRC_COLOR); //2x modulate
#ifndef VITA
Fog_StartAdditive (); Fog_StartAdditive ();
#endif
R_DrawLightmapChains (); R_DrawLightmapChains ();
#ifndef VITA
Fog_StopAdditive (); Fog_StopAdditive ();
//if (Fog_GetDensity() > 0) if (Fog_GetDensity() > 0)
//{ {
//glBlendFunc(GL_ONE, GL_ONE); //add glBlendFunc(GL_ONE, GL_ONE); //add
//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
//glColor3f(0,0,0); glColor3f(0,0,0);
//R_DrawTextureChains_TextureOnly (model, ent, chain); R_DrawTextureChains_TextureOnly (model, ent, chain);
//glColor3f(1,1,1); glColor3f(1,1,1);
//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
//} }
#endif
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable (GL_BLEND); glDisable (GL_BLEND);
glDepthMask (GL_TRUE); glDepthMask (GL_TRUE);
@ -1239,24 +1247,32 @@ void R_DrawTextureChains (qmodel_t *model, entity_t *ent, texchain_t chain)
//to make fog work with multipass lightmapping, need to do one pass //to make fog work with multipass lightmapping, need to do one pass
//with no fog, one modulate pass with black fog, and one additive //with no fog, one modulate pass with black fog, and one additive
//pass with black geometry and normal fog //pass with black geometry and normal fog
#ifndef VITA
Fog_DisableGFog (); Fog_DisableGFog ();
#endif
R_DrawTextureChains_TextureOnly (model, ent, chain); R_DrawTextureChains_TextureOnly (model, ent, chain);
#ifndef VITA
Fog_EnableGFog (); Fog_EnableGFog ();
#endif
glDepthMask (GL_FALSE); glDepthMask (GL_FALSE);
glEnable (GL_BLEND); glEnable (GL_BLEND);
glBlendFunc(GL_ZERO, GL_SRC_COLOR); //modulate glBlendFunc(GL_ZERO, GL_SRC_COLOR); //modulate
#ifndef VITA
Fog_StartAdditive (); Fog_StartAdditive ();
#endif
R_DrawLightmapChains (); R_DrawLightmapChains ();
#ifndef VITA
Fog_StopAdditive (); Fog_StopAdditive ();
//if (Fog_GetDensity() > 0) if (Fog_GetDensity() > 0)
//{ {
//glBlendFunc(GL_ONE, GL_ONE); //add glBlendFunc(GL_ONE, GL_ONE); //add
//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
//glColor3f(0,0,0); glColor3f(0,0,0);
//R_DrawTextureChains_TextureOnly (model, ent, chain); R_DrawTextureChains_TextureOnly (model, ent, chain);
//glColor3f(1,1,1); glColor3f(1,1,1);
//glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
//} }
#endif
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable (GL_BLEND); glDisable (GL_BLEND);
glDepthMask (GL_TRUE); glDepthMask (GL_TRUE);
@ -1273,9 +1289,13 @@ fullbrights:
glBlendFunc (GL_ONE, GL_ONE); glBlendFunc (GL_ONE, GL_ONE);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glColor3f (entalpha, entalpha, entalpha); glColor3f (entalpha, entalpha, entalpha);
#ifndef VITA
Fog_StartAdditive (); Fog_StartAdditive ();
#endif
R_DrawTextureChains_Glow (model, ent, chain); R_DrawTextureChains_Glow (model, ent, chain);
#ifndef VITA
Fog_StopAdditive (); Fog_StopAdditive ();
#endif
glColor3f (1, 1, 1); glColor3f (1, 1, 1);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);