91 static void *
operator new(
size_t nSize);
100 static void operator delete(
void *pBlock);
118 int GetBitmapInfo(
int &nWidth,
int &nHeight,
int &nBitsPerPixel,
int &nBytes);
234 int nWidth,
int nHeight,
int nBitsPerPixel,
const HxStr &path,
int nMipSelect,
int nFlags);
457 int QueueMipRead(
const char *pszPath);
void AsyncPumpCompletedRequests()
Service the queue once.
Description of a pixel rectangle, its layout, and its palette.
Definition abitmap.h:95
Drawing surface over an ABitmap, with a clip rectangle.
Definition acanvas.h:74
A 256 entry colour table an ABitmap points at.
Definition apalette.h:31
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Sink that the engine formats its diagnostic and failure text into.
Definition dbg.h:33
File name that the renderer resolves against a shared root directory.
Definition filepath.h:24
Base of every object the renderer can load, resolve by name, and serialise.
Definition object.h:43
Object()
Construct an unnamed object.
Byte stream that every renderer object serialises itself through.
Definition stream.h:31
Texture, as a bitmap path plus the load state of its mip levels.
Definition tex.h:43
static HxStr sClassName
Registered class name of Rnd::Tex, the string "Tex".
Definition tex.h:62
int mHeight
Definition tex.h:422
virtual void Copy(const Object *pSource, unsigned nFlags)
Take the dimensions, path, mip selector, and flags of another texture and reload.
void AllocateBitmapFromStream()
Start loading the configured bitmap, or build a blank one when no path is set.
unsigned char mPendingMipMask
Definition tex.h:461
virtual void ReloadBitmaps()
Release the loaded bitmaps and start loading from the configured path again.
bool PollAsyncMips()
Advance the asynchronous mip loads and report whether any level is still outstanding.
virtual void SetPalette(APalette *pPalette, int nReserved)
Replace the palette every mip level shares.
virtual void SetGsPageInUse(bool bInUse)
Mark the texture's GS page as in use or free.
virtual void UnlockMipBitmap()
Release the mip level that LockMipBitmap() locked.
bool IsLoadComplete()
Report whether every requested mip level has finished loading.
int mMipSelect
Mip selector SetBitmapConfig() records, starting at -0x80.
Definition tex.h:468
virtual void Save(Stream &stream)
Write revision 4, the three dimensions, the path, mFlags, and mMipSelect.
TexFunc
Texture function, the GS TEX0.TFX field, which decides how a texel meets the vertex.
Definition tex.h:290
@ kTexFuncHighlight
Definition tex.h:293
@ kTexFuncHighlight2
Definition tex.h:294
@ kTexFuncModulate
Definition tex.h:291
@ kTexFuncDecal
Definition tex.h:292
void WaitForMipsLoaded()
Block until every requested mip level has arrived, pumping the asynchronous reads meanwhile.
Definition tex.h:372
std::vector< int > mMipHandles
Definition tex.h:460
virtual void RestoreSurfaces()
Rebuild whatever the texture keeps in GS memory.
virtual void OnMipLoaded(int nMip)
Take delivery of one mip level whose read has just finished.
FilePath mBitmapPath
Definition tex.h:471
const HxStr & GetRelativeBitmapPath() const
Report mBitmapPath relative to FilePath::sRoot.
virtual const HxStr & ClassName() const
Report the registered class name, "Tex".
void SetBitmapConfig(int nWidth, int nHeight, int nBitsPerPixel, const HxStr &path, int nMipSelect, int nFlags)
Point the texture at a bitmap and restart its load.
static Tex *(* sNew)(const HxStr &name)
Creator the registered "Tex" class builds through.
Definition tex.h:54
virtual void DumpText(Dbg &sink)
Write the dimensions, the mip selector, the path, and the flag names to sink.
virtual void Load(Stream &stream)
Replace this texture's configuration from stream and reload.
int mZone
Definition tex.h:475
int GetBitmapInfo(int &nWidth, int &nHeight, int &nBitsPerPixel, int &nBytes)
Report the size of mip level 0 and the bytes every loaded level occupies.
virtual void FreeLoadedBitmaps()
Release every loaded bitmap and cancel the outstanding reads.
Tex(const HxStr &name)
Construct a texture with no bitmap.
virtual ~Tex()
Free the loaded bitmaps and drop every reference to this texture.
int mBitsPerPixel
Definition tex.h:423
std::vector< ABitmap * > mLoadedBitmaps
Definition tex.h:476
int mFlags
Flag word SetBitmapConfig() records and DumpText() labels " flags:".
Definition tex.h:434
int mWidth
Definition tex.h:421
virtual ACanvas * LockMipBitmap(int nMip, int nReserved, int nFlags)
Lock the bitmap of one mip level for direct access.
void CancelPendingMips()
Cancel whatever mip reads are still outstanding and drop every mip handle.
virtual void Replace(Object *pFrom, Object *pTo)
Do nothing.
The rendering engine.
Definition animhelper.h:3
Tex * NewTex(const HxStr &name)
Allocate and construct a texture, the base creator of the "Tex" class.
Object * CreateRegisteredTex(const HxStr &name)
Build a texture for the registered "Tex" class by calling through Tex::sNew.
void RegisterTexClass()
Point Tex::sNew at NewTex() and register the "Tex" class with Rnd::Manager.
Definition tex.h:523
Manager TheManager
The renderer's object registry.
Tex * NewTexThroughHook(const HxStr &name)
Build a texture through the creator hook.