Functions |
|
RwUInt32 | RtPITexDictionaryStreamGetSize (const RwTexDictionary *texDict) |
RwTexDictionary * | RtPITexDictionaryStreamRead (RwStream *stream) |
RwTexDictionary * | RtPITexDictionaryStreamWrite (RwTexDictionary *texDict, RwStream *stream) |
A RenderWare Graphics RwTexDictionary contains platform specific data for every texture that it holds. Thus, when such an object is streamed to disk it will no longer be valid on other platforms.
To aid portability, this toolkit can be used to stream platform independent texture dictionaries to disk. These write RwImage's rather than platform specific data.
When a platform independent texture dictionary is streamed out to disk, all mipmap levels for each RwTexture are also streamed, each as RwImage's. Similarly, all mipmap levels are streamed in when the platform independent texture dictionary is read.
In addition, gamma correction is removed from the images before streaming out to disk, and re-applied when the platform independent texture dictionary is streamed back in.
As of RenderWare Graphics 3.5, texture plugin extension data is also streamed with each RwTexture. When streaming in a platform independent texture dictionary, it is therefore required to have previously attached all plugins that have extension data in the textures, otherwise the extension data will be lost. Legacy platform independent texture dictionaries can still be streamed in.
There is a limit of 65536 textures in any one platform independent texture dictionary.
To distinguish between platform specific and platform independent texture dictionaries, the chunk header of an RwStream must be identified:
|
RtPITexDictionaryStreamGetSize returns the size, in bytes, of the platform independent texture dictionary binary that can be created from the specified RwTexDictionary.
|
|
RtPITexDictionaryStreamRead reads a platform independent texture dictionary from a currently open RwStream and converts it to a platform dependent RwTexDictionary. The sequence to locate and read platform independent texture dictionary from a binary stream is as follows: RwStream *stream; RwTexDictionary *newPITexDictionary; stream = RwStreamOpen(rwSTREAMFILENAME, rwSTREAMREAD, "mybinary.xxx"); if( stream ) { if( RwStreamFindChunk(stream, rwID_PITEXDICTIONARY, NULL, NULL) ) { newPITexDictionary = RtPITexDictionaryStreamRead(stream); } RwStreamClose(stream, NULL); }
|
|
RtPITexDictionaryStreamWrite writes a platform dependent RwTexDictionary to a currently open RwStream as a platform independent texture dictionary.
|
Converted from CHM to HTML with chm2web Pro 2.85 (unicode) |