mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-18 15:42:34 +00:00
- Fixed: A_Jump used a wrong index into the jump address table.
- Fixed: The recent changes in the DECORATE parser require the special parameter to A_CallSpecial to be an expression, not a constant. - Removed game filters from old style decorations. No WAD in existence ever used them and removing them allows to make the parser more robust. SVN r1170 (trunk)
This commit is contained in:
parent
f3922ec6a1
commit
61cbb1d2e1
10 changed files with 73 additions and 4 deletions
|
@ -1,4 +1,9 @@
|
|||
August 14, 2008 (Changes by Graf Zahl)
|
||||
- Fixed: A_Jump used a wrong index into the jump address table.
|
||||
- Fixed: The recent changes in the DECORATE parser require the special parameter
|
||||
to A_CallSpecial to be an expression, not a constant.
|
||||
- Removed game filters from old style decorations. No WAD in existence ever
|
||||
used them and removing them allows to make the parser more robust.
|
||||
- Added a few more macros so that the action function code doesn't have
|
||||
to reference its arguments directly, except 'self'. This may be helpful if it
|
||||
becomes necessary to restructure this code once DoomScript becomes real.
|
||||
|
|
|
@ -49,18 +49,22 @@ public:
|
|||
FWarpTexture (FTexture *source);
|
||||
~FWarpTexture ();
|
||||
|
||||
virtual int CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate=0, FCopyInfo *inf = NULL);
|
||||
const BYTE *GetColumn (unsigned int column, const Span **spans_out);
|
||||
const BYTE *GetPixels ();
|
||||
void Unload ();
|
||||
bool CheckModified ();
|
||||
|
||||
float GetSpeed() const { return Speed; }
|
||||
int GetSourceLump() { return SourcePic->GetSourceLump(); }
|
||||
void SetSpeed(float fac) { Speed = fac; }
|
||||
FTexture *GetRedirect(bool wantwarped);
|
||||
|
||||
DWORD GenTime;
|
||||
protected:
|
||||
FTexture *SourcePic;
|
||||
BYTE *Pixels;
|
||||
Span **Spans;
|
||||
DWORD GenTime;
|
||||
float Speed;
|
||||
|
||||
virtual void MakeTexture (DWORD time);
|
||||
|
|
|
@ -184,6 +184,7 @@ protected:
|
|||
bool bTranslucentPatches:1;
|
||||
|
||||
void MakeTexture ();
|
||||
FTexture *GetRedirect(bool wantwarped);
|
||||
|
||||
private:
|
||||
void CheckForHacks ();
|
||||
|
@ -755,6 +756,18 @@ void FMultiPatchTexture::CheckForHacks ()
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
FTexture *FMultiPatchTexture::GetRedirect(bool wantwarped)
|
||||
{
|
||||
if (bRedirect) return Parts->Texture;
|
||||
else return this;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// FMultiPatchTexture :: TexPart :: TexPart
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FMultiPatchTexture::TexPart::TexPart()
|
||||
{
|
||||
OriginX = OriginY = 0;
|
||||
|
|
|
@ -515,6 +515,11 @@ bool FTexture::UseBasePalette()
|
|||
return true;
|
||||
}
|
||||
|
||||
FTexture *FTexture::GetRedirect(bool wantwarped)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
FDummyTexture::FDummyTexture ()
|
||||
|
|
|
@ -147,6 +147,7 @@ public:
|
|||
int CopyTrueColorTranslated(FBitmap *bmp, int x, int y, int rotate, FRemapTable *remap, FCopyInfo *inf = NULL);
|
||||
virtual bool UseBasePalette();
|
||||
virtual int GetSourceLump() { return -1; }
|
||||
virtual FTexture *GetRedirect(bool wantwarped);
|
||||
|
||||
virtual void Unload () = 0;
|
||||
|
||||
|
|
|
@ -222,3 +222,29 @@ void FWarp2Texture::MakeTexture (DWORD time)
|
|||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// FMultiPatchTexture :: TexPart :: TexPart
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FTexture *FWarpTexture::GetRedirect(bool wantwarped)
|
||||
{
|
||||
if (!wantwarped) return SourcePic;
|
||||
else return this;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// FMultiPatchTexture :: CopyTrueColorPixels
|
||||
//
|
||||
// This doesn't warp. It's just here in case someone tries to use a warp
|
||||
// texture for compositing a multipatch texture
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
int FWarpTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, FCopyInfo *inf)
|
||||
{
|
||||
return SourcePic->CopyTrueColorPixels(bmp, x, y, rotate, inf);
|
||||
}
|
||||
|
||||
|
|
|
@ -244,6 +244,10 @@ void ParseOldDecoration(FScanner &sc, EDefinitionType def)
|
|||
info->GameFilter = 0x80;
|
||||
MakeStateDefines(parent->ActorInfo->StateList);
|
||||
|
||||
// There isn't a single WAD out there which uses game filters with old style
|
||||
// decorations so this may as well be disabled. Without this option is is much
|
||||
// easier to detect incorrect declarations
|
||||
#if 0
|
||||
sc.MustGetString ();
|
||||
while (!sc.Compare ("{"))
|
||||
{
|
||||
|
@ -295,6 +299,10 @@ void ParseOldDecoration(FScanner &sc, EDefinitionType def)
|
|||
{
|
||||
info->GameFilter &= ~0x80;
|
||||
}
|
||||
#else
|
||||
info->GameFilter = GAME_Any;
|
||||
sc.MustGetStringName("{");
|
||||
#endif
|
||||
|
||||
states.Clear ();
|
||||
memset (&extra, 0, sizeof(extra));
|
||||
|
|
|
@ -460,7 +460,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Jump)
|
|||
}
|
||||
else
|
||||
{
|
||||
ACTION_JUMP(jumps[(pr_cajump() % (count - 1)) + 2]);
|
||||
ACTION_JUMP(jumps[(pr_cajump() % (count - 1))]);
|
||||
}
|
||||
}
|
||||
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
|
||||
|
|
|
@ -122,7 +122,9 @@ static void ParseDecorate (FScanner &sc)
|
|||
}
|
||||
|
||||
default:
|
||||
// Yuck! Too bad that there's no better way to check this properly
|
||||
// without the option of game filters following, anything but an opening brace
|
||||
// here means a syntax error.
|
||||
sc.MustGetStringName("{");
|
||||
sc.RestorePos(pos);
|
||||
ParseOldDecoration(sc, DEF_Decoration);
|
||||
break;
|
||||
|
|
|
@ -421,7 +421,12 @@ bool DoActionSpecials(FScanner &sc, FState & state, bool multistate, int * state
|
|||
|
||||
int paramindex=PrepareStateParameters(&state, 6);
|
||||
|
||||
StateParameters[paramindex]=special;
|
||||
// The function expects the special to be passed as expression so we
|
||||
// have to convert it.
|
||||
specname.Format("%d", special);
|
||||
FScanner sc2;
|
||||
sc2.OpenMem("", (char*)specname.GetChars(), int(specname.Len()));
|
||||
StateParameters[paramindex] = ParseExpression(sc2, false, bag.Info->Class);
|
||||
|
||||
// Make this consistent with all other parameter parsing
|
||||
if (sc.CheckToken('('))
|
||||
|
|
Loading…
Reference in a new issue