- Added: inventorybarnotvisible to check to see if the inventory bar is up.

- Added the following flags to drawselectedinventory center, centerbottom, and
  drawshadow.
- Fixed: The translucent flag for drawinventorybar should only have affected
  the artibox image.

- Fixed: compatf_limitpain must check for 21 Lost Souls, not 20.


SVN r1297 (trunk)
This commit is contained in:
Christoph Oelckers 2008-11-29 16:37:54 +00:00
parent cbe0c57911
commit 6b9129105a
6 changed files with 74 additions and 30 deletions

View file

@ -1,3 +1,10 @@
November 29, 2008 (sbarinfo update)
- Added: inventorybarnotvisible to check to see if the inventory bar is up.
- Added the following flags to drawselectedinventory center, centerbottom, and
drawshadow.
- Fixed: The translucent flag for drawinventorybar should only have affected
the artibox image.
November 27, 2008
- Removed S_MarkSoundChannels(), as it caused all non-actor sounds to
have their origins zeroed during collections.
@ -14,6 +21,9 @@ November 21, 2008
- Doom's intermission characters are now collected together as a font
so they can be colorized.
November 18, 2008 (Changes by Graf Zahl)
- Fixed: compatf_limitpain must check for 21 Lost Souls, not 20.
November 15, 2008 (Changes by Graf Zahl)
- Moved common code of Raven's fast projectiles into a base class
called FastProjectile. This base class doesn't have any effects attached

View file

@ -56,8 +56,8 @@ void A_PainShootSkull (AActor *self, angle_t angle, const PClass *spawntype)
if (i_compatflags & COMPATF_LIMITPAIN)
{
// count total number of skulls currently on the level
// if there are already 20 skulls on the level, don't spit another one
int count = 20;
// if there are already 21 skulls on the level, don't spit another one
int count = 21;
FThinkerIterator iterator (spawntype);
DThinker *othink;

View file

@ -171,11 +171,13 @@ enum //drawimage flags
DRAWIMAGE_INVULNERABILITY = 0x80,
DRAWIMAGE_OFFSET_CENTER = 0x100,
DRAWIMAGE_OFFSET_CENTERBOTTOM = 0x200,
DRAWIMAGE_ARMOR = 0x400,
DRAWIMAGE_WEAPONICON = 0x800,
DRAWIMAGE_SIGIL = 0x1000,
DRAWIMAGE_KEYSLOT = 0x2000,
DRAWIMAGE_HEXENARMOR = 0x4000,
DRAWIMAGE_ARMOR = 0x800,
DRAWIMAGE_WEAPONICON = 0x1000,
DRAWIMAGE_SIGIL = 0x2000,
DRAWIMAGE_KEYSLOT = 0x4000,
DRAWIMAGE_HEXENARMOR = 0x8000,
DRAWIMAGE_OFFSET = DRAWIMAGE_OFFSET_CENTER|DRAWIMAGE_OFFSET_CENTERBOTTOM,
};
enum //drawnumber flags
@ -212,9 +214,12 @@ enum //drawbar flags (will go into special2)
enum //drawselectedinventory flags
{
DRAWSELECTEDINVENTORY_ALTERNATEONEMPTY = 1,
DRAWSELECTEDINVENTORY_ARTIFLASH = 2,
DRAWSELECTEDINVENTORY_ALWAYSSHOWCOUNTER = 4,
DRAWSELECTEDINVENTORY_ALTERNATEONEMPTY = 0x1,
DRAWSELECTEDINVENTORY_ARTIFLASH = 0x2,
DRAWSELECTEDINVENTORY_ALWAYSSHOWCOUNTER = 0x4,
DRAWSELECTEDINVENTORY_CENTER = 0x8,
DRAWSELECTEDINVENTORY_CENTERBOTTOM = 0x10,
DRAWSELECTEDINVENTORY_DRAWSHADOW = 0x20,
};
enum //drawinventorybar flags
@ -317,6 +322,7 @@ enum //Bar key words
SBARINFO_ISSELECTED,
SBARINFO_USESSECONDARYAMMO,
SBARINFO_HASWEAPONPIECE,
SBARINFO_INVENTORYBARNOTVISIBLE,
SBARINFO_WEAPONAMMO,
SBARINFO_ININVENTORY,
};
@ -356,7 +362,7 @@ private:
void DrawFace(const char *defaultFace, int accuracy, int stateflags, int x, int y, int xOffset, int yOffset, int alpha, bool fullScreenOffsets);
int updateState(bool xdth, bool animatedgodmode);
void DrawInventoryBar(int type, int num, int x, int y, int xOffset, int yOffset, int alpha, bool fullScreenOffsets, bool alwaysshow,
int counterx, int countery, EColorRange translation, bool drawArtiboxes, bool noArrows, bool alwaysshowcounter);
int counterx, int countery, EColorRange translation, bool drawArtiboxes, bool noArrows, bool alwaysshowcounter, int bgalpha);
void DrawGem(FTexture* chain, FTexture* gem, int value, int x, int y, int xOffset, int yOffset, int alpha, bool fullScreenOffsets, int padleft, int padright, int chainsize,
bool wiggle, bool translate);
FRemapTable* getTranslation();

View file

@ -491,11 +491,11 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
if(drawAlt != 0) //draw 'off' image
{
if(cmd.special != -1 && drawAlt == 1)
DrawGraphic(Images[cmd.special], cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, !!(cmd.flags & DRAWIMAGE_TRANSLATABLE), false, !!(cmd.flags & (DRAWIMAGE_OFFSET_CENTER|DRAWIMAGE_OFFSET_CENTERBOTTOM)));
DrawGraphic(Images[cmd.special], cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, !!(cmd.flags & DRAWIMAGE_TRANSLATABLE), false, !!(cmd.flags & DRAWIMAGE_OFFSET));
else if(cmd.special2 != -1 && drawAlt == 2)
DrawGraphic(Images[cmd.special2], cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, !!(cmd.flags & DRAWIMAGE_TRANSLATABLE), false, !!(cmd.flags & (DRAWIMAGE_OFFSET_CENTER|DRAWIMAGE_OFFSET_CENTERBOTTOM)));
DrawGraphic(Images[cmd.special2], cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, !!(cmd.flags & DRAWIMAGE_TRANSLATABLE), false, !!(cmd.flags & DRAWIMAGE_OFFSET));
else if(cmd.special3 != -1 && drawAlt == 3)
DrawGraphic(Images[cmd.special3], cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, !!(cmd.flags & DRAWIMAGE_TRANSLATABLE), false,(cmd.flags & (DRAWIMAGE_OFFSET_CENTER|DRAWIMAGE_OFFSET_CENTERBOTTOM)));
DrawGraphic(Images[cmd.special3], cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, !!(cmd.flags & DRAWIMAGE_TRANSLATABLE), false, (cmd.flags & DRAWIMAGE_OFFSET));
break;
}
}
@ -700,13 +700,15 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
case SBARINFO_DRAWSELECTEDINVENTORY:
if(CPlayer->mo->InvSel != NULL && !(level.flags & LEVEL_NOINVENTORYBAR))
{
int offsetflags = (cmd.flags & DRAWSELECTEDINVENTORY_CENTER) ? DRAWIMAGE_OFFSET_CENTER : 0;
offsetflags |= (cmd.flags & DRAWSELECTEDINVENTORY_CENTERBOTTOM) ? DRAWIMAGE_OFFSET_CENTERBOTTOM : 0;
if((cmd.flags & DRAWSELECTEDINVENTORY_ARTIFLASH) && artiflash)
{
DrawGraphic(Images[ARTIFLASH_OFFSET+(4-artiflash)], cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, false, CPlayer->mo->InvSel->Amount <= 0);
DrawGraphic(Images[ARTIFLASH_OFFSET+(4-artiflash)], cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, false, CPlayer->mo->InvSel->Amount <= 0, offsetflags);
}
else
{
DrawGraphic(TexMan(CPlayer->mo->InvSel->Icon), cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, false, CPlayer->mo->InvSel->Amount <= 0);
DrawGraphic(TexMan(CPlayer->mo->InvSel->Icon), cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, false, CPlayer->mo->InvSel->Amount <= 0, offsetflags);
}
if((cmd.flags & DRAWSELECTEDINVENTORY_ALWAYSSHOWCOUNTER) || CPlayer->mo->InvSel->Amount != 1)
{
@ -714,7 +716,7 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
{
drawingFont = cmd.font;
}
DrawNumber(CPlayer->mo->InvSel->Amount, 3, cmd.special2, cmd.special3, xOffset, yOffset, alpha, block.fullScreenOffsets, cmd.translation, cmd.special4);
DrawNumber(CPlayer->mo->InvSel->Amount, 3, cmd.special2, cmd.special3, xOffset, yOffset, alpha, block.fullScreenOffsets, cmd.translation, cmd.special4, false, !!(cmd.flags & DRAWSELECTEDINVENTORY_DRAWSHADOW));
}
}
else if((cmd.flags & DRAWSELECTEDINVENTORY_ALTERNATEONEMPTY))
@ -728,6 +730,7 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
bool artibox = true;
bool noarrows = false;
bool alwaysshowcounter = false;
int bgalpha = alpha;
if((cmd.flags & DRAWINVENTORYBAR_ALWAYSSHOW))
alwaysshow = true;
if((cmd.flags & DRAWINVENTORYBAR_NOARTIBOX))
@ -737,12 +740,12 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
if((cmd.flags & DRAWINVENTORYBAR_ALWAYSSHOWCOUNTER))
alwaysshowcounter = true;
if(cmd.flags & DRAWINVENTORYBAR_TRANSLUCENT)
alpha = fixed_t((((double) alpha / (double) FRACUNIT) * ((double) HX_SHADOW / (double) FRACUNIT)) * FRACUNIT);
bgalpha = fixed_t((((double) alpha / (double) FRACUNIT) * ((double) HX_SHADOW / (double) FRACUNIT)) * FRACUNIT);
if(drawingFont != cmd.font)
{
drawingFont = cmd.font;
}
DrawInventoryBar(cmd.special, cmd.value, cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, alwaysshow, cmd.special2, cmd.special3, cmd.translation, artibox, noarrows, alwaysshowcounter);
DrawInventoryBar(cmd.special, cmd.value, cmd.x, cmd.y, xOffset, yOffset, alpha, block.fullScreenOffsets, alwaysshow, cmd.special2, cmd.special3, cmd.translation, artibox, noarrows, alwaysshowcounter, bgalpha);
break;
}
case SBARINFO_DRAWBAR:
@ -1292,6 +1295,10 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
}
break;
}
case SBARINFO_INVENTORYBARNOTVISIBLE:
if(CPlayer->inventorytics <= 0 || (level.flags & LEVEL_NOINVENTORYBAR))
doCommands(cmd.subBlock, xOffset, yOffset, alpha);
break;
case SBARINFO_WEAPONAMMO:
if(CPlayer->ReadyWeapon != NULL)
{
@ -1553,7 +1560,7 @@ void DSBarInfo::DrawFace(const char *defaultFace, int accuracy, int stateflags,
}
void DSBarInfo::DrawInventoryBar(int type, int num, int x, int y, int xOffset, int yOffset, int alpha, bool fullScreenOffsets, bool alwaysshow,
int counterx, int countery, EColorRange translation, bool drawArtiboxes, bool noArrows, bool alwaysshowcounter)
int counterx, int countery, EColorRange translation, bool drawArtiboxes, bool noArrows, bool alwaysshowcounter, int bgalpha)
{ //yes, there is some Copy & Paste here too
AInventory *item;
int i;
@ -1567,7 +1574,7 @@ void DSBarInfo::DrawInventoryBar(int type, int num, int x, int y, int xOffset, i
{
if(drawArtiboxes)
{
DrawGraphic(Images[invBarOffset + imgARTIBOX], x+i*spacing, y, xOffset, yOffset, alpha, fullScreenOffsets);
DrawGraphic(Images[invBarOffset + imgARTIBOX], x+i*spacing, y, xOffset, yOffset, bgalpha, fullScreenOffsets);
}
if(type != GAME_Strife) //Strife draws the cursor before the icons
DrawGraphic(TexMan(item->Icon), x+i*spacing, y, xOffset, yOffset, alpha, fullScreenOffsets, false, item->Amount <= 0);

View file

@ -97,6 +97,7 @@ static const char *SBarInfoRoutineLevel[] =
"isselected",
"usessecondaryammo",
"hasweaponpiece",
"inventorybarnotvisible",
"weaponammo", //event
"ininventory",
NULL
@ -510,7 +511,7 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
else if(sc.Compare("centerbottom"))
cmd.flags |= DRAWIMAGE_OFFSET_CENTERBOTTOM;
else
sc.ScriptError("Expected 'center' or 'centerbottom' got '%s' instead.", sc.String);
sc.ScriptError("'%s' is not a valid alignment.", sc.String);
}
sc.MustGetToken(';');
break;
@ -715,6 +716,18 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
{
cmd.flags |= DRAWSELECTEDINVENTORY_ALWAYSSHOWCOUNTER;
}
else if(sc.Compare("center"))
{
cmd.flags |= DRAWSELECTEDINVENTORY_CENTER;
}
else if(sc.Compare("centerbottom"))
{
cmd.flags |= DRAWSELECTEDINVENTORY_CENTERBOTTOM;
}
else if(sc.Compare("drawshadow"))
{
cmd.flags |= DRAWSELECTEDINVENTORY_DRAWSHADOW;
}
else
{
cmd.font = V_GetFont(sc.String);
@ -1207,6 +1220,11 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
this->ParseSBarInfoBlock(sc, cmd.subBlock);
break;
}
case SBARINFO_INVENTORYBARNOTVISIBLE:
sc.MustGetToken('{');
cmd.subBlock.fullScreenOffsets = block.fullScreenOffsets;
this->ParseSBarInfoBlock(sc, cmd.subBlock);
break;
case SBARINFO_WEAPONAMMO:
sc.MustGetToken(TK_Identifier);
if(sc.Compare("not"))

View file

@ -675,15 +675,18 @@ static void CalcPosVel(int type, const AActor *actor, const sector_t *sector,
case SOURCE_Sector:
assert(sector != NULL);
if (chanflags & CHAN_AREA)
if (sector != NULL)
{
CalcSectorSoundOrg(sector, channum, &x, &z, &y);
}
else
{
x = sector->soundorg[0];
z = sector->soundorg[1];
chanflags |= CHAN_LISTENERZ;
if (chanflags & CHAN_AREA)
{
CalcSectorSoundOrg(sector, channum, &x, &z, &y);
}
else
{
x = sector->soundorg[0];
z = sector->soundorg[1];
chanflags |= CHAN_LISTENERZ;
}
}
break;