diff --git a/source/core/gamefuncs.cpp b/source/core/gamefuncs.cpp index 5941ddc0b..fc3a22afc 100644 --- a/source/core/gamefuncs.cpp +++ b/source/core/gamefuncs.cpp @@ -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); diff --git a/source/core/vmexports.cpp b/source/core/vmexports.cpp index 25bfec557..6d9b64319 100644 --- a/source/core/vmexports.cpp +++ b/source/core/vmexports.cpp @@ -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)