mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-25 21:41:55 +00:00
- use texture names for the panel overlays.
This commit is contained in:
parent
bf8cdad155
commit
7bf3c57d5d
5 changed files with 34 additions and 30 deletions
|
@ -58,7 +58,6 @@ struct FSpriteDef
|
|||
uint8_t numframes;
|
||||
uint16_t spriteframes;
|
||||
|
||||
FTextureID GetSpriteFrame(int frame, int rot, DAngle ang, bool* mirror, bool flipagain = false);
|
||||
};
|
||||
|
||||
extern TArray<FSpriteFrame> SpriteFrames;
|
||||
|
|
|
@ -136,6 +136,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
|
||||
|
|
|
@ -1883,13 +1883,13 @@ void pUziOverlays(DPanelSprite* psp, short mode)
|
|||
switch (mode)
|
||||
{
|
||||
case 0: // At rest
|
||||
psp->over[0].pic = UZI_COPEN;
|
||||
psp->over[0].pic = TexMan.CheckForTexture("UZI_COPEN", ETextureType::Any);
|
||||
break;
|
||||
case 1: // Firing
|
||||
psp->over[0].pic = UZI_CLIT;
|
||||
psp->over[0].pic = TexMan.CheckForTexture("UZI_CLIT", ETextureType::Any);
|
||||
break;
|
||||
case 2: // Reloading
|
||||
psp->over[0].pic = UZI_CRELOAD;
|
||||
psp->over[0].pic = TexMan.CheckForTexture("UZI_CRELOAD", ETextureType::Any);
|
||||
psp->over[0].xoff = UZI_CHAMBERRELOAD_XOFF;
|
||||
psp->over[0].yoff = UZI_CHAMBERRELOAD_YOFF;
|
||||
break;
|
||||
|
@ -3146,11 +3146,11 @@ bool pShotgunOverlays(DPanelSprite* psp)
|
|||
switch (psp->PlayerP->WpnShotgunType)
|
||||
{
|
||||
case 0:
|
||||
psp->over[SHOTGUN_AUTO_NUM].pic = -1;
|
||||
psp->over[SHOTGUN_AUTO_NUM].pic = FNullTextureID();
|
||||
psp->over[SHOTGUN_AUTO_NUM].flags |= (psf_ShadeNone);
|
||||
return false;
|
||||
case 1:
|
||||
psp->over[SHOTGUN_AUTO_NUM].pic = SHOTGUN_AUTO;
|
||||
psp->over[SHOTGUN_AUTO_NUM].pic = TexMan.CheckForTexture("SHOTGUN_AUTO", ETextureType::Any);
|
||||
psp->over[SHOTGUN_AUTO_NUM].flags |= (psf_ShadeNone);
|
||||
return false;
|
||||
}
|
||||
|
@ -3953,13 +3953,13 @@ void pHotHeadOverlays(DPanelSprite* psp, short mode)
|
|||
switch (mode)
|
||||
{
|
||||
case 0: // Great balls o' fire
|
||||
psp->over[0].pic = HEAD_MODE1;
|
||||
psp->over[0].pic = TexMan.CheckForTexture("HEAD_MODE1", ETextureType::Any);
|
||||
break;
|
||||
case 1: // Ring of fire
|
||||
psp->over[0].pic = HEAD_MODE2;
|
||||
psp->over[0].pic = TexMan.CheckForTexture("HEAD_MODE2", ETextureType::Any);
|
||||
break;
|
||||
case 2: // I love the smell of napalm in the morning
|
||||
psp->over[0].pic = HEAD_MODE3;
|
||||
psp->over[0].pic = TexMan.CheckForTexture("HEAD_MODE3", ETextureType::Any);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -4668,36 +4668,38 @@ bool pMicroOverlays(DPanelSprite* psp)
|
|||
switch (psp->PlayerP->WpnRocketType)
|
||||
{
|
||||
case 0:
|
||||
psp->over[MICRO_SIGHT_NUM].pic = MICRO_SIGHT;
|
||||
psp->over[MICRO_SHOT_NUM].pic = MICRO_SHOT_1;
|
||||
psp->over[MICRO_SIGHT_NUM].pic = TexMan.CheckForTexture("MICRO_SIGHT", ETextureType::Any);
|
||||
psp->over[MICRO_SHOT_NUM].pic = TexMan.CheckForTexture("MICRO_SHOT_1", ETextureType::Any);
|
||||
psp->over[MICRO_SHOT_NUM].flags |= (psf_ShadeNone);
|
||||
psp->over[MICRO_HEAT_NUM].pic = -1;
|
||||
psp->over[MICRO_HEAT_NUM].pic = FNullTextureID();
|
||||
return false;
|
||||
case 1:
|
||||
if (psp->PlayerP->WpnRocketHeat)
|
||||
{
|
||||
psp->over[MICRO_SIGHT_NUM].pic = MICRO_SIGHT;
|
||||
psp->over[MICRO_SHOT_NUM].pic = MICRO_SHOT_1;
|
||||
psp->over[MICRO_SIGHT_NUM].pic = TexMan.CheckForTexture("MICRO_SIGHT", ETextureType::Any);
|
||||
psp->over[MICRO_SHOT_NUM].pic = TexMan.CheckForTexture("MICRO_SHOT_1", ETextureType::Any);
|
||||
psp->over[MICRO_SHOT_NUM].flags |= (psf_ShadeNone);
|
||||
|
||||
ASSERT(psp->PlayerP->WpnRocketHeat < 6);
|
||||
|
||||
psp->over[MICRO_HEAT_NUM].pic = MICRO_HEAT + (5 - psp->PlayerP->WpnRocketHeat);
|
||||
if (psp->PlayerP->WpnRocketHeat < 6)
|
||||
{
|
||||
static const char* heats[] = { "MICRO_HEAT0", "MICRO_HEAT1", "MICRO_HEAT2", "MICRO_HEAT3", "MICRO_HEAT4", "MICRO_HEAT5" };
|
||||
psp->over[MICRO_HEAT_NUM].pic = TexMan.CheckForTexture(heats[5 - psp->PlayerP->WpnRocketHeat], ETextureType::Any);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
psp->over[MICRO_SIGHT_NUM].pic = MICRO_SIGHT;
|
||||
psp->over[MICRO_SHOT_NUM].pic = MICRO_SHOT_1;
|
||||
psp->over[MICRO_SIGHT_NUM].pic = TexMan.CheckForTexture("MICRO_SIGHT", ETextureType::Any);
|
||||
psp->over[MICRO_SHOT_NUM].pic = TexMan.CheckForTexture("MICRO_SHOT_1", ETextureType::Any);
|
||||
psp->over[MICRO_SHOT_NUM].flags |= (psf_ShadeNone);
|
||||
psp->over[MICRO_HEAT_NUM].pic = -1;
|
||||
psp->over[MICRO_HEAT_NUM].pic = FNullTextureID();
|
||||
}
|
||||
|
||||
return false;
|
||||
case 2:
|
||||
psp->over[MICRO_SIGHT_NUM].pic = -1;
|
||||
psp->over[MICRO_HEAT_NUM].pic = -1;
|
||||
psp->over[MICRO_SIGHT_NUM].pic = FNullTextureID();
|
||||
psp->over[MICRO_HEAT_NUM].pic = FNullTextureID();
|
||||
|
||||
psp->over[MICRO_SHOT_NUM].pic = MICRO_SHOT_20;
|
||||
psp->over[MICRO_SHOT_NUM].pic = TexMan.CheckForTexture("MICRO_SHOT_20", ETextureType::Any);
|
||||
psp->over[MICRO_SHOT_NUM].flags |= (psf_ShadeNone);
|
||||
psp->over[MICRO_HEAT_NUM].flags |= (psf_ShadeNone);
|
||||
return true;
|
||||
|
@ -7254,7 +7256,7 @@ DPanelSprite* pSpawnSprite(DSWPlayer* pp, PANEL_STATE* state, uint8_t priority,
|
|||
for (i = 0; i < SIZ(psp->over); i++)
|
||||
{
|
||||
psp->over[i].State = nullptr;
|
||||
psp->over[i].pic = -1;
|
||||
psp->over[i].pic = FNullTextureID();
|
||||
psp->over[i].xoff = -1;
|
||||
psp->over[i].yoff = -1;
|
||||
}
|
||||
|
@ -7532,13 +7534,14 @@ void pDisplaySprites(DSWPlayer* pp, double interpfrac)
|
|||
// do overlays (if any)
|
||||
for (i = 0; i < SIZ(psp->over); i++)
|
||||
{
|
||||
FTextureID tex;
|
||||
// get pic from state
|
||||
if (psp->over[i].State)
|
||||
texnum = GetTextureFromSprite(psp->over[i].State->Sprite, 0);
|
||||
else
|
||||
// get pic from over variable
|
||||
if (psp->over[i].pic >= 0)
|
||||
texnum = tileGetTextureID(psp->over[i].pic);
|
||||
if (psp->over[i].pic.Exists())
|
||||
texnum = psp->over[i].pic;
|
||||
else
|
||||
continue;
|
||||
|
||||
|
|
|
@ -99,8 +99,8 @@ struct PANEL_SPRITE_OVERLAY
|
|||
{
|
||||
PANEL_STATE* State;
|
||||
int flags;
|
||||
FTextureID pic;
|
||||
short tics;
|
||||
short pic;
|
||||
short xoff; // from panel sprite center x
|
||||
short yoff; // from panel sprite center y
|
||||
};
|
||||
|
|
|
@ -436,9 +436,6 @@ x(BLOODYFIST_SWING0)
|
|||
x(BLOODYFIST_SWING1)
|
||||
x(BLOODYFIST_SWING2)
|
||||
x(FIST2_REST)
|
||||
x(FIST2_SWING0)
|
||||
x(FIST2_SWING1)
|
||||
x(FIST2_SWING2)
|
||||
x(FIST2_SWING_ALT)
|
||||
x(FIST3_REST)
|
||||
x(FIST3_SWING0)
|
||||
|
|
Loading…
Reference in a new issue