mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-31 13:10:39 +00:00
getwalldist() tweak
git-svn-id: https://svn.eduke32.com/eduke32@7878 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
db85a55dfd
commit
95598e08f9
2 changed files with 11 additions and 4 deletions
|
@ -525,6 +525,9 @@ static inline void inplace_vx_tweak_wall(walltypevx *vxwal, int32_t yaxp)
|
||||||
|
|
||||||
#include "clip.h"
|
#include "clip.h"
|
||||||
|
|
||||||
|
int32_t getwalldist(vec2_t const &in, int const wallnum);
|
||||||
|
int32_t getwalldist(vec2_t const &in, int const wallnum, vec2_t * const out);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
@ -1189,7 +1192,6 @@ void updatesectorneighborz(int32_t const x, int32_t const y, int32_t const z, in
|
||||||
|
|
||||||
int findwallbetweensectors(int sect1, int sect2);
|
int findwallbetweensectors(int sect1, int sect2);
|
||||||
static FORCE_INLINE bool sectoradjacent(int sect1, int sect2) { return findwallbetweensectors(sect1, sect2) != -1; }
|
static FORCE_INLINE bool sectoradjacent(int sect1, int sect2) { return findwallbetweensectors(sect1, sect2) != -1; }
|
||||||
int32_t getwalldist(vec2_t const &in, int const wallnum, vec2_t * const out = nullptr);
|
|
||||||
int32_t getsectordist(vec2_t const &in, int const sectnum, vec2_t * const out = nullptr);
|
int32_t getsectordist(vec2_t const &in, int const sectnum, vec2_t * const out = nullptr);
|
||||||
extern const int16_t *chsecptr_onextwall;
|
extern const int16_t *chsecptr_onextwall;
|
||||||
int32_t checksectorpointer(int16_t i, int16_t sectnum);
|
int32_t checksectorpointer(int16_t i, int16_t sectnum);
|
||||||
|
|
|
@ -11402,15 +11402,20 @@ static inline bool inside_z_p(int32_t const x, int32_t const y, int32_t const z,
|
||||||
return (z >= cz && z <= fz && inside_p(x, y, sectnum));
|
return (z >= cz && z <= fz && inside_p(x, y, sectnum));
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t getwalldist(vec2_t const &in, int const wallnum, vec2_t * const out /*= nullptr*/)
|
int32_t getwalldist(vec2_t const &in, int const wallnum)
|
||||||
{
|
{
|
||||||
vec2_t closest;
|
vec2_t closest;
|
||||||
getclosestpointonwall_internal(in, wallnum, &closest);
|
getclosestpointonwall_internal(in, wallnum, &closest);
|
||||||
if (out)
|
|
||||||
*out = closest;
|
|
||||||
return klabs(closest.x - in.x) + klabs(closest.y - in.y);
|
return klabs(closest.x - in.x) + klabs(closest.y - in.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t getwalldist(vec2_t const &in, int const wallnum, vec2_t * const out)
|
||||||
|
{
|
||||||
|
getclosestpointonwall_internal(in, wallnum, out);
|
||||||
|
return klabs(out->x - in.x) + klabs(out->y - in.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int32_t getsectordist(vec2_t const &in, int const sectnum, vec2_t * const out /*= nullptr*/)
|
int32_t getsectordist(vec2_t const &in, int const sectnum, vec2_t * const out /*= nullptr*/)
|
||||||
{
|
{
|
||||||
if (inside_p(in.x, in.y, sectnum))
|
if (inside_p(in.x, in.y, sectnum))
|
||||||
|
|
Loading…
Reference in a new issue