TSShapeAlloc

Engine/source/ts/tsShapeAlloc.h

Alloc structure used in the reading/writing of shapes.

More...

Public Types

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

Private Attributes

S8 *

reading only...this is the output

S32 *

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

reading and writing...

read or write

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

for writing only...

Public Functions

align on dword boundary

setRead(S32 * buff32, S16 * buff16, S8 * buff8, bool clear)
setSkipMode(bool skip)

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

@209

Enumerator

ReadMode = 0
WriteMode = 1
PageSize = 1024

Private Attributes

S8 * mDest 

reading only...this is the output

S32 mFullSize16 
S32 mFullSize32 
S32 mFullSize8 
S16 * mMemBuffer16 
S32 * mMemBuffer32 

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

S8 * mMemBuffer8 
S16 mMemGuard16 
S32 mMemGuard32 

reading and writing...

S8 mMemGuard8 
S32 mMode 

read or write

S32 mMult 

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

S16 mSaveGuard16 
S32 mSaveGuard32 

reading

S8 mSaveGuard8 
S32 mSize 
S32 mSize16 
S32 mSize32 

for writing only...

S32 mSize8 

Public Functions

align32()

align on dword boundary

checkGuard()

doAlloc()

getBuffer()

getSize()

setGuard()

setRead(S32 * buff32, S16 * buff16, S8 * buff8, bool clear)

setSkipMode(bool skip)

setWrite()