- using texture IDs in a few more places where it is simple.

This commit is contained in:
Christoph Oelckers 2022-12-06 09:49:18 +01:00
parent f4bda94dad
commit 868fece7f6
2 changed files with 6 additions and 4 deletions

View file

@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "intvec.h"
#include "coreactor.h"
#include "interpolate.h"
#include "texturemanager.h"
#include "hw_voxels.h"
IntRect viewport3d;
@ -201,7 +202,7 @@ double SquareDistToSector(double px, double py, const sectortype* sect, DVector2
void GetWallSpritePosition(const spritetypebase* spr, const DVector2& pos, DVector2* out, bool render)
{
auto tex = tileGetTexture(spr->picnum);
auto tex = TexMan.GetGameTexture(spr->spritetexture());
double width, xoffset;
if (render && hw_hightile && TileFiles.tiledata[spr->picnum].hiofs.xsize)
@ -233,7 +234,7 @@ void GetWallSpritePosition(const spritetypebase* spr, const DVector2& pos, DVect
void TGetFlatSpritePosition(const spritetypebase* spr, const DVector2& pos, DVector2* out, double* outz, int heinum, bool render)
{
auto tex = tileGetTexture(spr->picnum);
auto tex = TexMan.GetGameTexture(spr->spritetexture());
double width, height, leftofs, topofs;
double sloperatio = sqrt(heinum * heinum + SLOPEVAL_FACTOR * SLOPEVAL_FACTOR) * (1. / SLOPEVAL_FACTOR);

View file

@ -37,6 +37,7 @@
#include "vm.h"
#include "gamefuncs.h"
#include "raze_sound.h"
#include "texturemanager.h"
sectortype* Raze_updatesector(double x, double y, sectortype* sec, double dist)
{
@ -477,8 +478,8 @@ int sector_checktexture(sectortype* sec, int place, int intname)
{
if (!sec) ThrowAbortException(X_READ_NIL, nullptr);
int tilenum = TileFiles.tileForName(FName(ENamedName(intname)).GetChars());
return tilenum == (place == 0 ? sec->ceilingpicnum : sec->floorpicnum);
auto tex = TexMan.CheckForTexture(FName(ENamedName(intname)).GetChars(), ETextureType::Any);
return tex == (place == 0 ? sec->ceilingtexture() : sec->floortexture());
}
DEFINE_ACTION_FUNCTION_NATIVE(_sectortype, checktexture, sector_checktexture)