wavelength 1.0.0
Loading...
Searching...
No Matches
RndTex Class Reference

Texture, a bitmap loaded from a file or rendered to. More...

#include <rndtex.h>

Inheritance diagram for RndTex:
Collaboration diagram for RndTex:

Public Member Functions

 RndTex (const char *pszName)
 Construct an empty 32-bit texture without a file.
 ~RndTex () override
 Release the bitmap.
void * operator new (size_t nSize)
 Allocate a texture, billed to the class name.
void operator delete (void *pBlock)
 Release a texture.
void DumpText (PrnStream &stream) override
 Write a description of the texture, and of its bitmap at a dump level of 2 or more.
void Save (BinStream &stream) override
 Write the texture.
void Replace (RndObject *pFrom, RndObject *pTo) override
 Do nothing, for a texture refers to no object.
const char * ClassName () const override
 Report the class name.
void Copy (const RndObject *pSource, int nFlags) override
 Copy the size, the format, and the file of another texture, then load the bitmap again.
void Load (BinStream &stream) override
 Read what Save() wrote, or an earlier version of it, then load the bitmap.
virtual RndBitmap * LockBitmap (int nFlags)
 Give access to the bitmap.
virtual void UnlockBitmap ()
 End an access LockBitmap() gave.
virtual void SyncBitmap ()
 Load the bitmap from the file, or allocate a blank one of the size and the format when there is no file.
virtual void ResetBitmap ()
 Release the bitmap.
void SetBitmap (int nWidth, int nHeight, int nBpp, const FilePath &file, int nMipMapK, int nRendered)
 Set the size, the format, and the file, then load the bitmap.
bool CheckSize ()
 Report whether the size and the format are valid, with a notice when they are not unless a dimension is 0.
const FilePath & GetFile () const
int GetHeight () const
int GetMipMapK () const
int GetWidth () const
Public Member Functions inherited from RndObject
 RndObject (const char *pszName)
 Construct an object and register it under a name.
virtual ~RndObject ()
 Notify every referrer, then erase the registration.
void SetName (const char *pszName)
 Register the object under a different name.
void AddRef (RndObject *pReferrer)
 Register an object as a store of a pointer to this one.
void RemoveRef (RndObject *pReferrer)
 Drop the first registration AddRef() made for a referrer.
const char * GetName () const
const std::list< RndObject * > & GetRefs () const
int GetInternal () const
void SetInternal (int nInternal)

Static Public Member Functions

static const char * CheckDim (int nSize)
 Report what is wrong with a texture dimension.
static RndObject * New (const char *pszName)
 Create a texture.

Static Public Attributes

static const char * sClassName
 The class name a .rnd file writes, Tex.
static int sRev
 The format version Save() writes and Load() accepts.
Static Public Attributes inherited from RndObject
static constexpr int kCopyChildLists = 0x200
 The bit of the Copy() flags that copies the child lists of the mix-ins.

Protected Attributes

RndBitmap mBitmap
int mMipMapK
int mRendered
int mWidth
int mHeight
int mBpp
FilePath mFile
Protected Attributes inherited from RndObject
std::list< RndObject * > mRefs
String mName

Detailed Description

Texture, a bitmap loaded from a file or rendered to.

The RTTI includes the class name and records RndObject as the one base.

Constructor & Destructor Documentation

◆ RndTex()

RndTex::RndTex ( const char * pszName)
explicit

Construct an empty 32-bit texture without a file.

Parameters
pszNameThe registry key.
Ghidra address:
NTSC-U/C: 0x00240eb8
Ghidra address:
PAL: 0x002499e8

◆ ~RndTex()

RndTex::~RndTex ( )
override

Release the bitmap.

Ghidra address:
NTSC-U/C: 0x003910b0
Ghidra address:
PAL: 0x003ff7b8

Member Function Documentation

◆ operator new()

void * RndTex::operator new ( size_t nSize)
inline

Allocate a texture, billed to the class name.

Parameters
nSizeThe object size the compiler supplies.
Returns
The block.

◆ operator delete()

void RndTex::operator delete ( void * pBlock)
inline

Release a texture.

Parameters
pBlockThe block.

◆ DumpText()

void RndTex::DumpText ( PrnStream & stream)
overridevirtual

Write a description of the texture, and of its bitmap at a dump level of 2 or more.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x00241218
Ghidra address:
PAL: 0x00249d48

Reimplemented from RndObject.

◆ Save()

void RndTex::Save ( BinStream & stream)
overridevirtual

Write the texture.

Parameters
streamThe stream to write to.
Ghidra address:
NTSC-U/C: 0x00241378
Ghidra address:
PAL: 0x00249ea8

Implements RndObject.

◆ Replace()

void RndTex::Replace ( RndObject * pFrom,
RndObject * pTo )
inlineoverridevirtual

Do nothing, for a texture refers to no object.

Parameters
pFromThe object being replaced.
pToThe replacement, or null.
Ghidra address:
NTSC-U/C: 0x00391098
Ghidra address:
PAL: 0x003ff7a0

Implements RndObject.

◆ ClassName()

const char * RndTex::ClassName ( ) const
inlineoverridevirtual

Report the class name.

Returns
sClassName.
Ghidra address:
NTSC-U/C: 0x003910a0
Ghidra address:
PAL: 0x003ff7a8

Implements RndObject.

◆ Copy()

void RndTex::Copy ( const RndObject * pSource,
int nFlags )
overridevirtual

Copy the size, the format, and the file of another texture, then load the bitmap again.

Parameters
pSourceThe texture to copy from.
nFlagsThe set of fields to copy.
Ghidra address:
NTSC-U/C: 0x00241728
Ghidra address:
PAL: 0x0024a230

Implements RndObject.

◆ Load()

void RndTex::Load ( BinStream & stream)
overridevirtual

Read what Save() wrote, or an earlier version of it, then load the bitmap.

An early version's flag word becomes a file name suffix where one exists.

Parameters
streamThe stream to read from.
Ghidra address:
NTSC-U/C: 0x00241460
Ghidra address:
PAL: 0x00249f80

Implements RndObject.

◆ LockBitmap()

virtual RndBitmap * RndTex::LockBitmap ( int nFlags)
inlinevirtual

Give access to the bitmap.

The base body ignores the flags. The name is inferred.

Parameters
nFlagsThe access the caller needs.
Returns
The bitmap.
Ghidra address:
NTSC-U/C: 0x00391088
Ghidra address:
PAL: 0x003ff790

Reimplemented in PsTex.

◆ UnlockBitmap()

virtual void RndTex::UnlockBitmap ( )
inlinevirtual

End an access LockBitmap() gave.

The base body does nothing. The name is inferred.

Ghidra address:
NTSC-U/C: 0x00391090
Ghidra address:
PAL: 0x003ff798

Reimplemented in PsTex.

◆ SyncBitmap()

virtual void RndTex::SyncBitmap ( )
virtual

Load the bitmap from the file, or allocate a blank one of the size and the format when there is no file.

An invalid size leaves the bitmap empty. The name is inferred.

Ghidra address:
NTSC-U/C: 0x00241140
Ghidra address:
PAL: 0x00249c70

Reimplemented in PsTex.

◆ ResetBitmap()

virtual void RndTex::ResetBitmap ( )
virtual

Release the bitmap.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x002411f8
Ghidra address:
PAL: 0x00249d28

Reimplemented in PsTex.

◆ SetBitmap()

void RndTex::SetBitmap ( int nWidth,
int nHeight,
int nBpp,
const FilePath & file,
int nMipMapK,
int nRendered )

Set the size, the format, and the file, then load the bitmap.

Parameters
nWidthThe width.
nHeightThe height.
nBppThe bits per pixel.
fileThe file, or an empty path for none.
nMipMapKThe mipmap distance factor.
nRenderedNon-zero for a texture rendered to.
Ghidra address:
NTSC-U/C: 0x00240f50
Ghidra address:
PAL: 0x00249a80

◆ CheckDim()

const char * RndTex::CheckDim ( int nSize)
static

Report what is wrong with a texture dimension.

Parameters
nSizeThe dimension.
Returns
A notice format with one s for the name, or null for a valid dimension.
Ghidra address:
NTSC-U/C: 0x00241000
Ghidra address:
PAL: 0x00249b30

◆ CheckSize()

bool RndTex::CheckSize ( )

Report whether the size and the format are valid, with a notice when they are not unless a dimension is 0.

Returns
Whether they are valid.
Ghidra address:
NTSC-U/C: 0x00241080
Ghidra address:
PAL: 0x00249bb0

◆ New()

RndObject * RndTex::New ( const char * pszName)
inlinestatic

Create a texture.

Parameters
pszNameThe registry key.
Returns
The texture.
Ghidra address:
NTSC-U/C: 0x00391120
Ghidra address:
PAL: 0x003ff828

◆ GetFile()

const FilePath & RndTex::GetFile ( ) const
inline
Returns
The file the bitmap loads from.

◆ GetHeight()

int RndTex::GetHeight ( ) const
inline
Returns
Height in pixels.

◆ GetMipMapK()

int RndTex::GetMipMapK ( ) const
inline
Returns
The mipmap distance factor.

◆ GetWidth()

int RndTex::GetWidth ( ) const
inline
Returns
Width in pixels.

Member Data Documentation

◆ sClassName

const char* RndTex::sClassName
static

The class name a .rnd file writes, Tex.

Ghidra address:
NTSC-U/C: 0x003b0a48
Ghidra address:
PAL: 0x0042f8e0

◆ sRev

int RndTex::sRev
static

The format version Save() writes and Load() accepts.

Ghidra address:
NTSC-U/C: 0x003b0a4c

◆ mBitmap

RndBitmap RndTex::mBitmap
protected

The bitmap.

◆ mMipMapK

int RndTex::mMipMapK
protected

The mipmap distance factor.

◆ mRendered

int RndTex::mRendered
protected

Non-zero for a texture rendered to.

◆ mWidth

int RndTex::mWidth
protected

Width in pixels.

◆ mHeight

int RndTex::mHeight
protected

Height in pixels.

◆ mBpp

int RndTex::mBpp
protected

Bits per pixel.

◆ mFile

FilePath RndTex::mFile
protected

The file the bitmap loads from.


The documentation for this class was generated from the following file: