Skip to content

Commit

Permalink
Vert slope footstep sfx and fog psprite tinting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dashodanger committed Aug 28, 2023
1 parent 374135a commit 9f84caf
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 49 deletions.
18 changes: 5 additions & 13 deletions source_files/edge/p_mobj.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2005,8 +2005,7 @@ void P_SpawnBlood(float x, float y, float z, float damage,

flatdef_c* P_IsThingOnLiquidFloor(mobj_t * thing)
{
flatdef_c *current_flatdef;
current_flatdef = NULL;
flatdef_c *current_flatdef = nullptr;

// If no 3D floors, just return the flat
if (thing->subsector->sector->exfloor_used == 0)
Expand All @@ -2033,16 +2032,7 @@ flatdef_c* P_IsThingOnLiquidFloor(mobj_t * thing)
// current_flatdef = flatdefs.Find(thing->subsector->sector->floor.image->name); // Fallback if nothing else satisfies these conditions
}



if (current_flatdef)
return current_flatdef;

//if (current_flatdef->impactobject) //now check if it is has a splash object
// return current_flatdef;

return NULL;

return current_flatdef;
}

//---------------------------------------------------------------------------
Expand All @@ -2061,7 +2051,9 @@ bool P_HitLiquidFloor(mobj_t * thing)
return false;

// don't splash if landing on the edge above water/lava/etc....
if (thing->floorz != thing->subsector->sector->f_h)
if (thing->subsector->sector->floor_vertex_slope && thing->z > thing->floorz)
return false;
else if (thing->floorz != thing->subsector->sector->f_h)
return false;

flatdef_c *current_flatdef = P_IsThingOnLiquidFloor(thing);
Expand Down
35 changes: 6 additions & 29 deletions source_files/edge/r_things.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

#include "image_data.h"
#include "image_funcs.h"
#include "math_color.h"
#include "str_util.h"

#include "dm_data.h"
Expand Down Expand Up @@ -393,41 +392,19 @@ static void RGL_DrawPSprite(pspdef_t * psp, int which,
}
else if (! is_additive)
{
if (fc_to_use != RGB_NO_VALUE)
{
epi::color_c mixme(data.col[v_idx].mod_R, data.col[v_idx].mod_G, data.col[v_idx].mod_B);
mixme = mixme.Mix(epi::color_c(fc_to_use), I_ROUND(255.0f * (fd_to_use * 100)));
dest->rgba[0] = mixme.r / 255.0;
dest->rgba[1] = mixme.g / 255.0;
dest->rgba[2] = mixme.b / 255.0;
}
else
{
dest->rgba[0] = data.col[v_idx].mod_R / 255.0;
dest->rgba[1] = data.col[v_idx].mod_G / 255.0;
dest->rgba[2] = data.col[v_idx].mod_B / 255.0;
}
dest->rgba[0] = data.col[v_idx].mod_R / 255.0;
dest->rgba[1] = data.col[v_idx].mod_G / 255.0;
dest->rgba[2] = data.col[v_idx].mod_B / 255.0;

data.col[v_idx].mod_R -= 256;
data.col[v_idx].mod_G -= 256;
data.col[v_idx].mod_B -= 256;
}
else
{
if (fc_to_use != RGB_NO_VALUE)
{
epi::color_c mixme(data.col[v_idx].add_R, data.col[v_idx].add_G, data.col[v_idx].add_B);
mixme = mixme.Mix(epi::color_c(fc_to_use), I_ROUND(255.0f * (fd_to_use * 100)));
dest->rgba[0] = mixme.r / 255.0;
dest->rgba[1] = mixme.g / 255.0;
dest->rgba[2] = mixme.b / 255.0;
}
else
{
dest->rgba[0] = data.col[v_idx].add_R / 255.0;
dest->rgba[1] = data.col[v_idx].add_G / 255.0;
dest->rgba[2] = data.col[v_idx].add_B / 255.0;
}
dest->rgba[0] = data.col[v_idx].add_R / 255.0;
dest->rgba[1] = data.col[v_idx].add_G / 255.0;
dest->rgba[2] = data.col[v_idx].add_B / 255.0;
}

dest->rgba[3] = trans;
Expand Down
8 changes: 1 addition & 7 deletions source_files/edge/vm_player.cc
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,11 @@ static void PL_under_water(coal::vm_c *vm, int argc)
//
static void PL_on_ground(coal::vm_c *vm, int argc)
{
//vm->ReturnFloat((ui_player_who->mo->z <= ui_player_who->mo->floorz) ? 1 : 0);

// not a 3D floor?
if (ui_player_who->mo->subsector->sector->exfloor_used == 0)
{
// on the edge above water/lava/etc? Handles edge walker case
if (ui_player_who->mo->floorz != ui_player_who->mo->subsector->sector->f_h)
if (ui_player_who->mo->floorz != ui_player_who->mo->subsector->sector->f_h && !ui_player_who->mo->subsector->sector->floor_vertex_slope)
vm->ReturnFloat(0);
else
{
Expand All @@ -242,10 +240,6 @@ static void PL_on_ground(coal::vm_c *vm, int argc)
else
vm->ReturnFloat(0);
}




}


Expand Down

0 comments on commit 9f84caf

Please sign in to comment.