Fixed two issues with game's transparency effects feature (which I introduced when implementing it): First, Superprox mines dropped by enemies were made undesirably transparent since they have their own ID not considered by is_proximity_bomb_or_smart_mine(). Second, only some force field textures in D2X had transparency effects since the game has two different textures for force fields - eclip num 78 and 93 - but only the former was defined and used in is_alphablend_eclip()

This commit is contained in:
Christian Beckhäuser 2019-08-08 11:57:52 +02:00
parent ec234e0b8e
commit 38fabd7c49
3 changed files with 8 additions and 3 deletions

View file

@ -50,7 +50,8 @@ constexpr std::integral_constant<uint16_t, UINT16_MAX> eclip_none{};
#define ECLIP_NUM_FUELCEN 2
#define ECLIP_NUM_BOSS 53
#ifdef DXX_BUILD_DESCENT_II
#define ECLIP_NUM_FORCE_FIELD 78
#define ECLIP_NUM_FORCE_FIELD 78 // diagonal force field texture
#define ECLIP_NUM_FORCE_FIELD2 93 // straight force field texture
#endif
struct eclip : public prohibit_void_ptr<eclip>

View file

@ -683,7 +683,11 @@ void render_object(grs_canvas &canvas, const d_level_unique_light_state &LevelUn
break;
case RT_WEAPON_VCLIP:
if (PlayerCfg.AlphaBlendWeapons && !is_proximity_bomb_or_smart_mine(get_weapon_id(obj))) // set nice transparency/blending for certain objects
if (PlayerCfg.AlphaBlendWeapons && (!is_proximity_bomb_or_smart_mine(get_weapon_id(obj))
#if defined(DXX_BUILD_DESCENT_II)
&& get_weapon_id(obj) != ROBOT_SUPERPROX_ID // superprox dropped by robots have their own ID not considered by is_proximity_bomb_or_smart_mine() and since that function is used in many other places, I didn't feel safe to add this weapon type in it
#endif
)) // set nice transparency/blending for certain objects
{
alpha = true;
gr_settransblend(canvas, 7, GR_BLEND_ADDITIVE_A);

View file

@ -207,7 +207,7 @@ void flash_frame()
static inline int is_alphablend_eclip(int eclip_num)
{
#if defined(DXX_BUILD_DESCENT_II)
if (eclip_num == ECLIP_NUM_FORCE_FIELD)
if (eclip_num == ECLIP_NUM_FORCE_FIELD || eclip_num == ECLIP_NUM_FORCE_FIELD2)
return 1;
#endif
return eclip_num == ECLIP_NUM_FUELCEN;