move postimg flags to camera struct
- also dont let water and heat be applied on top of each other since it does not look good (water postimg takes priority over heat) - also save a little time in opengl splitscreen since it does not support heat or wöter effects
This commit is contained in:
parent
c63d596533
commit
6b1de73341
8 changed files with 165 additions and 149 deletions
|
|
@ -367,7 +367,7 @@ static void D_RenderLevel(void)
|
||||||
{
|
{
|
||||||
R_ApplyViewMorph(i);
|
R_ApplyViewMorph(i);
|
||||||
|
|
||||||
V_DoPostProcessor(i, &players[displayplayers[i]], postimgparam[i]);
|
V_DoPostProcessor(i, postimgparam[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -505,8 +505,6 @@ struct player_t
|
||||||
// See pflags_t, above.
|
// See pflags_t, above.
|
||||||
pflags_t pflags;
|
pflags_t pflags;
|
||||||
|
|
||||||
UINT16 postimgflags;
|
|
||||||
|
|
||||||
// playing animation.
|
// playing animation.
|
||||||
panim_t panim;
|
panim_t panim;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5657,6 +5657,8 @@ void HWR_BuildSkyDome(void)
|
||||||
|
|
||||||
static void HWR_DrawSkyBackground(player_t *player)
|
static void HWR_DrawSkyBackground(player_t *player)
|
||||||
{
|
{
|
||||||
|
UINT8 viewnum = R_GetViewNumber();
|
||||||
|
camera_t *thiscam = &camera[viewnum];
|
||||||
HWD.pfnSetBlend(PF_Translucent|PF_NoDepthTest|PF_Modulated);
|
HWD.pfnSetBlend(PF_Translucent|PF_NoDepthTest|PF_Modulated);
|
||||||
|
|
||||||
if (cv_glskydome.value)
|
if (cv_glskydome.value)
|
||||||
|
|
@ -5672,15 +5674,15 @@ static void HWR_DrawSkyBackground(player_t *player)
|
||||||
dometransform.angley = (float)((viewangle-ANGLE_270)>>ANGLETOFINESHIFT)*(360.0f/(float)FINEANGLES);
|
dometransform.angley = (float)((viewangle-ANGLE_270)>>ANGLETOFINESHIFT)*(360.0f/(float)FINEANGLES);
|
||||||
|
|
||||||
dometransform.flip = false;
|
dometransform.flip = false;
|
||||||
if ((player->postimgflags & POSTIMG_FLIP) && !(player->postimgflags & POSTIMG_MIRROR))
|
if ((thiscam->postimgflags & POSTIMG_FLIP) && !(thiscam->postimgflags & POSTIMG_MIRROR))
|
||||||
dometransform.flip = true;
|
dometransform.flip = true;
|
||||||
|
|
||||||
dometransform.mirror = false;
|
dometransform.mirror = false;
|
||||||
if ((player->postimgflags & POSTIMG_MIRROR) && !(player->postimgflags & POSTIMG_FLIP))
|
if ((thiscam->postimgflags & POSTIMG_MIRROR) && !(thiscam->postimgflags & POSTIMG_FLIP))
|
||||||
dometransform.mirror = true;
|
dometransform.mirror = true;
|
||||||
|
|
||||||
dometransform.mirrorflip = false;
|
dometransform.mirrorflip = false;
|
||||||
if ((player->postimgflags & POSTIMG_FLIP) && (player->postimgflags & POSTIMG_MIRROR))
|
if ((thiscam->postimgflags & POSTIMG_FLIP) && (thiscam->postimgflags & POSTIMG_MIRROR))
|
||||||
dometransform.mirrorflip = true;
|
dometransform.mirrorflip = true;
|
||||||
|
|
||||||
dometransform.scalex = 1;
|
dometransform.scalex = 1;
|
||||||
|
|
@ -5926,6 +5928,8 @@ static void HWR_ClearClipper(void)
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
void HWR_RenderSkyboxView(player_t *player)
|
void HWR_RenderSkyboxView(player_t *player)
|
||||||
{
|
{
|
||||||
|
UINT8 viewnum = R_GetViewNumber();
|
||||||
|
camera_t *thiscam = &camera[viewnum];
|
||||||
const float fpov = FIXED_TO_FLOAT(cv_fov[viewssnum].value+player->fovadd);
|
const float fpov = FIXED_TO_FLOAT(cv_fov[viewssnum].value+player->fovadd);
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
@ -5968,15 +5972,15 @@ void HWR_RenderSkyboxView(player_t *player)
|
||||||
gl_viewludcos = FIXED_TO_FLOAT(-FINESINE(gl_aimingangle>>ANGLETOFINESHIFT));
|
gl_viewludcos = FIXED_TO_FLOAT(-FINESINE(gl_aimingangle>>ANGLETOFINESHIFT));
|
||||||
|
|
||||||
atransform.flip = false;
|
atransform.flip = false;
|
||||||
if ((player->postimgflags & POSTIMG_FLIP) && !(player->postimgflags & POSTIMG_MIRROR))
|
if ((thiscam->postimgflags & POSTIMG_FLIP) && !(thiscam->postimgflags & POSTIMG_MIRROR))
|
||||||
atransform.flip = true;
|
atransform.flip = true;
|
||||||
|
|
||||||
atransform.mirror = false;
|
atransform.mirror = false;
|
||||||
if ((player->postimgflags & POSTIMG_MIRROR) && !(player->postimgflags & POSTIMG_FLIP))
|
if ((thiscam->postimgflags & POSTIMG_MIRROR) && !(thiscam->postimgflags & POSTIMG_FLIP))
|
||||||
atransform.mirror = true;
|
atransform.mirror = true;
|
||||||
|
|
||||||
atransform.mirrorflip = false;
|
atransform.mirrorflip = false;
|
||||||
if ((player->postimgflags & POSTIMG_FLIP) && (player->postimgflags & POSTIMG_MIRROR))
|
if ((thiscam->postimgflags & POSTIMG_FLIP) && (thiscam->postimgflags & POSTIMG_MIRROR))
|
||||||
atransform.mirrorflip = true;
|
atransform.mirrorflip = true;
|
||||||
|
|
||||||
atransform.x = gl_viewx; // FIXED_TO_FLOAT(viewx)
|
atransform.x = gl_viewx; // FIXED_TO_FLOAT(viewx)
|
||||||
|
|
@ -6075,6 +6079,8 @@ static void HWR_RollTransform(FTransform *tr, angle_t roll)
|
||||||
void HWR_RenderPlayerView(void)
|
void HWR_RenderPlayerView(void)
|
||||||
{
|
{
|
||||||
player_t * player = &players[displayplayers[viewssnum]];
|
player_t * player = &players[displayplayers[viewssnum]];
|
||||||
|
UINT8 viewnum = R_GetViewNumber();
|
||||||
|
camera_t *thiscam = &camera[viewnum];
|
||||||
|
|
||||||
const float fpov = FIXED_TO_FLOAT(cv_fov[viewssnum].value+player->fovadd);
|
const float fpov = FIXED_TO_FLOAT(cv_fov[viewssnum].value+player->fovadd);
|
||||||
|
|
||||||
|
|
@ -6153,15 +6159,15 @@ void HWR_RenderPlayerView(void)
|
||||||
gl_viewludcos = FIXED_TO_FLOAT(-FINESINE(gl_aimingangle>>ANGLETOFINESHIFT));
|
gl_viewludcos = FIXED_TO_FLOAT(-FINESINE(gl_aimingangle>>ANGLETOFINESHIFT));
|
||||||
|
|
||||||
atransform.flip = false;
|
atransform.flip = false;
|
||||||
if ((player->postimgflags & POSTIMG_FLIP) && !(player->postimgflags & POSTIMG_MIRROR))
|
if ((thiscam->postimgflags & POSTIMG_FLIP) && !(thiscam->postimgflags & POSTIMG_MIRROR))
|
||||||
atransform.flip = true;
|
atransform.flip = true;
|
||||||
|
|
||||||
atransform.mirror = false;
|
atransform.mirror = false;
|
||||||
if ((player->postimgflags & POSTIMG_MIRROR) && !(player->postimgflags & POSTIMG_FLIP))
|
if ((thiscam->postimgflags & POSTIMG_MIRROR) && !(thiscam->postimgflags & POSTIMG_FLIP))
|
||||||
atransform.mirror = true;
|
atransform.mirror = true;
|
||||||
|
|
||||||
atransform.mirrorflip = false;
|
atransform.mirrorflip = false;
|
||||||
if ((player->postimgflags & POSTIMG_FLIP) && (player->postimgflags & POSTIMG_MIRROR))
|
if ((thiscam->postimgflags & POSTIMG_FLIP) && (thiscam->postimgflags & POSTIMG_MIRROR))
|
||||||
atransform.mirrorflip = true;
|
atransform.mirrorflip = true;
|
||||||
|
|
||||||
atransform.x = gl_viewx; // FIXED_TO_FLOAT(viewx)
|
atransform.x = gl_viewx; // FIXED_TO_FLOAT(viewx)
|
||||||
|
|
@ -6562,8 +6568,12 @@ void HWR_DoPostProcessor(player_t *player)
|
||||||
if (r_splitscreen) // Not supported in splitscreen - someone want to add support?
|
if (r_splitscreen) // Not supported in splitscreen - someone want to add support?
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
//UINT8 viewnum = R_GetViewNumber(); // see above
|
||||||
|
//camera_t *thiscam = &camera[viewnum];
|
||||||
|
camera_t *thiscam = &camera[0];
|
||||||
|
|
||||||
// Drunken vision! WooOOooo~
|
// Drunken vision! WooOOooo~
|
||||||
if (player->postimgflags & POSTIMG_WATER || player->postimgflags & POSTIMG_HEAT)
|
if (thiscam->postimgflags & POSTIMG_WATER || thiscam->postimgflags & POSTIMG_HEAT)
|
||||||
{
|
{
|
||||||
// 10 by 10 grid. 2 coordinates (xy)
|
// 10 by 10 grid. 2 coordinates (xy)
|
||||||
float v[SCREENVERTS][SCREENVERTS][2];
|
float v[SCREENVERTS][SCREENVERTS][2];
|
||||||
|
|
@ -6575,7 +6585,7 @@ void HWR_DoPostProcessor(player_t *player)
|
||||||
INT32 FREQUENCY;
|
INT32 FREQUENCY;
|
||||||
|
|
||||||
// Modifies the wave.
|
// Modifies the wave.
|
||||||
if (player->postimgflags & POSTIMG_WATER)
|
if (thiscam->postimgflags & POSTIMG_WATER)
|
||||||
{
|
{
|
||||||
WAVELENGTH = 5;
|
WAVELENGTH = 5;
|
||||||
AMPLITUDE = 40;
|
AMPLITUDE = 40;
|
||||||
|
|
|
||||||
|
|
@ -131,6 +131,9 @@ struct camera_t
|
||||||
// Interpolation data
|
// Interpolation data
|
||||||
fixed_t old_x, old_y, old_z;
|
fixed_t old_x, old_y, old_z;
|
||||||
angle_t old_angle, old_aiming;
|
angle_t old_angle, old_aiming;
|
||||||
|
|
||||||
|
// postproccess effects
|
||||||
|
UINT16 postimgflags;
|
||||||
};
|
};
|
||||||
|
|
||||||
// demo freecam or something before i commit die
|
// demo freecam or something before i commit die
|
||||||
|
|
|
||||||
37
src/p_mobj.c
37
src/p_mobj.c
|
|
@ -3546,18 +3546,25 @@ void P_DestroyRobots(void)
|
||||||
// the below is chasecam only, if you're curious. check out P_CalcPostImg in p_user.c for first person
|
// the below is chasecam only, if you're curious. check out P_CalcPostImg in p_user.c for first person
|
||||||
void P_CalcChasePostImg(player_t *player, camera_t *thiscam)
|
void P_CalcChasePostImg(player_t *player, camera_t *thiscam)
|
||||||
{
|
{
|
||||||
boolean flipcam = (player->pflags & PF_FLIPCAM && player->mo->eflags & MFE_VERTICALFLIP);
|
const boolean flipcam = (player->pflags & PF_FLIPCAM && player->mo->eflags & MFE_VERTICALFLIP);
|
||||||
UINT16 postimgflags = 0;
|
UINT16 postimgtype = 0;
|
||||||
UINT8 i;
|
|
||||||
|
|
||||||
// This can happen when joining
|
// This can happen when joining
|
||||||
if (thiscam->subsector == NULL || thiscam->subsector->sector == NULL)
|
if (thiscam->subsector == NULL || thiscam->subsector->sector == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (encoremode)
|
if (encoremode)
|
||||||
postimgflags |= POSTIMG_MIRROR;
|
postimgtype |= POSTIMG_MIRROR;
|
||||||
if (flipcam)
|
if (flipcam)
|
||||||
postimgflags |= POSTIMG_FLIP;
|
postimgtype |= POSTIMG_FLIP;
|
||||||
|
|
||||||
|
#ifdef HWRENDER
|
||||||
|
if (rendermode == render_opengl && splitscreen)
|
||||||
|
{
|
||||||
|
thiscam->postimgflags = postimgtype;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (player->awayviewtics && player->awayviewmobj && !P_MobjWasRemoved(player->awayviewmobj)) // Camera must obviously exist
|
if (player->awayviewtics && player->awayviewmobj && !P_MobjWasRemoved(player->awayviewmobj)) // Camera must obviously exist
|
||||||
{
|
{
|
||||||
|
|
@ -3572,26 +3579,20 @@ void P_CalcChasePostImg(player_t *player, camera_t *thiscam)
|
||||||
|
|
||||||
// Are we in water?
|
// Are we in water?
|
||||||
if (P_CameraCheckWater(&dummycam))
|
if (P_CameraCheckWater(&dummycam))
|
||||||
postimgflags |= POSTIMG_WATER;
|
postimgtype |= POSTIMG_WATER;
|
||||||
if (P_CameraCheckHeat(&dummycam))
|
else if (P_CameraCheckHeat(&dummycam))
|
||||||
postimgflags |= POSTIMG_HEAT;
|
postimgtype |= POSTIMG_HEAT;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Are we in water?
|
// Are we in water?
|
||||||
if (P_CameraCheckWater(thiscam))
|
if (P_CameraCheckWater(thiscam))
|
||||||
postimgflags |= POSTIMG_WATER;
|
postimgtype |= POSTIMG_WATER;
|
||||||
if (P_CameraCheckHeat(thiscam))
|
else if (P_CameraCheckHeat(thiscam))
|
||||||
postimgflags |= POSTIMG_HEAT;
|
postimgtype |= POSTIMG_HEAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i <= splitscreen; i++)
|
thiscam->postimgflags = postimgtype;
|
||||||
{
|
|
||||||
if (player != &players[displayplayers[i]])
|
|
||||||
continue;
|
|
||||||
|
|
||||||
players[displayplayers[i]].postimgflags = postimgflags;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// P_CameraThinker
|
// P_CameraThinker
|
||||||
|
|
|
||||||
184
src/p_user.c
184
src/p_user.c
|
|
@ -2661,6 +2661,9 @@ void P_DemoCameraMovement(camera_t *cam)
|
||||||
|
|
||||||
boolean moving = false;
|
boolean moving = false;
|
||||||
|
|
||||||
|
if (encoremode)
|
||||||
|
cam->postimgflags |= POSTIMG_MIRROR;
|
||||||
|
|
||||||
// first off we need to get button input
|
// first off we need to get button input
|
||||||
G_BuildTiccmd(cmd, 1, UINT8_MAX);
|
G_BuildTiccmd(cmd, 1, UINT8_MAX);
|
||||||
|
|
||||||
|
|
@ -3361,27 +3364,71 @@ boolean P_SpectatorJoinGame(player_t *player)
|
||||||
return true; // no more player->mo, cannot continue.
|
return true; // no more player->mo, cannot continue.
|
||||||
}
|
}
|
||||||
|
|
||||||
// the below is first person only, if you're curious. check out P_CalcChasePostImg in p_mobj.c for chasecam
|
static boolean P_CameraCheckHeatFirstperson(player_t *player, sector_t *sector, fixed_t pviewheight)
|
||||||
static void P_CalcPostImg(player_t *player)
|
|
||||||
{
|
{
|
||||||
sector_t *sector = player->mo->subsector->sector;
|
mtag_t sectag = Tag_FGet(§or->tags);
|
||||||
INT16 typeflag = 0;
|
|
||||||
//INT32 *param;
|
|
||||||
fixed_t pviewheight;
|
|
||||||
size_t i;
|
|
||||||
|
|
||||||
if (player->mo->eflags & MFE_VERTICALFLIP)
|
if (Tag_FindLineSpecial(13, sectag))
|
||||||
pviewheight = player->mo->z + player->mo->height - player->viewheight;
|
return true;
|
||||||
else
|
|
||||||
pviewheight = player->mo->z + player->viewheight;
|
|
||||||
|
|
||||||
if (player->awayviewtics && player->awayviewmobj && !P_MobjWasRemoved(player->awayviewmobj))
|
if (sector->ffloors)
|
||||||
{
|
{
|
||||||
sector = player->awayviewmobj->subsector->sector;
|
ffloor_t *rover;
|
||||||
pviewheight = player->awayviewmobj->z + 20*FRACUNIT;
|
|
||||||
|
for (rover = sector->ffloors; rover; rover = rover->next)
|
||||||
|
{
|
||||||
|
if (!(rover->fofflags & FOF_EXISTS))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (pviewheight >= P_GetFFloorTopZAt(rover, player->mo->x, player->mo->y))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (pviewheight <= P_GetFFloorBottomZAt(rover, player->mo->x, player->mo->y))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
sectag = Tag_FGet(&rover->master->frontsector->tags);
|
||||||
|
|
||||||
|
if (Tag_FindLineSpecial(13, sectag))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*for (i = 0; i <= (unsigned)r_splitscreen; i++)
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static boolean P_CameraCheckWaterFirstperson(player_t *player, sector_t *sector, fixed_t pviewheight)
|
||||||
|
{
|
||||||
|
if (sector->ffloors)
|
||||||
|
{
|
||||||
|
ffloor_t *rover;
|
||||||
|
|
||||||
|
for (rover = sector->ffloors; rover; rover = rover->next)
|
||||||
|
{
|
||||||
|
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE) || rover->fofflags & FOF_BLOCKPLAYER)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (pviewheight >= P_GetFFloorTopZAt(rover, player->mo->x, player->mo->y))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (pviewheight <= P_GetFFloorBottomZAt(rover, player->mo->x, player->mo->y))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// the below is first person only, if you're curious. check out P_CalcChasePostImg in p_mobj.c for chasecam
|
||||||
|
static void P_CalcPostImg(player_t *player, camera_t *thiscam)
|
||||||
|
{
|
||||||
|
sector_t *sector = NULL;
|
||||||
|
INT16 postimgtype = 0;
|
||||||
|
//INT32 *param;
|
||||||
|
fixed_t pviewheight = 0;
|
||||||
|
|
||||||
|
/*for (i = 0; i <= splitscreen; i++)
|
||||||
{
|
{
|
||||||
if (player == &players[displayplayers[i]])
|
if (player == &players[displayplayers[i]])
|
||||||
{
|
{
|
||||||
|
|
@ -3390,96 +3437,55 @@ static void P_CalcPostImg(player_t *player)
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
// see if we are in heat (no, not THAT kind of heat...)
|
if (encoremode) // srb2kart
|
||||||
for (i = 0; i < sector->tags.count; i++)
|
postimgtype |= POSTIMG_MIRROR;
|
||||||
|
|
||||||
|
if (player->mo->eflags & MFE_VERTICALFLIP)
|
||||||
|
postimgtype |= POSTIMG_FLIP;
|
||||||
|
|
||||||
|
#ifdef HWRENDER
|
||||||
|
if (rendermode == render_opengl && splitscreen)
|
||||||
{
|
{
|
||||||
if (Tag_FindLineSpecial(13, sector->tags.tags[i]) != -1)
|
thiscam->postimgflags = postimgtype;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
sector = player->mo->subsector->sector;
|
||||||
|
|
||||||
|
if (sector->ffloors)
|
||||||
|
{
|
||||||
|
if (player->mo->eflags & MFE_VERTICALFLIP)
|
||||||
|
pviewheight = player->mo->z + player->mo->height - player->viewheight;
|
||||||
|
else
|
||||||
|
pviewheight = player->mo->z + player->viewheight;
|
||||||
|
|
||||||
|
if (player->awayviewtics && player->awayviewmobj && !P_MobjWasRemoved(player->awayviewmobj))
|
||||||
{
|
{
|
||||||
typeflag |= POSTIMG_HEAT;
|
sector = player->awayviewmobj->subsector->sector;
|
||||||
break;
|
pviewheight = player->awayviewmobj->z + 20*FRACUNIT;
|
||||||
}
|
|
||||||
else if (sector->ffloors)
|
|
||||||
{
|
|
||||||
ffloor_t *rover;
|
|
||||||
fixed_t topheight;
|
|
||||||
fixed_t bottomheight;
|
|
||||||
boolean gotres = false;
|
|
||||||
|
|
||||||
for (rover = sector->ffloors; rover; rover = rover->next)
|
|
||||||
{
|
|
||||||
size_t j;
|
|
||||||
|
|
||||||
if (!(rover->fofflags & FOF_EXISTS))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
topheight = P_GetFFloorTopZAt (rover, player->mo->x, player->mo->y);
|
|
||||||
bottomheight = P_GetFFloorBottomZAt(rover, player->mo->x, player->mo->y);
|
|
||||||
|
|
||||||
if (pviewheight >= topheight || pviewheight <= bottomheight)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
for (j = 0; j < rover->master->frontsector->tags.count; j++)
|
|
||||||
{
|
|
||||||
if (Tag_FindLineSpecial(13, rover->master->frontsector->tags.tags[j]) != -1)
|
|
||||||
{
|
|
||||||
typeflag |= POSTIMG_HEAT;
|
|
||||||
gotres = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (gotres)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// see if we are in water (water trumps heat)
|
// see if we are in water (water trumps heat)
|
||||||
if (sector->ffloors)
|
if (P_CameraCheckWaterFirstperson(player, sector, pviewheight))
|
||||||
{
|
postimgtype |= POSTIMG_WATER;
|
||||||
ffloor_t *rover;
|
// see if we are in heat (no, not THAT kind of heat...)
|
||||||
fixed_t topheight;
|
else if (P_CameraCheckHeatFirstperson(player, sector, pviewheight))
|
||||||
fixed_t bottomheight;
|
postimgtype |= POSTIMG_HEAT;
|
||||||
|
|
||||||
for (rover = sector->ffloors; rover; rover = rover->next)
|
|
||||||
{
|
|
||||||
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_SWIMMABLE) || rover->fofflags & FOF_BLOCKPLAYER)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
topheight = P_GetFFloorTopZAt (rover, player->mo->x, player->mo->y);
|
|
||||||
bottomheight = P_GetFFloorBottomZAt(rover, player->mo->x, player->mo->y);
|
|
||||||
|
|
||||||
if (pviewheight >= topheight || pviewheight <= bottomheight)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
typeflag |= POSTIMG_WATER;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (encoremode) // srb2kart
|
|
||||||
typeflag |= POSTIMG_MIRROR;
|
|
||||||
|
|
||||||
if (player->mo->eflags & MFE_VERTICALFLIP)
|
|
||||||
typeflag |= POSTIMG_FLIP;
|
|
||||||
|
|
||||||
// Motion blur
|
// Motion blur
|
||||||
// unused
|
// unused
|
||||||
/*if (player->speed > (35<<FRACBITS))
|
/*if (player->speed > (35<<FRACBITS))
|
||||||
{
|
{
|
||||||
typeflag |= POSTIMG_MOTION;
|
postimgtype |= POSTIMG_MOTION;
|
||||||
*param = (player->speed - 32)/4;
|
*param = (player->speed - 32)/4;
|
||||||
|
|
||||||
if (*param > 5)
|
if (*param > 5)
|
||||||
*param = 5;
|
*param = 5;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
for (i = 0; i <= (unsigned)r_splitscreen; i++)
|
thiscam->postimgflags = postimgtype;
|
||||||
{
|
|
||||||
if (player != &players[displayplayers[i]])
|
|
||||||
continue;
|
|
||||||
|
|
||||||
players[displayplayers[i]].postimgflags = typeflag;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void P_DoTimeOver(player_t *player)
|
void P_DoTimeOver(player_t *player)
|
||||||
|
|
@ -4262,7 +4268,7 @@ void P_PlayerAfterThink(player_t *player)
|
||||||
if (!thiscam->chase) // bob view only if looking through the player's eyes
|
if (!thiscam->chase) // bob view only if looking through the player's eyes
|
||||||
{
|
{
|
||||||
P_CalcHeight(player);
|
P_CalcHeight(player);
|
||||||
P_CalcPostImg(player);
|
P_CalcPostImg(player, thiscam);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2840,7 +2840,7 @@ INT32 heatindex[MAXSPLITSCREENPLAYERS] = {0, 0, 0, 0};
|
||||||
// Perform a particular image postprocessing function.
|
// Perform a particular image postprocessing function.
|
||||||
//
|
//
|
||||||
|
|
||||||
void V_DoPostProcessor(INT32 view, player_t *player, INT32 param)
|
void V_DoPostProcessor(INT32 view, INT32 param)
|
||||||
{
|
{
|
||||||
#if NUMSCREENS < 5
|
#if NUMSCREENS < 5
|
||||||
// do not enable image post processing for ARM, SH and MIPS CPUs
|
// do not enable image post processing for ARM, SH and MIPS CPUs
|
||||||
|
|
@ -2859,6 +2859,11 @@ void V_DoPostProcessor(INT32 view, player_t *player, INT32 param)
|
||||||
if (view < 0 || view > 3 || view > r_splitscreen)
|
if (view < 0 || view > 3 || view > r_splitscreen)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
camera_t *thiscam = &camera[view];
|
||||||
|
|
||||||
|
if (!thiscam->postimgflags)
|
||||||
|
return;
|
||||||
|
|
||||||
if ((view == 1 && r_splitscreen == 1) || view >= 2)
|
if ((view == 1 && r_splitscreen == 1) || view >= 2)
|
||||||
yoffset = viewheight;
|
yoffset = viewheight;
|
||||||
else
|
else
|
||||||
|
|
@ -2872,10 +2877,7 @@ void V_DoPostProcessor(INT32 view, player_t *player, INT32 param)
|
||||||
UINT8 *tmpscr = screens[4];
|
UINT8 *tmpscr = screens[4];
|
||||||
UINT8 *srcscr = screens[0];
|
UINT8 *srcscr = screens[0];
|
||||||
|
|
||||||
if (!player->postimgflags)
|
if (thiscam->postimgflags & POSTIMG_WATER)
|
||||||
return;
|
|
||||||
|
|
||||||
if (player->postimgflags & POSTIMG_WATER)
|
|
||||||
{
|
{
|
||||||
INT32 y;
|
INT32 y;
|
||||||
// Set disStart to a range from 0 to FINEANGLE, incrementing by 128 per tic
|
// Set disStart to a range from 0 to FINEANGLE, incrementing by 128 per tic
|
||||||
|
|
@ -2933,25 +2935,7 @@ void V_DoPostProcessor(INT32 view, player_t *player, INT32 param)
|
||||||
tmpscr = srcscr;
|
tmpscr = srcscr;
|
||||||
srcscr = tmp;
|
srcscr = tmp;
|
||||||
}
|
}
|
||||||
|
else if (thiscam->postimgflags & POSTIMG_HEAT) // Heat wave
|
||||||
/*if (player->postimgflags & POSTIMG_MOTION) // Motion Blur!
|
|
||||||
* {
|
|
||||||
* INT32 x, y;
|
|
||||||
*
|
|
||||||
* // TODO: Add a postimg_param so that we can pick the translucency level...
|
|
||||||
* UINT8 *transme = transtables + ((param-1)<<FF_TRANSSHIFT);
|
|
||||||
*
|
|
||||||
* for (y = yoffset; y < yoffset+viewheight; y++)
|
|
||||||
* {
|
|
||||||
* for (x = xoffset; x < xoffset+viewwidth; x++)
|
|
||||||
* {
|
|
||||||
* tmpscr[y*vid.width + x]
|
|
||||||
* = colormaps[*(transme + (srcscr [(y*vid.width)+x ] <<8) + (tmpscr[(y*vid.width)+x]))];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if (player->postimgflags & POSTIMG_HEAT) // Heat wave
|
|
||||||
{
|
{
|
||||||
INT32 y;
|
INT32 y;
|
||||||
|
|
||||||
|
|
@ -2998,7 +2982,21 @@ void V_DoPostProcessor(INT32 view, player_t *player, INT32 param)
|
||||||
srcscr = tmp;
|
srcscr = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((player->postimgflags & POSTIMG_FLIP) && !(player->postimgflags & POSTIMG_MIRROR)) // Flip the screen upside-down
|
/*if (thiscam->postimg & POSTIMG_MOTION) // Motion Blur!
|
||||||
|
{
|
||||||
|
INT32 x, y;
|
||||||
|
|
||||||
|
// TODO: Add a postimg_param so that we can pick the translucency level...
|
||||||
|
UINT8 *transme = transtables + ((param-1)<<FF_TRANSSHIFT);
|
||||||
|
|
||||||
|
for (y = yoffset; y < yoffset+viewheight; y++)
|
||||||
|
{
|
||||||
|
for (x = xoffset; x < xoffset+viewwidth; x++)
|
||||||
|
tmpscr[y*vid.width + x] = colormaps[*(transme + (srcscr [(y*vid.width)+x ] <<8) + (tmpscr[(y*vid.width)+x]))];
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
if ((thiscam->postimgflags & POSTIMG_FLIP) && !(thiscam->postimgflags & POSTIMG_MIRROR)) // Flip the screen upside-down
|
||||||
{
|
{
|
||||||
INT32 y, y2;
|
INT32 y, y2;
|
||||||
|
|
||||||
|
|
@ -3009,7 +3007,7 @@ void V_DoPostProcessor(INT32 view, player_t *player, INT32 param)
|
||||||
tmpscr = srcscr;
|
tmpscr = srcscr;
|
||||||
srcscr = tmp;
|
srcscr = tmp;
|
||||||
}
|
}
|
||||||
else if ((player->postimgflags & POSTIMG_MIRROR) && !(player->postimgflags & POSTIMG_FLIP)) // Flip the screen on the x axis
|
else if ((thiscam->postimgflags & POSTIMG_MIRROR) && !(thiscam->postimgflags & POSTIMG_FLIP)) // Flip the screen on the x axis
|
||||||
{
|
{
|
||||||
INT32 y, x, x2;
|
INT32 y, x, x2;
|
||||||
|
|
||||||
|
|
@ -3021,7 +3019,7 @@ void V_DoPostProcessor(INT32 view, player_t *player, INT32 param)
|
||||||
tmpscr = srcscr;
|
tmpscr = srcscr;
|
||||||
srcscr = tmp;
|
srcscr = tmp;
|
||||||
}
|
}
|
||||||
else if ((player->postimgflags & POSTIMG_MIRROR) && (player->postimgflags & POSTIMG_FLIP)) // Flip the screen upside-down and on the x axis
|
else if ((thiscam->postimgflags & POSTIMG_MIRROR) && (thiscam->postimgflags & POSTIMG_FLIP)) // Flip the screen upside-down and on the x axis
|
||||||
{
|
{
|
||||||
INT32 y, x;
|
INT32 y, x;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -337,7 +337,7 @@ INT32 V_ThinStringWidth(const char *string, INT32 option);
|
||||||
// Find string width from tny_font chars, 0.5x scale
|
// Find string width from tny_font chars, 0.5x scale
|
||||||
INT32 V_SmallThinStringWidth(const char *string, INT32 option);
|
INT32 V_SmallThinStringWidth(const char *string, INT32 option);
|
||||||
|
|
||||||
void V_DoPostProcessor(INT32 view, player_t *player, INT32 param);
|
void V_DoPostProcessor(INT32 view, INT32 param);
|
||||||
|
|
||||||
void V_DrawPatchFill(patch_t *pat);
|
void V_DrawPatchFill(patch_t *pat);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue