26 explicit RndTex(
const char *pszName);
42 void *
operator new(
size_t nSize) {
51 void operator delete(
void *pBlock) {
175 SetBitmap(
int nWidth,
int nHeight,
int nBpp,
const FilePath &file,
int nMipMapK,
int nRendered);
206 return new RndTex(pszName);
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
Path of a file, kept relative to a shared root directory.
Definition filepath.h:14
Text output stream.
Definition prnstream.h:16
Pixel rectangle with an optional palette and a chain of smaller mipmaps.
Definition rndbitmap.h:16
RndObject(const char *pszName)
Construct an object and register it under a name.
int mWidth
Definition rndtex.h:251
virtual void UnlockBitmap()
End an access LockBitmap() gave.
Definition rndtex.h:138
void Save(BinStream &stream) override
Write the texture.
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.
int GetWidth() const
Definition rndtex.h:240
~RndTex() override
Release the bitmap.
void Replace(RndObject *pFrom, RndObject *pTo) override
Do nothing, for a texture refers to no object.
Definition rndtex.h:81
const char * ClassName() const override
Report the class name.
Definition rndtex.h:91
int mHeight
Definition rndtex.h:253
bool CheckSize()
Report whether the size and the format are valid, with a notice when they are not unless a dimension ...
void Load(BinStream &stream) override
Read what Save() wrote, or an earlier version of it, then load the bitmap.
const FilePath & GetFile() const
Definition rndtex.h:225
static int sRev
The format version Save() writes and Load() accepts.
Definition rndtex.h:222
void DumpText(PrnStream &stream) override
Write a description of the texture, and of its bitmap at a dump level of 2 or more.
RndBitmap mBitmap
Definition rndtex.h:245
static const char * CheckDim(int nSize)
Report what is wrong with a texture dimension.
static const char * sClassName
The class name a .rnd file writes, Tex.
Definition rndtex.h:215
void Copy(const RndObject *pSource, int nFlags) override
Copy the size, the format, and the file of another texture, then load the bitmap again.
int GetMipMapK() const
Definition rndtex.h:235
int mMipMapK
Definition rndtex.h:247
FilePath mFile
Definition rndtex.h:257
static RndObject * New(const char *pszName)
Create a texture.
Definition rndtex.h:205
virtual RndBitmap * LockBitmap(int nFlags)
Give access to the bitmap.
Definition rndtex.h:126
int GetHeight() const
Definition rndtex.h:230
int mBpp
Definition rndtex.h:255
virtual void SyncBitmap()
Load the bitmap from the file, or allocate a blank one of the size and the format when there is no fi...
RndTex(const char *pszName)
Construct an empty 32-bit texture without a file.
int mRendered
Definition rndtex.h:249
void * PoolMemAlloc(int nSize, const char *pszTag, int nAlign)
Allocate a block from the pool heaps and bill it to a tag.
void PoolMemFree(void *pBlock)
Return a block PoolMemAlloc() handed out to the pool heap that owns it.