From e0734b3c2dd6cdcb262fe0efa04324195671fb44 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 13 Nov 2009 21:28:39 +0000 Subject: [PATCH] - ported GZDoom's new 'skyoffset' ANIMDEFS option for compatibility purposes. SVN r1977 (trunk) --- src/g_level.cpp | 9 ++++++--- src/r_anim.cpp | 11 +++++++++++ src/r_defs.h | 5 +++++ src/textures/textures.h | 1 + 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/g_level.cpp b/src/g_level.cpp index a2bd300ed..6e4cd6f4a 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -87,11 +87,13 @@ #ifndef STAT #define STAT_NEW(map) #define STAT_END(newl) -#define STAT_SAVE(arc, hub) +#define STAT_READ(png) +#define STAT_WRITE(f) #else void STAT_NEW(const char *lev); void STAT_END(const char *newl); -void STAT_SAVE(FArchive &arc, bool hubload); +void STAT_READ(PNGHandle *png); +void STAT_WRITE(FILE *f); #endif EXTERN_CVAR (Float, sv_gravity) @@ -1524,7 +1526,6 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad) } } screen->EndSerialize(arc); - STAT_SAVE(arc, hubLoad); } //========================================================================== @@ -1645,6 +1646,7 @@ void G_WriteSnapshots (FILE *file) { unsigned int i; + STAT_WRITE(file); for (i = 0; i < wadlevelinfos.Size(); i++) { if (wadlevelinfos[i].snapshot) @@ -1795,6 +1797,7 @@ void G_ReadSnapshots (PNGHandle *png) arc << pnum; } } + STAT_READ(png); png->File->ResetFilePtr(); } diff --git a/src/r_anim.cpp b/src/r_anim.cpp index c4ed59850..2ae96f58e 100644 --- a/src/r_anim.cpp +++ b/src/r_anim.cpp @@ -405,6 +405,17 @@ static void R_InitAnimDefs () { P_ParseAnimatedDoor (sc); } + else if (sc.Compare("skyoffset")) + { + sc.MustGetString (); + FTextureID picnum = TexMan.CheckForTexture (sc.String, FTexture::TEX_Wall, texflags); + sc.MustGetNumber(); + if (picnum.Exists()) + { + FTexture *tex = TexMan[picnum]; + tex->SkyOffset = sc.Number; + } + } else { sc.ScriptError (NULL); diff --git a/src/r_defs.h b/src/r_defs.h index a14a819ce..f19656afa 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -606,6 +606,11 @@ struct sector_t return lightlevel; } + secplane_t &GetSecPlane(int pos) + { + return pos == floor? floorplane:ceilingplane; + } + bool PlaneMoving(int pos); diff --git a/src/textures/textures.h b/src/textures/textures.h index b62da46d8..1bd9282a9 100644 --- a/src/textures/textures.h +++ b/src/textures/textures.h @@ -121,6 +121,7 @@ public: // doing it per patch. WORD Rotations; + SWORD SkyOffset; enum // UseTypes {