- Made all the basic texture classes local to their implementation.
They are not needed anywhere else. - Changed the HackHack hack for corrupt 256 pixel high textures that FMultiPatchTexture only calls a virtual function instead of doing any type checks of the patch itself. - Cleaned up the constant definitions in doomdata.h. - Moved the TEXTUREx structures from doomdata.h to multipatchtexture.cpp because they are used only in this one file. - Removed some more typedefs from r_defs.h and doomdata.h - Moved local polyobject data definitions from p_local.h to po_man.cpp. SVN r1012 (trunk)
This commit is contained in:
parent
71b0d4d074
commit
47aacc45c8
34 changed files with 1723 additions and 1091 deletions
|
|
@ -39,8 +39,40 @@
|
|||
#include "w_wad.h"
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// A raw 320x200 graphic used by Heretic and Hexen fullscreen images
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
bool FRawPageTexture::Check(FileReader & data)
|
||||
class FRawPageTexture : public FTexture
|
||||
{
|
||||
public:
|
||||
FRawPageTexture (int lumpnum);
|
||||
~FRawPageTexture ();
|
||||
|
||||
const BYTE *GetColumn (unsigned int column, const Span **spans_out);
|
||||
const BYTE *GetPixels ();
|
||||
void Unload ();
|
||||
|
||||
int GetSourceLump() { return SourceLump; }
|
||||
|
||||
protected:
|
||||
int SourceLump;
|
||||
BYTE *Pixels;
|
||||
static const Span DummySpans[2];
|
||||
|
||||
void MakeTexture ();
|
||||
};
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// RAW textures must be exactly 64000 bytes long and not be identifiable
|
||||
// as Doom patch
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
static bool CheckIfRaw(FileReader & data)
|
||||
{
|
||||
if (data.GetLength() != 64000) return false;
|
||||
|
||||
|
|
@ -112,17 +144,36 @@ bool FRawPageTexture::Check(FileReader & data)
|
|||
}
|
||||
}
|
||||
|
||||
FTexture *FRawPageTexture::Create(FileReader & file, int lumpnum)
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FTexture *RawPageTexture_TryCreate(FileReader & file, int lumpnum)
|
||||
{
|
||||
if (!CheckIfRaw(file)) return NULL;
|
||||
return new FRawPageTexture(lumpnum);
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
const FTexture::Span FRawPageTexture::DummySpans[2] =
|
||||
{
|
||||
{ 0, 200 }, { 0, 0 }
|
||||
};
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FRawPageTexture::FRawPageTexture (int lumpnum)
|
||||
: SourceLump(lumpnum), Pixels(0)
|
||||
{
|
||||
|
|
@ -136,11 +187,23 @@ FRawPageTexture::FRawPageTexture (int lumpnum)
|
|||
WidthMask = 255;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FRawPageTexture::~FRawPageTexture ()
|
||||
{
|
||||
Unload ();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void FRawPageTexture::Unload ()
|
||||
{
|
||||
if (Pixels != NULL)
|
||||
|
|
@ -150,6 +213,12 @@ void FRawPageTexture::Unload ()
|
|||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
const BYTE *FRawPageTexture::GetColumn (unsigned int column, const Span **spans_out)
|
||||
{
|
||||
if (Pixels == NULL)
|
||||
|
|
@ -167,6 +236,12 @@ const BYTE *FRawPageTexture::GetColumn (unsigned int column, const Span **spans_
|
|||
return Pixels + column*Height;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
const BYTE *FRawPageTexture::GetPixels ()
|
||||
{
|
||||
if (Pixels == NULL)
|
||||
|
|
@ -176,6 +251,12 @@ const BYTE *FRawPageTexture::GetPixels ()
|
|||
return Pixels;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void FRawPageTexture::MakeTexture ()
|
||||
{
|
||||
FMemLump lump = Wads.ReadLump (SourceLump);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue