diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 0168dfd82..b583e9812 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,8 @@ +March 25, 2008 (Changes by Graf Zahl) +- Fixed: ANIMATED allowed animations between different texture types. +- Added a debuganimated CCMD that can be used to output some information + if a WAD shows broken animations. + March 24, 2008 - Removed xlat_parser.h from the repository. Lemon was always being run on xlat_parser.y because both files had the same time stamp after an update, @@ -10,6 +15,11 @@ March 24, 2008 - Restored the sound limiting. March 24, 2008 (Changes by Graf Zahl) +- Fixed: THe handling for enum values in Xlat was incorrect. The rule with + value assignment must set the counter one higher than the current value. +- Fixed: The definition of enums in the Xlat grammar was right-recursive + which could create stack overflows in the parser. Made it left-recursive as + recommended in Lemon's docs. - Added Thomas's submissions for decal assignment to puffs and NOINFIGHTING flag. - Reverted changes of r715 in v_collection.cpp because they broke loading of status bar face graphics belonging to skins. diff --git a/src/r_anim.cpp b/src/r_anim.cpp index 37b80fab1..724083a39 100644 --- a/src/r_anim.cpp +++ b/src/r_anim.cpp @@ -135,9 +135,14 @@ static FRandom pr_animatepictures ("AnimatePics"); // //========================================================================== +CVAR(Bool, debuganimated, false, 0) + void R_InitPicAnims (void) { - const BITFIELD texflags = FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_TryAny; + const BITFIELD texflags = FTextureManager::TEXMAN_Overridable; + // I think better not! This is only for old ANIMATED definition that + // don't know about ZDoom's more flexible texture system. + // | FTextureManager::TEXMAN_TryAny; if (Wads.CheckNumForName ("ANIMATED") != -1) { @@ -175,6 +180,35 @@ void R_InitPicAnims (void) Printf ("Animation %s in ANIMATED has only one frame", anim_p + 10); continue; } + + FTexture *tex1 = TexMan[pic1]; + FTexture *tex2 = TexMan[pic1]; + + if (tex1->UseType != tex2->UseType) + { + // not the same type - + continue; + } + + if (debuganimated) + { + Printf("Defining animation '%s' (texture %d, lump %d, file %d) to '%s' (texture %d, lump %d, file %d)\n", + tex1->Name, tex1->GetSourceLump(), Wads.GetLumpFile(tex1->GetSourceLump()), + tex2->Name, tex2->GetSourceLump(), Wads.GetLumpFile(tex2->GetSourceLump())); + } + + /* FIXME: doesn't work with hires texture replacements. + int l1 = tex1->GetSourceLump(); + int l2 = tex2->GetSourceLump(); + + if (tex1->UseType == FTexture::TEX_Wall && l1 != l2) + { + // Animated walls must be in the same definition lumo + continue; + } + */ + + // [RH] Allow for backward animations as well as forward. if (pic1 > pic2) { diff --git a/src/r_data.h b/src/r_data.h index ba0a61d2a..17eb74962 100644 --- a/src/r_data.h +++ b/src/r_data.h @@ -82,7 +82,7 @@ struct FPatchLookup class FMultiPatchTexture : public FTexture { public: - FMultiPatchTexture (const void *texdef, FPatchLookup *patchlookup, int maxpatchnum, bool strife); + FMultiPatchTexture (const void *texdef, FPatchLookup *patchlookup, int maxpatchnum, bool strife, int deflump); ~FMultiPatchTexture (); const BYTE *GetColumn (unsigned int column, const Span **spans_out); @@ -92,10 +92,12 @@ public: virtual void SetFrontSkyLayer (); int CopyTrueColorPixels(BYTE *buffer, int buf_pitch, int buf_height, int x, int y); + int GetSourceLump() { return DefinitionLump; } protected: BYTE *Pixels; Span **Spans; + int DefinitionLump; struct TexPart { diff --git a/src/r_defs.h b/src/r_defs.h index b06b8679d..0b33c4e71 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -929,7 +929,7 @@ public: void WriteTexture (FArchive &arc, int picnum); int ReadTexture (FArchive &arc); - void AddTexturesLump (const void *lumpdata, int lumpsize, int patcheslump, int firstdup=0, bool texture1=false); + void AddTexturesLump (const void *lumpdata, int lumpsize, int deflumpnum, int patcheslump, int firstdup=0, bool texture1=false); void AddTexturesLumps (int lump1, int lump2, int patcheslump); void AddGroup(int wadnum, const char * startlump, const char * endlump, int ns, int usetype); void AddPatches (int lumpnum); diff --git a/src/textures/multipatchtexture.cpp b/src/textures/multipatchtexture.cpp index 76c3999ba..d1c17fced 100644 --- a/src/textures/multipatchtexture.cpp +++ b/src/textures/multipatchtexture.cpp @@ -59,7 +59,7 @@ // //========================================================================== -FMultiPatchTexture::FMultiPatchTexture (const void *texdef, FPatchLookup *patchlookup, int maxpatchnum, bool strife) +FMultiPatchTexture::FMultiPatchTexture (const void *texdef, FPatchLookup *patchlookup, int maxpatchnum, bool strife, int deflumpnum) : Pixels (0), Spans(0), Parts(0), bRedirect(false) { union @@ -159,6 +159,7 @@ FMultiPatchTexture::FMultiPatchTexture (const void *texdef, FPatchLookup *patchl bRedirect = true; } } + DefinitionLump = deflumpnum; } //========================================================================== @@ -467,7 +468,7 @@ FTextureFormat FMultiPatchTexture::GetFormat() // //========================================================================== -void FTextureManager::AddTexturesLump (const void *lumpdata, int lumpsize, int patcheslump, int firstdup, bool texture1) +void FTextureManager::AddTexturesLump (const void *lumpdata, int lumpsize, int deflumpnum, int patcheslump, int firstdup, bool texture1) { FPatchLookup *patchlookup; int i, j; @@ -596,7 +597,7 @@ void FTextureManager::AddTexturesLump (const void *lumpdata, int lumpsize, int p } if (j + 1 == firstdup) { - FTexture *tex = new FMultiPatchTexture ((const BYTE *)maptex + offset, patchlookup, numpatches, isStrife); + FMultiPatchTexture *tex = new FMultiPatchTexture ((const BYTE *)maptex + offset, patchlookup, numpatches, isStrife, deflumpnum); if (i == 1 && texture1) { tex->UseType = FTexture::TEX_Null; @@ -621,12 +622,12 @@ void FTextureManager::AddTexturesLumps (int lump1, int lump2, int patcheslump) if (lump1 >= 0) { FMemLump texdir = Wads.ReadLump (lump1); - AddTexturesLump (texdir.GetMem(), Wads.LumpLength (lump1), patcheslump, firstdup, true); + AddTexturesLump (texdir.GetMem(), Wads.LumpLength (lump1), lump1, patcheslump, firstdup, true); } if (lump2 >= 0) { FMemLump texdir = Wads.ReadLump (lump2); - AddTexturesLump (texdir.GetMem(), Wads.LumpLength (lump2), patcheslump, firstdup, false); + AddTexturesLump (texdir.GetMem(), Wads.LumpLength (lump2), lump2, patcheslump, firstdup, false); } } diff --git a/src/xlat/xlat_parser.y b/src/xlat/xlat_parser.y index 4974f7f2d..c43d54562 100644 --- a/src/xlat/xlat_parser.y +++ b/src/xlat/xlat_parser.y @@ -67,7 +67,7 @@ enum_open ::= ENUM LBRACE. enum_list ::= . /* empty */ enum_list ::= single_enum. -enum_list ::= single_enum COMMA enum_list. +enum_list ::= enum_list COMMA single_enum. single_enum ::= SYM(A). { @@ -76,7 +76,8 @@ single_enum ::= SYM(A). single_enum ::= SYM(A) EQUALS exp(B). { - context->AddSym (A.sym, context->EnumVal = B); + context->AddSym (A.sym, B); + context->EnumVal = B+1; } //========================================================================== diff --git a/wadsrc/xlat/defines.i b/wadsrc/xlat/defines.i index 4d3ddba60..b77dca7b7 100644 --- a/wadsrc/xlat/defines.i +++ b/wadsrc/xlat/defines.i @@ -141,11 +141,8 @@ enum sDamage_Hellslime = 105, Damage_InstantDeath = 115, sDamage_SuperHellslime = 116, - Scroll_StrifeCurrent = 118 -} + Scroll_StrifeCurrent = 118, -enum -{ // Caverns of Darkness healing sector Sector_Heal = 196, diff --git a/zdoom.vcproj b/zdoom.vcproj index 600a406bb..b470fc18e 100644 --- a/zdoom.vcproj +++ b/zdoom.vcproj @@ -3540,7 +3540,7 @@ Name="VCCustomBuildTool" Description="Generating xlat_parser.c and xlat_parser.h..." CommandLine="tools\lemon\lemon.exe "$(InputPath)" " - Outputs="$(InputDir)xlat_parser.c:$(InputDir)xlat_parser.h" + Outputs="$(InputDir)xlat_parser.c;$(InputDir)xlat_parser.h" />