From de6b5fec7b231cd1384f2ba6d281e30015e13ce3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 20 May 2023 10:58:43 +0200 Subject: [PATCH] - got rid of some 'picnum's that don't reference spritetype. --- source/core/actorinfo.cpp | 2 +- source/core/gamefuncs.cpp | 2 +- source/games/duke/src/hudweapon_d.cpp | 11 ----------- wadsrc/static/zscript/alt_hud.zs | 8 ++++---- wadsrc/static/zscript/coreactor.zs | 1 - .../zscript/games/duke/actors/dukecstuff/scrap.zs | 2 +- wadsrc/static/zscript/games/duke/dukeactor.zs | 2 +- wadsrc/static/zscript/level_compatibility.zs | 2 +- wadsrc/static/zscript/maptypes.zs | 1 - 9 files changed, 9 insertions(+), 22 deletions(-) diff --git a/source/core/actorinfo.cpp b/source/core/actorinfo.cpp index 1c8da9dc0..7e1b6e556 100644 --- a/source/core/actorinfo.cpp +++ b/source/core/actorinfo.cpp @@ -256,7 +256,7 @@ void FActorInfo::ResolveTextures(const char* clsname, DCoreActor* defaults) if (SpriteSet.Size() > 0) { if (defaults->spritesetindex < 0 || defaults->spritesetindex >= (int)SpriteSet.Size()) defaults->spritesetindex = 0; - defaults->spr.setspritetexture(SpriteSet[defaults->spritesetindex]); // Unless picnum is specified it will be set to the given image of the sprite set. + defaults->spr.setspritetexture(SpriteSet[defaults->spritesetindex]); } SpriteSetNames.Reset(); } diff --git a/source/core/gamefuncs.cpp b/source/core/gamefuncs.cpp index a6cc79696..e3389497d 100644 --- a/source/core/gamefuncs.cpp +++ b/source/core/gamefuncs.cpp @@ -1322,7 +1322,7 @@ tspritetype* renderAddTsprite(tspriteArray& tsprites, DCoreActor* actor) tspr->pos = actor->spr.pos; tspr->cstat = actor->spr.cstat; - tspr->picnum = actor->spr.picnum; + tspr->setspritetexture(actor->spr.spritetexture()); tspr->shade = actor->spr.shade; tspr->pal = actor->spr.pal; tspr->clipdist = 0; diff --git a/source/games/duke/src/hudweapon_d.cpp b/source/games/duke/src/hudweapon_d.cpp index 381a27ede..8670940e0 100644 --- a/source/games/duke/src/hudweapon_d.cpp +++ b/source/games/duke/src/hudweapon_d.cpp @@ -50,17 +50,6 @@ inline static double getavel(int snum) // //--------------------------------------------------------------------------- -inline static void hud_drawpal(double x, double y, int tilenum, int shade, int orientation, int p, DAngle angle) -{ - hud_drawsprite(x, y, 65536, angle.Degrees(), tilenum, shade, p, orientation); -} - -//--------------------------------------------------------------------------- -// -// -// -//--------------------------------------------------------------------------- - inline static void hud_drawpal(double x, double y, const char* tilenum, int shade, int orientation, int p, DAngle angle) { hud_drawsprite(x, y, 1., angle.Degrees(), TexMan.CheckForTexture(tilenum, ETextureType::Any), shade, p, orientation); diff --git a/wadsrc/static/zscript/alt_hud.zs b/wadsrc/static/zscript/alt_hud.zs index 4976d3bad..d7060a6ff 100644 --- a/wadsrc/static/zscript/alt_hud.zs +++ b/wadsrc/static/zscript/alt_hud.zs @@ -463,13 +463,13 @@ class AltHud ui { double trans = weapon == currentstats.weaponselect? 0.85 : 0.4; - TextureID picnum = TexMan.CheckForTexture(currentstats.weaponicons[weapon]); + TextureID texid = TexMan.CheckForTexture(currentstats.weaponicons[weapon]); - if (picnum.isValid()) + if (texid.isValid()) { // don't draw tall sprites too small. int w, h; - [w, h] = TexMan.GetSize(picnum); + [w, h] = TexMan.GetSize(texid); int rh; if (w > h) rh = 8; else @@ -477,7 +477,7 @@ class AltHud ui rh = 16; y -= 8; } - DrawImageToBox(picnum, x-24, y, 20, rh, trans); + DrawImageToBox(texid, x-24, y, 20, rh, trans); y-=10; } } diff --git a/wadsrc/static/zscript/coreactor.zs b/wadsrc/static/zscript/coreactor.zs index f88cf75da..8e94db46c 100644 --- a/wadsrc/static/zscript/coreactor.zs +++ b/wadsrc/static/zscript/coreactor.zs @@ -25,7 +25,6 @@ class CoreActor native native sectortype sector; // cannot be read-only, some code calls clipmove directly on this. native int16 cstat; - //native int16 picnum; // access is disabled to allow later refactoring. native Vector3 pos; native Vector3 opos; native readonly int16 statnum; diff --git a/wadsrc/static/zscript/games/duke/actors/dukecstuff/scrap.zs b/wadsrc/static/zscript/games/duke/actors/dukecstuff/scrap.zs index a47e9206b..6b3bc11c4 100644 --- a/wadsrc/static/zscript/games/duke/actors/dukecstuff/scrap.zs +++ b/wadsrc/static/zscript/games/duke/actors/dukecstuff/scrap.zs @@ -83,7 +83,7 @@ class DukeScrap : DukeActor { if (self.spriteextra == Scrap1 && self.yint > 0) { - tspr.setWeaponOrAmmoSprite(self.yint - 1); // needed so that we don't have to export 'picnum' to scripting. + tspr.setWeaponOrAmmoSprite(self.yint - 1); // needed so that we don't have to export 'pic num' to scripting. } else { diff --git a/wadsrc/static/zscript/games/duke/dukeactor.zs b/wadsrc/static/zscript/games/duke/dukeactor.zs index d753c7d22..6589abb24 100644 --- a/wadsrc/static/zscript/games/duke/dukeactor.zs +++ b/wadsrc/static/zscript/games/duke/dukeactor.zs @@ -331,7 +331,7 @@ class DukeActor : CoreActor native native bool CheckAnyActorSoundPlaying(); native void StopSound(Sound snd, int flags = 0); native DukeActor spawn(class type); - native DukeActor spawnsprite(int type); // for cases where the map has a picnum stored. Avoid when possible. + native DukeActor spawnsprite(int type); // for cases where the map has a tilenum stored. Avoid when possible. native void lotsofglass(int count, walltype wal = null); native void lotsofcolourglass(int count, walltype wal = null); native void makeitfall(); diff --git a/wadsrc/static/zscript/level_compatibility.zs b/wadsrc/static/zscript/level_compatibility.zs index 13ecda6f5..f537ab386 100644 --- a/wadsrc/static/zscript/level_compatibility.zs +++ b/wadsrc/static/zscript/level_compatibility.zs @@ -27,7 +27,7 @@ class LevelCompatibility : LevelPostProcessor break; case 'd7bf49213531cd2607e0459b950ac454': // RR E2L7.map - // need to add a sprite with picnum 11 (RRJAILDOOR) lotag = 48, hitag = 32, sector = 534 + // need to add a sprite with texture (RRJAILDOOR) lotag = 48, hitag = 32, sector = 534 // see premap_r.cpp, line 477. break; diff --git a/wadsrc/static/zscript/maptypes.zs b/wadsrc/static/zscript/maptypes.zs index 5f7c22d8c..a86afb4b3 100644 --- a/wadsrc/static/zscript/maptypes.zs +++ b/wadsrc/static/zscript/maptypes.zs @@ -319,7 +319,6 @@ struct tspritetype native native double angle; native sectortype sector; native int16 cstat; - //native int16 picnum; native int16 statnum; //native int16 ang; /* these are not needed for tsprites