- Fixed: Doom's status bar assumed that STBAR was always in Doom patch format.

- Added MF3_DONTSPLASH to the newly created sound sequence things.


SVN r62 (trunk)
This commit is contained in:
Christoph Oelckers 2006-04-21 21:42:12 +00:00
parent 283dca5750
commit 663a0f5209
3 changed files with 78 additions and 2 deletions

View file

@ -1,4 +1,7 @@
April 20, 2006 (Changes by Graf Zahl) 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 - Fixed: Strife's ending check included destroying the computer - an event
that happens before the branch in the story. that happens before the branch in the story.
- Fixed: The overloaded FRandom::Random2 function with mask parameter didn't - Fixed: The overloaded FRandom::Random2 function with mask parameter didn't

View file

@ -12,6 +12,7 @@
#include "m_swap.h" #include "m_swap.h"
#include "a_keys.h" #include "a_keys.h"
#include "templates.h" #include "templates.h"
#include "i_system.h"
#define ST_EVILGRINCOUNT (2*TICRATE) #define ST_EVILGRINCOUNT (2*TICRATE)
#define ST_STRAIGHTFACECOUNT (TICRATE/2) #define ST_STRAIGHTFACECOUNT (TICRATE/2)
@ -190,11 +191,21 @@ public:
} }
private: private:
struct FDoomStatusBarTexture : public FPatchTexture struct FDoomStatusBarTexture : public FTexture
{ {
public: public:
FDoomStatusBarTexture (); 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); void DrawToBar (const char *name, int x, int y, BYTE *colormap_in = NULL);
protected:
void MakeTexture ();
FTexture * BaseTexture;
BYTE *Pixels;
} }
StatusBarTex; StatusBarTex;
@ -1023,8 +1034,68 @@ private:
}; };
FDoomStatusBar::FDoomStatusBarTexture::FDoomStatusBarTexture () 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) void FDoomStatusBar::FDoomStatusBarTexture::DrawToBar (const char *name, int x, int y, BYTE *colormap_in)

View file

@ -79,6 +79,7 @@ public:
IMPLEMENT_STATELESS_ACTOR (ASoundSequenceSlot, Any, -1, 0) IMPLEMENT_STATELESS_ACTOR (ASoundSequenceSlot, Any, -1, 0)
PROP_Flags (MF_NOSECTOR|MF_NOBLOCKMAP) PROP_Flags (MF_NOSECTOR|MF_NOBLOCKMAP)
PROP_Flags3 (MF3_DONTSPLASH)
END_DEFAULTS END_DEFAULTS
//========================================================================== //==========================================================================
@ -107,6 +108,7 @@ public:
IMPLEMENT_STATELESS_ACTOR (ASoundSequence, Any, 14066, 0) IMPLEMENT_STATELESS_ACTOR (ASoundSequence, Any, 14066, 0)
PROP_Flags (MF_NOSECTOR|MF_NOBLOCKMAP) PROP_Flags (MF_NOSECTOR|MF_NOBLOCKMAP)
PROP_Flags3 (MF3_DONTSPLASH)
END_DEFAULTS END_DEFAULTS
//========================================================================== //==========================================================================