(SBARINFO patch)

- Fixed: DrawBar would not show.
- Fixed: IsSelected took string constants instead of identifiers.

SVN r1176 (trunk)
This commit is contained in:
Christoph Oelckers 2008-08-18 19:01:14 +00:00
parent 774e559eaf
commit 371d4704b8
3 changed files with 30 additions and 24 deletions

View file

@ -1,3 +1,7 @@
August 18, 2008 (SBARINFO patch)
- Fixed: DrawBar would not show.
- Fixed: IsSelected took string constants instead of identifiers.
August 16, 2008 (Changes by Graf Zahl) August 16, 2008 (Changes by Graf Zahl)
- Put more floor/ceiling properties in sector_t into a substructure and - Put more floor/ceiling properties in sector_t into a substructure and
added wrapper functions. added wrapper functions.

View file

@ -901,30 +901,27 @@ void DSBarInfo::doCommands(SBarInfoBlock &block, int xOffset, int yOffset, int a
int cx, cy, cw, ch, cr, cb; int cx, cy, cw, ch, cr, cb;
// These still need to be caclulated for the clear call. // These still need to be caclulated for the clear call.
if(bg == NULL) if(!block.fullScreenOffsets)
{ {
if(!block.fullScreenOffsets) // Calc real screen coordinates for bar
x = cmd.x + ST_X + xOffset;
y = cmd.y + ST_Y + yOffset;
w = fg->GetScaledWidth();
h = fg->GetScaledHeight();
if (Scaled)
{ {
// Calc real screen coordinates for bar screen->VirtualToRealCoordsInt(x, y, w, h, 320, 200, true);
x = cmd.x + ST_X + xOffset;
y = cmd.y + ST_Y + yOffset;
w = fg->GetScaledWidth();
h = fg->GetScaledHeight();
if (Scaled)
{
screen->VirtualToRealCoordsInt(x, y, w, h, 320, 200, true);
}
}
else
{
x = cmd.x + xOffset;
y = cmd.y + yOffset;
w = fg->GetScaledWidth();
h = fg->GetScaledHeight();
if(vid_fps && x < 0 && y >= 0)
y += 10;
} }
} }
else
{
x = cmd.x + xOffset;
y = cmd.y + yOffset;
w = fg->GetScaledWidth();
h = fg->GetScaledHeight();
if(vid_fps && x < 0 && y >= 0)
y += 10;
}
if(cmd.special3 != 0) if(cmd.special3 != 0)
{ {

View file

@ -1147,16 +1147,18 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
this->ParseSBarInfoBlock(sc, cmd.subBlock); this->ParseSBarInfoBlock(sc, cmd.subBlock);
break; break;
case SBARINFO_ISSELECTED: case SBARINFO_ISSELECTED:
//Using StringConst instead of Identifieres is deperecated!
if(sc.CheckToken(TK_Identifier)) if(sc.CheckToken(TK_Identifier))
{ {
if(sc.Compare("not")) if(sc.Compare("not"))
{ {
cmd.flags |= SBARINFOEVENT_NOT; cmd.flags |= SBARINFOEVENT_NOT;
if(!sc.CheckToken(TK_StringConst))
sc.MustGetToken(TK_Identifier);
} }
else
sc.ScriptError("Expected 'not' got '%s' instead.", sc.String);
} }
sc.MustGetToken(TK_StringConst); else
sc.MustGetToken(TK_StringConst);
for(int i = 0;i < 2;i++) for(int i = 0;i < 2;i++)
{ {
cmd.setString(sc, sc.String, i); cmd.setString(sc, sc.String, i);
@ -1166,7 +1168,10 @@ void SBarInfo::ParseSBarInfoBlock(FScanner &sc, SBarInfoBlock &block)
sc.ScriptError("'%s' is not a type of weapon.", sc.String); sc.ScriptError("'%s' is not a type of weapon.", sc.String);
} }
if(sc.CheckToken(',')) if(sc.CheckToken(','))
sc.MustGetToken(TK_StringConst); {
if(!sc.CheckToken(TK_StringConst))
sc.MustGetToken(TK_Identifier);
}
else else
break; break;
} }