TSShapeAlloc
Engine/source/ts/tsShapeAlloc.h
Alloc structure used in the reading/writing of shapes.
Public Types
_Anonymous_ { ReadMode = 0 WriteMode = 1 PageSize = 1024 }
Private Attributes
S32 *
reading and writing (when reading these are the input; when writing these are the output)
reading and writing...
reading
Public Functions
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:
call "setRead" with each incoming memory buffers and clear=true.
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.
call "doAlloc" to create buffer exactly as large as needed.
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).
call getBuffer to get the target (destination buffer)
write usage:
call "setWrite" (no parameters).
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.
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