torque Torque Game Engine Documentation
TGE Version 1.5.2

TSShapeAlloc Class Reference

#include <tsShapeAlloc.h>


Detailed Description

Alloc structure used in the reading/writing of shapes.

In read mode we assemble contents of 32-bit, 16-bit, and 8-bit buffers into a single destination buffer.

In write mode we dissemble a stream of memory (which may be scattered in physical memory) into 32-bit, 16-bit, 8-bit, Point3F, and Point2F buffers using function calls similar to the read calls.

Read usage: 1. call "setRead" with each incoming memory buffers and clear=true. 2. run through set of operations for allocating and transfering memory to target buffer these are the operations under "DECLARE_ALLOC" that call readOnly in the .cc file. 3. call "doAlloc" to create buffer exactly as large as needed. 4. repeat step 1 & 2 to do the actual transfer of memory, except with clear=false (note: first time through nothing was copied to the shape, we only kept track of the size of the transfer). 5. call getBuffer to get the target (destination buffer)

write usage: 1. call "setWrite" (no parameters). 2. run through set of operations for allocating and transfering memory to internal buffers these are the operations under "DECLARE_ALLOC" that call writeOnly in the .cc file. 3. call getBuffer32 and getBufferSize32 to get 32-bit buffer and size. Similarly for 16-bit, 8-bit (getBuffer16, getBuffer8).

TSShape::assesmbleShape and TSShape::dissembleShape can be used as examples


Public Types

enum  {
  ReadMode = 0,
  WriteMode = 1,
  PageSize = 1024
}

Public Member Functions

void setRead (S32 *buff32, S16 *buff16, S8 *buff8, bool clear)
void setWrite ()
void doAlloc ()
void align32 ()
 align on dword boundary
S8getBuffer ()
S32 getSize ()
void setSkipMode (bool skip)
void checkGuard ()
void setGuard ()

Private Attributes

S32 mMode
 read or write
S32mMemBuffer32
 reading and writing (when reading these are the input; when writing these are the output)
S16mMemBuffer16
S8mMemBuffer8
S32 mSize32
 for writing only...
S32 mSize16
S32 mSize8
S32 mFullSize32
S32 mFullSize16
S32 mFullSize8
S32 mMemGuard32
 reading and writing...
S16 mMemGuard16
S8 mMemGuard8
S32 mSaveGuard32
 reading
S16 mSaveGuard16
S8 mSaveGuard8
S8mDest
 reading only...this is the output
S32 mSize
S32 mMult
 mult incoming sizes by this (when 0, then mDest doesn't grow --> skip mode)


Member Enumeration Documentation

anonymous enum

Enumerator:
ReadMode 
WriteMode 
PageSize 


Member Function Documentation

void TSShapeAlloc::setRead ( S32 buff32,
S16 buff16,
S8 buff8,
bool  clear 
)

void TSShapeAlloc::setWrite (  ) 

void TSShapeAlloc::doAlloc (  ) 

void TSShapeAlloc::align32 (  ) 

align on dword boundary

S8* TSShapeAlloc::getBuffer (  )  [inline]

S32 TSShapeAlloc::getSize (  )  [inline]

void TSShapeAlloc::setSkipMode ( bool  skip  )  [inline]

void TSShapeAlloc::checkGuard (  ) 

void TSShapeAlloc::setGuard (  ) 


Field Documentation

read or write

reading and writing (when reading these are the input; when writing these are the output)

for writing only...

reading and writing...

reading

S8* TSShapeAlloc::mDest [private]

reading only...this is the output

mult incoming sizes by this (when 0, then mDest doesn't grow --> skip mode)




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen