mirror of
https://github.com/ZDoom/Raze.git
synced 2024-12-15 15:11:41 +00:00
99 lines
3.4 KiB
C
99 lines
3.4 KiB
C
//-------------------------------------------------------------------------
|
|
/*
|
|
Copyright (C) 2010-2019 EDuke32 developers and contributors
|
|
Copyright (C) 2019 Nuke.YKT
|
|
|
|
This file is part of NBlood.
|
|
|
|
NBlood is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public License version 2
|
|
as published by the Free Software Foundation.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
*/
|
|
//-------------------------------------------------------------------------
|
|
#pragma once
|
|
#include "build.h"
|
|
#include "common_game.h"
|
|
|
|
BEGIN_BLD_NS
|
|
|
|
struct HITINFO {
|
|
DBloodActor* hitactor;
|
|
sectortype* hitSect;
|
|
walltype* hitWall;
|
|
int hitx;
|
|
int hity;
|
|
int hitz;
|
|
|
|
void clearObj()
|
|
{
|
|
hitSect = nullptr;
|
|
hitWall = nullptr;
|
|
hitactor = nullptr;
|
|
}
|
|
void set(hitdata_t* hit);
|
|
};
|
|
|
|
extern HITINFO gHitInfo;
|
|
|
|
enum {
|
|
PARALLAXCLIP_CEILING = 1,
|
|
PARALLAXCLIP_FLOOR = 2,
|
|
};
|
|
|
|
|
|
struct Collision;
|
|
bool FindSector(int nX, int nY, int nZ, int *nSector);
|
|
inline bool FindSector(int nX, int nY, int nZ, sectortype** ppSector)
|
|
{
|
|
int n = sectnum(*ppSector);
|
|
bool res = FindSector(nX, nY, nZ, &n);
|
|
*ppSector = §or[n];
|
|
return res;
|
|
}
|
|
bool FindSector(int nX, int nY, int *nSector);
|
|
inline bool FindSector(int nX, int nY, sectortype** ppSector)
|
|
{
|
|
int n = sectnum(*ppSector);
|
|
bool res = FindSector(nX, nY, &n);
|
|
*ppSector = §or[n];
|
|
return res;
|
|
}
|
|
|
|
[[deprecated]]
|
|
bool FindSector(int nX, int nY, int nZ, int* nSector);
|
|
[[deprecated]]
|
|
bool FindSector(int nX, int nY, int* nSector);
|
|
|
|
bool CheckProximity(DBloodActor *pSprite, int nX, int nY, int nZ, int nSector, int nDist);
|
|
bool CheckProximityPoint(int nX1, int nY1, int nZ1, int nX2, int nY2, int nZ2, int nDist);
|
|
bool CheckProximityWall(walltype* pWall, int x, int y, int nDist);
|
|
int GetWallAngle(walltype* pWall);
|
|
void GetWallNormal(walltype* pWall, int *pX, int *pY);
|
|
bool IntersectRay(int wx, int wy, int wdx, int wdy, int x1, int y1, int z1, int x2, int y2, int z2, int *ix, int *iy, int *iz);
|
|
int HitScan(DBloodActor *pSprite, int z, int dx, int dy, int dz, unsigned int nMask, int a8);
|
|
int VectorScan(DBloodActor *pSprite, int nOffset, int nZOffset, int dx, int dy, int dz, int nRange, int ac);
|
|
void GetZRange(DBloodActor *pSprite, int *ceilZ, Collision *ceilHit, int *floorZ, Collision *floorHit, int nDist, unsigned int nMask, unsigned int nClipParallax = 0);
|
|
void GetZRangeAtXYZ(int x, int y, int z, sectortype* pSector, int *ceilZ, Collision *ceilHit, int *floorZ, Collision *floorHit, int nDist, unsigned int nMask, unsigned int nClipParallax = 0);
|
|
int GetDistToLine(int x1, int y1, int x2, int y2, int x3, int y3);
|
|
unsigned int ClipMove(vec3_t* pos, sectortype** pSector, int xv, int yv, int wd, int cd, int fd, unsigned int nMask, int tracecount = 3);
|
|
BitArray GetClosestSpriteSectors(sectortype* pSector, int x, int y, int nDist, TArray<walltype*>* pWalls, bool newSectCheckMethod = false);
|
|
int picWidth(int nPic, int repeat);
|
|
int picHeight(int nPic, int repeat);
|
|
|
|
inline bool CheckSector(const BitArray& bits, spritetype* spr)
|
|
{
|
|
return bits[spr->sectnum];
|
|
}
|
|
|
|
|
|
END_BLD_NS
|