Move WALL_IS_DOORWAY out of line
Writing it inline causes wall.h to depend on segment.h.
This commit is contained in:
parent
fa654324ad
commit
a9a9d1f26a
|
@ -217,7 +217,7 @@ void wall_init();
|
||||||
// Automatically checks if a there is a doorway (i.e. can fly through)
|
// Automatically checks if a there is a doorway (i.e. can fly through)
|
||||||
#ifdef dsx
|
#ifdef dsx
|
||||||
namespace dsx {
|
namespace dsx {
|
||||||
WALL_IS_DOORWAY_result_t wall_is_doorway(const GameBitmaps_array &GameBitmaps, const Textures_array &Textures, fvcwallptr &vcwallptr, const shared_side &sside, const unique_side &uside);
|
WALL_IS_DOORWAY_result_t WALL_IS_DOORWAY(const GameBitmaps_array &GameBitmaps, const Textures_array &Textures, fvcwallptr &vcwallptr, const shared_segment &sseg, const unique_segment &useg, const uint_fast32_t side);
|
||||||
|
|
||||||
// Deteriorate appearance of wall. (Changes bitmap (paste-ons))
|
// Deteriorate appearance of wall. (Changes bitmap (paste-ons))
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,12 +24,13 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "segment.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
#include "fwd-segment.h"
|
||||||
#include "fwd-wall.h"
|
#include "fwd-wall.h"
|
||||||
#include "fwd-object.h"
|
#include "fwd-object.h"
|
||||||
#include "pack.h"
|
#include "pack.h"
|
||||||
|
#include "valptridx.h"
|
||||||
|
|
||||||
namespace dcx {
|
namespace dcx {
|
||||||
|
|
||||||
|
@ -210,19 +211,6 @@ struct wclip : public prohibit_void_ptr<wclip>
|
||||||
|
|
||||||
constexpr std::integral_constant<uint16_t, 0xffff> wclip_frames_none{};
|
constexpr std::integral_constant<uint16_t, 0xffff> wclip_frames_none{};
|
||||||
|
|
||||||
static inline WALL_IS_DOORWAY_result_t WALL_IS_DOORWAY(const GameBitmaps_array &GameBitmaps, const Textures_array &Textures, fvcwallptr &vcwallptr, const shared_segment &sseg, const unique_segment &useg, const uint_fast32_t side)
|
|
||||||
{
|
|
||||||
const auto child = sseg.children[side];
|
|
||||||
if (unlikely(child == segment_none))
|
|
||||||
return WID_WALL;
|
|
||||||
if (unlikely(child == segment_exit))
|
|
||||||
return WID_EXTERNAL;
|
|
||||||
auto &sside = sseg.sides[side];
|
|
||||||
if (likely(sside.wall_num == wall_none))
|
|
||||||
return WID_NO_WALL;
|
|
||||||
auto &uside = useg.sides[side];
|
|
||||||
return wall_is_doorway(GameBitmaps, Textures, vcwallptr, sside, uside);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -165,7 +165,7 @@ static uint_fast32_t check_transparency(const GameBitmaps_array &GameBitmaps, co
|
||||||
// WID_NO_WALL 5 // 1/0/1 no wall, can fly through
|
// WID_NO_WALL 5 // 1/0/1 no wall, can fly through
|
||||||
namespace dsx {
|
namespace dsx {
|
||||||
|
|
||||||
WALL_IS_DOORWAY_result_t wall_is_doorway(const GameBitmaps_array &GameBitmaps, const Textures_array &Textures, fvcwallptr &vcwallptr, const shared_side &sside, const unique_side &uside)
|
static WALL_IS_DOORWAY_result_t wall_is_doorway(const GameBitmaps_array &GameBitmaps, const Textures_array &Textures, fvcwallptr &vcwallptr, const shared_side &sside, const unique_side &uside)
|
||||||
{
|
{
|
||||||
auto &w = *vcwallptr(sside.wall_num);
|
auto &w = *vcwallptr(sside.wall_num);
|
||||||
const auto type = w.type;
|
const auto type = w.type;
|
||||||
|
@ -206,6 +206,21 @@ WALL_IS_DOORWAY_result_t wall_is_doorway(const GameBitmaps_array &GameBitmaps, c
|
||||||
else
|
else
|
||||||
return WID_WALL; // There are children behind the door.
|
return WID_WALL; // There are children behind the door.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WALL_IS_DOORWAY_result_t WALL_IS_DOORWAY(const GameBitmaps_array &GameBitmaps, const Textures_array &Textures, fvcwallptr &vcwallptr, const shared_segment &sseg, const unique_segment &useg, const uint_fast32_t side)
|
||||||
|
{
|
||||||
|
const auto child = sseg.children[side];
|
||||||
|
if (unlikely(child == segment_none))
|
||||||
|
return WID_WALL;
|
||||||
|
if (unlikely(child == segment_exit))
|
||||||
|
return WID_EXTERNAL;
|
||||||
|
auto &sside = sseg.sides[side];
|
||||||
|
if (likely(sside.wall_num == wall_none))
|
||||||
|
return WID_NO_WALL;
|
||||||
|
auto &uside = useg.sides[side];
|
||||||
|
return wall_is_doorway(GameBitmaps, Textures, vcwallptr, sside, uside);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DXX_USE_EDITOR
|
#if DXX_USE_EDITOR
|
||||||
|
@ -1396,6 +1411,7 @@ void d_level_unique_stuck_object_state::kill_stuck_objects(fvmobjptr &vmobjptr,
|
||||||
DXX_POISON_VAR(empty, 0xcc);
|
DXX_POISON_VAR(empty, 0xcc);
|
||||||
std::fill(i, pr.end(), empty[0]);
|
std::fill(i, pr.end(), empty[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace dcx {
|
namespace dcx {
|
||||||
|
|
Loading…
Reference in a new issue