diff --git a/docs/rh-log.txt b/docs/rh-log.txt index ea701a5253..aeb746ebcf 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,7 @@ April 20, 2006 (Changes by Graf Zahl) +- Fixed: Doom's status bar assumed that STBAR was always in Doom patch format. +- Added MF3_DONTSPLASH to the newly created sound sequence things. +- Fixed: makewad.c used C++ syntax. - Fixed: Strife's ending check included destroying the computer - an event that happens before the branch in the story. - Fixed: The overloaded FRandom::Random2 function with mask parameter didn't diff --git a/src/g_doom/doom_sbar.cpp b/src/g_doom/doom_sbar.cpp index 6805ab1863..5338d95008 100644 --- a/src/g_doom/doom_sbar.cpp +++ b/src/g_doom/doom_sbar.cpp @@ -12,6 +12,7 @@ #include "m_swap.h" #include "a_keys.h" #include "templates.h" +#include "i_system.h" #define ST_EVILGRINCOUNT (2*TICRATE) #define ST_STRAIGHTFACECOUNT (TICRATE/2) @@ -190,11 +191,21 @@ public: } private: - struct FDoomStatusBarTexture : public FPatchTexture + struct FDoomStatusBarTexture : public FTexture { public: FDoomStatusBarTexture (); + const BYTE *GetColumn (unsigned int column, const Span **spans_out); + const BYTE *GetPixels (); + void Unload (); + ~FDoomStatusBarTexture (); void DrawToBar (const char *name, int x, int y, BYTE *colormap_in = NULL); + + protected: + void MakeTexture (); + + FTexture * BaseTexture; + BYTE *Pixels; } StatusBarTex; @@ -1023,8 +1034,68 @@ private: }; FDoomStatusBar::FDoomStatusBarTexture::FDoomStatusBarTexture () -: FPatchTexture (Wads.GetNumForName ("STBAR"), FTexture::TEX_MiscPatch) { + BaseTexture = TexMan[TexMan.AddPatch("STBAR")]; + if (BaseTexture==NULL) + { + I_Error("Fatal error: STBAR not found"); + } + UseType = FTexture::TEX_MiscPatch; + Name[0]=0; // doesn't need a name + + // now copy all the properties from the base texture + Width = BaseTexture->GetWidth(); + Height = BaseTexture->GetHeight(); + TopOffset = BaseTexture->TopOffset; + LeftOffset = BaseTexture->LeftOffset; + WidthBits = BaseTexture->WidthBits; + HeightBits = BaseTexture->HeightBits; + ScaleX = BaseTexture->ScaleX; + ScaleY = BaseTexture->ScaleY; + WidthMask = (1 << WidthBits) - 1; + Pixels = NULL; +} + +const BYTE *FDoomStatusBar::FDoomStatusBarTexture::GetColumn (unsigned int column, const Span **spans_out) +{ + if (Pixels == NULL) + { + MakeTexture (); + } + + BaseTexture->GetColumn(column, spans_out); + return Pixels + column*Height; +} + +const BYTE *FDoomStatusBar::FDoomStatusBarTexture::GetPixels () +{ + if (Pixels == NULL) + { + MakeTexture (); + } + return Pixels; +} + +void FDoomStatusBar::FDoomStatusBarTexture::Unload () +{ + if (Pixels != NULL) + { + delete[] Pixels; + Pixels = NULL; + } +} + +FDoomStatusBar::FDoomStatusBarTexture::~FDoomStatusBarTexture () +{ + Unload (); +} + + +void FDoomStatusBar::FDoomStatusBarTexture::MakeTexture () +{ + Pixels = new BYTE[Width*Height]; + const BYTE *pix = BaseTexture->GetPixels(); + memcpy(Pixels, pix, Width*Height); } void FDoomStatusBar::FDoomStatusBarTexture::DrawToBar (const char *name, int x, int y, BYTE *colormap_in) diff --git a/src/g_shared/a_soundsequence.cpp b/src/g_shared/a_soundsequence.cpp index d6393d15b8..9b13e15d33 100644 --- a/src/g_shared/a_soundsequence.cpp +++ b/src/g_shared/a_soundsequence.cpp @@ -79,6 +79,7 @@ public: IMPLEMENT_STATELESS_ACTOR (ASoundSequenceSlot, Any, -1, 0) PROP_Flags (MF_NOSECTOR|MF_NOBLOCKMAP) + PROP_Flags3 (MF3_DONTSPLASH) END_DEFAULTS //========================================================================== @@ -107,6 +108,7 @@ public: IMPLEMENT_STATELESS_ACTOR (ASoundSequence, Any, 14066, 0) PROP_Flags (MF_NOSECTOR|MF_NOBLOCKMAP) + PROP_Flags3 (MF3_DONTSPLASH) END_DEFAULTS //==========================================================================