- 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:
Christoph Oelckers 2008-06-01 20:43:02 +00:00
commit 47aacc45c8
34 changed files with 1723 additions and 1091 deletions

View file

@ -38,17 +38,55 @@
#include "r_data.h"
#include "w_wad.h"
//==========================================================================
//
// A texture defined between F_START and F_END markers
//
//==========================================================================
bool FFlatTexture::Check(FileReader & file)
class FFlatTexture : public FTexture
{
return true;
}
public:
FFlatTexture (int lumpnum);
~FFlatTexture ();
FTexture *FFlatTexture::Create(FileReader & file, int lumpnum)
const BYTE *GetColumn (unsigned int column, const Span **spans_out);
const BYTE *GetPixels ();
void Unload ();
int GetSourceLump() { return SourceLump; }
protected:
int SourceLump;
BYTE *Pixels;
Span DummySpans[2];
void MakeTexture ();
friend class FTexture;
};
//==========================================================================
//
// Since there is no way to detect the validity of a flat
// they can't be used anywhere else but between F_START and F_END
//
//==========================================================================
FTexture *FlatTexture_TryCreate(FileReader & file, int lumpnum)
{
return new FFlatTexture(lumpnum);
}
//==========================================================================
//
//
//
//==========================================================================
FFlatTexture::FFlatTexture (int lumpnum)
: SourceLump(lumpnum), Pixels(0)
{
@ -78,24 +116,25 @@ FFlatTexture::FFlatTexture (int lumpnum)
DummySpans[0].Length = Height;
DummySpans[1].TopOffset = 0;
DummySpans[1].Length = 0;
/*
if (bits > 6)
{
ScaleX = ScaleY = 8 << (bits - 6);
}
else
{
ScaleX = ScaleY = 8;
}
*/
}
//==========================================================================
//
//
//
//==========================================================================
FFlatTexture::~FFlatTexture ()
{
Unload ();
}
//==========================================================================
//
//
//
//==========================================================================
void FFlatTexture::Unload ()
{
if (Pixels != NULL)
@ -105,6 +144,12 @@ void FFlatTexture::Unload ()
}
}
//==========================================================================
//
//
//
//==========================================================================
const BYTE *FFlatTexture::GetColumn (unsigned int column, const Span **spans_out)
{
if (Pixels == NULL)
@ -129,6 +174,12 @@ const BYTE *FFlatTexture::GetColumn (unsigned int column, const Span **spans_out
return Pixels + column*Height;
}
//==========================================================================
//
//
//
//==========================================================================
const BYTE *FFlatTexture::GetPixels ()
{
if (Pixels == NULL)
@ -138,6 +189,12 @@ const BYTE *FFlatTexture::GetPixels ()
return Pixels;
}
//==========================================================================
//
//
//
//==========================================================================
void FFlatTexture::MakeTexture ()
{
FWadLump lump = Wads.OpenLumpNum (SourceLump);