|
Public Types | |
typedef StubTypeT | StubType |
typedef AtlasBaseTOC< StubTypeT > | Parent |
typedef Parent::ChunkType | ChunkType |
Bring the chunk type in as a local typedef to save indirection. | |
Public Member Functions | |
AtlasResourceTOC () | |
virtual void | instateLoadedChunk (StubType *stub, ChunkType *chunk) |
Instate a loaded chunk into a stub. | |
virtual void | purgeStub (StubType *stub) |
Purge a stub's chunk. Forcibly remove a stub's paged data from memory. | |
virtual void | instateNewChunk (StubType *stub, ChunkType *chunk, bool blockTillSerialized=false) |
Instate a new chunk into a stub. | |
virtual void | cbPostBackToAtlasFile (U32 key, AtlasDeferredIO *adio) |
Internal callback to indicate to the AtlasFile that we have a pending deserialize. | |
virtual void | generate (RectI invalidationRegion) |
Regenerate all the chunks that overlap with the invalidated region. | |
virtual void | immediateLoad (StubType *stub, U32 reason) |
Forcibly load a file immediately. | |
virtual void | requestLoad (StubType *stub, U32 reason, F32 priority) |
Called by an instance TOC when load requests are made. | |
virtual void | cancelLoadRequest (StubType *stub, U32 reason) |
Called by an instance TOC when load requests are cancelled. | |
virtual bool | write (Stream *s) |
Write the whole TOC to a stream. | |
virtual bool | read (Stream *s) |
Read the whole TOC from a stream. | |
void | queueStubUpdate (StubType *t) |
Reserialize the passed stub to disk. | |
void | recalculateUpdates (Vector< AtlasReadNote * > &list, U32 maxItems) |
Fill provided vector with up to maxItems load requests for this TOC, sorted by priority. | |
virtual void | dumpStubLoadStatus (U32 stubIdx) |
Used to dump the load request status of the specified stub. | |
AtlasChunk * | constructNewChunk () |
Construct a new chunk of the apropriate type and link it to this TOC. | |
U32 | getFormatVersion () |
Return the current file format version; ie, the version we loaded. | |
virtual bool | copyFromTOC (AtlasResourceTOC< StubType > *toc) |
Copy ourselves from the specified TOC. | |
virtual bool | copyChunksToTOC (AtlasResourceTOC< StubType > *toc, S32 reformat=-1) |
Copy all of our chunks to another TOC. | |
virtual void | getIOStatus (AtlasFile::IOStatus::TOCIOStatus &status) |
Fill in the TOC I/O status structure. | |
Static Public Member Functions | |
static S32 | updateStubSortFunc (const void *a, const void *b) |
Sort function for recalculateUpdates(). | |
Static Public Attributes | |
static const U32 | csmVersion = 160 |
Atlas file version. | |
Protected Member Functions | |
virtual void | cbOnChunkWriteComplete (U32 key, AtlasDeferredIO *adio) |
virtual void | cbOnStubWriteComplete (U32 key, AtlasDeferredIO *adio) |
virtual void | cbOnChunkReadComplete (U32 key, AtlasChunk *adio) |
virtual void | cbOnChunkReadStarted (U32 stubIdx) |
virtual void | cbPopulateChunkReadNote (AtlasReadNote *arn) |
virtual void | queueChunkUpdate (StubType *t) |
virtual void | syncCallback (const F32 deltaTime) |
This gets called back from AtlasFile::syncThreads, with time in seconds since last call. | |
Protected Attributes | |
U32 | mVersion |
Version of file format that we read from. | |
Vector< StubType * > | mLoadQueue |
Outstanding load requests. | |
U32 | mNumStubsLoading |
Number of stubs currently in loading state. | |
U32 | mNumChunksDeadOnArrival |
Number of stubs that no longer needed their chunk data when it finally arrived. | |
U32 | mNumBytesPending |
Number of chunk bytes in pending state. | |
U32 | mNumBytesLoading |
Number of chunk bytes in loading state. |
typedef StubTypeT AtlasResourceTOC< StubTypeT >::StubType |
typedef AtlasBaseTOC<StubTypeT> AtlasResourceTOC< StubTypeT >::Parent |
Reimplemented in AtlasResourceConfigTOC, AtlasResourceGeomTOC, and AtlasResourceTexTOC.
typedef Parent::ChunkType AtlasResourceTOC< StubTypeT >::ChunkType |
Bring the chunk type in as a local typedef to save indirection.
Reimplemented from AtlasBaseTOC< StubTypeT >.
AtlasResourceTOC< StubTypeT >::AtlasResourceTOC | ( | ) | [inline] |
void AtlasResourceTOC< StubType >::cbOnChunkWriteComplete | ( | U32 | key, | |
AtlasDeferredIO * | adio | |||
) | [inline, protected, virtual] |
Reimplemented from AtlasTOC.
void AtlasResourceTOC< StubType >::cbOnStubWriteComplete | ( | U32 | key, | |
AtlasDeferredIO * | adio | |||
) | [inline, protected, virtual] |
Reimplemented from AtlasTOC.
void AtlasResourceTOC< StubType >::cbOnChunkReadComplete | ( | U32 | key, | |
AtlasChunk * | adio | |||
) | [inline, protected, virtual] |
Reimplemented from AtlasTOC.
void AtlasResourceTOC< StubType >::cbOnChunkReadStarted | ( | U32 | stubIdx | ) | [inline, protected, virtual] |
Reimplemented from AtlasTOC.
void AtlasResourceTOC< StubType >::cbPopulateChunkReadNote | ( | AtlasReadNote * | arn | ) | [inline, protected, virtual] |
Reimplemented from AtlasTOC.
void AtlasResourceTOC< StubType >::queueChunkUpdate | ( | StubType * | t | ) | [inline, protected, virtual] |
virtual void AtlasResourceTOC< StubTypeT >::syncCallback | ( | const F32 | deltaTime | ) | [inline, protected, virtual] |
This gets called back from AtlasFile::syncThreads, with time in seconds since last call.
It's useful for updating things like heat.
Reimplemented from AtlasTOC.
void AtlasResourceTOC< StubType >::instateLoadedChunk | ( | StubType * | stub, | |
ChunkType * | chunk | |||
) | [inline, virtual] |
Instate a loaded chunk into a stub.
TOCs may want to perform callbacks or other book-keeing when a chunk is loaded, and this method provides a hook for that behavior.
void AtlasResourceTOC< StubType >::purgeStub | ( | StubType * | stub | ) | [inline, virtual] |
Purge a stub's chunk. Forcibly remove a stub's paged data from memory.
void AtlasResourceTOC< StubType >::instateNewChunk | ( | StubType * | stub, | |
ChunkType * | chunk, | |||
bool | blockTillSerialized = false | |||
) | [inline, virtual] |
Instate a new chunk into a stub.
This queues the provided chunk for serialization, as well as the stub.
void AtlasResourceTOC< StubType >::cbPostBackToAtlasFile | ( | U32 | key, | |
AtlasDeferredIO * | adio | |||
) | [inline, virtual] |
void AtlasResourceTOC< StubType >::generate | ( | RectI | invalidationRegion | ) | [inline, virtual] |
void AtlasResourceTOC< StubType >::immediateLoad | ( | StubType * | stub, | |
U32 | reason | |||
) | [inline, virtual] |
Forcibly load a file immediately.
Will cause a reload if the stub already has a chunk loaded.
void AtlasResourceTOC< StubType >::requestLoad | ( | StubType * | stub, | |
U32 | reason, | |||
F32 | priority | |||
) | [inline, virtual] |
Called by an instance TOC when load requests are made.
void AtlasResourceTOC< StubType >::cancelLoadRequest | ( | StubType * | stub, | |
U32 | reason | |||
) | [inline, virtual] |
Called by an instance TOC when load requests are cancelled.
bool AtlasResourceTOC< StubType >::write | ( | Stream * | s | ) | [inline, virtual] |
Write the whole TOC to a stream.
Reimplemented from AtlasTOC.
Reimplemented in AtlasResourceGeomTOC.
bool AtlasResourceTOC< StubType >::read | ( | Stream * | s | ) | [inline, virtual] |
Read the whole TOC from a stream.
Reimplemented from AtlasTOC.
Reimplemented in AtlasResourceGeomTOC.
void AtlasResourceTOC< StubType >::queueStubUpdate | ( | StubType * | t | ) | [inline] |
Reserialize the passed stub to disk.
static S32 AtlasResourceTOC< StubTypeT >::updateStubSortFunc | ( | const void * | a, | |
const void * | b | |||
) | [inline, static] |
Sort function for recalculateUpdates().
void AtlasResourceTOC< StubType >::recalculateUpdates | ( | Vector< AtlasReadNote * > & | list, | |
U32 | maxItems | |||
) | [inline, virtual] |
void AtlasResourceTOC< StubType >::dumpStubLoadStatus | ( | U32 | stubIdx | ) | [inline, virtual] |
AtlasChunk* AtlasResourceTOC< StubTypeT >::constructNewChunk | ( | ) | [inline, virtual] |
U32 AtlasResourceTOC< StubTypeT >::getFormatVersion | ( | ) | [inline] |
Return the current file format version; ie, the version we loaded.
virtual bool AtlasResourceTOC< StubTypeT >::copyFromTOC | ( | AtlasResourceTOC< StubType > * | toc | ) | [inline, virtual] |
Copy ourselves from the specified TOC.
This only copies stubs; chunks are handled separately.
virtual bool AtlasResourceTOC< StubTypeT >::copyChunksToTOC | ( | AtlasResourceTOC< StubType > * | toc, | |
S32 | reformat = -1 | |||
) | [inline, virtual] |
Copy all of our chunks to another TOC.
reformat | Optional parameter to request a reformat of the transferred data. This is passed to generateCopy. |
virtual void AtlasResourceTOC< StubTypeT >::getIOStatus | ( | AtlasFile::IOStatus::TOCIOStatus & | status | ) | [inline, virtual] |
U32 AtlasResourceTOC< StubTypeT >::mVersion [protected] |
Version of file format that we read from.
Vector<StubType*> AtlasResourceTOC< StubTypeT >::mLoadQueue [protected] |
Outstanding load requests.
U32 AtlasResourceTOC< StubTypeT >::mNumStubsLoading [protected] |
Number of stubs currently in loading state.
U32 AtlasResourceTOC< StubTypeT >::mNumChunksDeadOnArrival [protected] |
Number of stubs that no longer needed their chunk data when it finally arrived.
U32 AtlasResourceTOC< StubTypeT >::mNumBytesPending [protected] |
Number of chunk bytes in pending state.
U32 AtlasResourceTOC< StubTypeT >::mNumBytesLoading [protected] |
Number of chunk bytes in loading state.
const U32 AtlasResourceTOC< StubTypeT >::csmVersion = 160 [static] |
Atlas file version.
For now we just increment a global counter for each revision of the file format.
101 - Stored bounding box for geom stubs, instead of min/max. Also stored bounds in the chunk.
120 - Added collision information to AtlasGeomChunk.
130 - Reordered vertex data to match order of structure.
140 - Added normals to AGC.
150 - added multi-layer AtlasTexChunks to support >4 blend layers.
160 - removed geomorphing information.