Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RtPITexD
[Texture Dictionaries]


Functions

RwUInt32  RtPITexDictionaryStreamGetSize (const RwTexDictionary *texDict)
RwTexDictionary RtPITexDictionaryStreamRead (RwStream *stream)
RwTexDictionary RtPITexDictionaryStreamWrite (RwTexDictionary *texDict, RwStream *stream)

Detailed Description

Platform Independent Texture Dictionaries

RtPITexD Toolkit Overview

Requirements

Overview

The RtPITexD toolkit provides reading and writing functions for Platform Independent Texture Dictionaries.

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:

The toolkit API mirrors that for streaming platform specific texture dictionaries.

Function Documentation

RwUInt32 RtPITexDictionaryStreamGetSize const RwTexDictionary   texDict
 

RtPITexDictionaryStreamGetSize returns the size, in bytes, of the platform independent texture dictionary binary that can be created from the specified RwTexDictionary.

Parameters:
texDict  Pointer to a constant RwTexDictionary.
Returns:
RwUInt32 containing the size, in bytes, of the platform independent texture dictionary, or zero if there was an error.
See also:
RwTexDictionaryStreamGetSize
RwTexDictionary* RtPITexDictionaryStreamRead RwStream   stream
 

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);
   }
Parameters:
stream  Pointer to RwStream that is open for read access and contains a platform independent texture dictionary.
Returns:
Pointer to the RwTexDictionary that is created from the platform independent texture dictionary in the RwStream, or NULL if there was an error.
See also:
RtPITexDictionaryStreamWrite , RtPITexDictionaryStreamGetSize , RwStreamOpen , RwStreamClose , RwStreamFindChunk
RwTexDictionary* RtPITexDictionaryStreamWrite RwTexDictionary   texDict,
RwStream   stream
 

RtPITexDictionaryStreamWrite writes a platform dependent RwTexDictionary to a currently open RwStream as a platform independent texture dictionary.

Parameters:
texDict  Pointer to RwTexDictionary to convert to a platform independent texture dictionary.
stream  Pointer to a currently open RwStream that can be written to.
Returns:
Pointer to the RwTexDictionary passed to this function, or NULL if there was an error.

Criterion Software © 1993-2003 Criterion Software Limited. All rights reserved. Built Tue Apr 22 12:46:59 2003. Send Feedback
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)