Skip to content

Commit

Permalink
- use spritedef indices in the panel code instead of tilenums.
Browse files Browse the repository at this point in the history
It doesn't use frames yet, but for the stock items those are not needed and can be handled later.
This also will need some reworking for the substitution logic once things get externalized.
  • Loading branch information
coelckers committed May 29, 2023
1 parent 2411ee8 commit de5ef2b
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 143 deletions.
11 changes: 10 additions & 1 deletion source/core/states.h
Expand Up @@ -58,12 +58,21 @@ struct FSpriteDef
uint8_t numframes;
uint16_t spriteframes;

FTextureID GetSpriteFrame(int frame, int rot, DAngle ang, bool* mirror, bool flipagain = false);
//FTextureID GetSpriteFrame(int frame, int rot, DAngle ang, bool* mirror, bool flipagain = false);
FTextureID GetSpriteFrame(unsigned frame);
};

extern TArray<FSpriteFrame> SpriteFrames;
extern TArray<FSpriteDef> SpriteDefs;

inline FTextureID FSpriteDef::GetSpriteFrame(unsigned frame)
{
if (frame >= numframes) return FNullTextureID();
auto f = &SpriteFrames[spriteframes + frame];
return f->Texture[0];
}


enum EStateDefineFlags
{
SDF_NEXT = 0,
Expand Down
24 changes: 12 additions & 12 deletions source/games/sw/src/conpic.h
Expand Up @@ -57,20 +57,14 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#define FIST_SWING2 4073


#define BLOODYFIST_REST 4074
#define BLOODYFIST_SWING0 4075
#define BLOODYFIST_SWING1 4076
#define BLOODYFIST_SWING2 4077
#define BLOODYFIST_REST 4077
#define BLOODYFIST_SWING0 4074
#define BLOODYFIST_SWING1 4075
#define BLOODYFIST_SWING2 4076

#define FIST2_REST 4050
#define FIST2_SWING0 4051
#define FIST2_SWING1 4052
#define FIST2_SWING2 4053

#define BLOODYFIST2_REST 4054
#define BLOODYFIST2_SWING0 4055
#define BLOODYFIST2_SWING1 4056
#define BLOODYFIST2_SWING2 4057
#define BLOODYFIST2_REST 4051

#define FIST2_SWING_ALT 4058

#define FIST3_REST 4060
Expand Down Expand Up @@ -155,6 +149,11 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#define SHOTGUN_RELOAD1 2211
#define SHOTGUN_RELOAD2 2212

#define SHOTGUN2_REST 2227
#define SHOTGUN2_RELOAD0 2227
#define SHOTGUN2_RELOAD1 2226
#define SHOTGUN2_RELOAD2 2225

#define SHOTGUN_SHELL0 2180
#define SHOTGUN_SHELL1 2181
#define SHOTGUN_SHELL2 2182
Expand Down Expand Up @@ -286,3 +285,4 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms




18 changes: 18 additions & 0 deletions source/games/sw/src/namelist.h
Expand Up @@ -735,3 +735,21 @@ x(NINJA_DEAD, 4226)
x(NINJA_HARAKIRI_DEAD, 4218)
x(NINJA_DEAD1, 4226)
x(PLAYER_NINJA_DEAD, 1160)

x(UZI_COPEN, 2040)
x(UZI_CCLOSED, 2041)
x(UZI_CLIT, 2042)
x(UZI_CRELOAD, 2043)
x(SHOTGUN_AUTO, 2078)
x(HEAD_MODE1, 2055)
x(HEAD_MODE2, 2056)
x(HEAD_MODE3, 2057)
x(MICRO_SIGHT, 2075)
x(MICRO_SHOT_20, 2076)
x(MICRO_SHOT_1, 2077)
x(MICRO_HEAT0, 2084)
x(MICRO_HEAT1, 2085)
x(MICRO_HEAT2, 2086)
x(MICRO_HEAT3, 2087)
x(MICRO_HEAT4, 2088)
x(MICRO_HEAT5, 2089)

0 comments on commit de5ef2b

Please sign in to comment.