MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / packData

Method packData

Engine/source/afx/ce/afxLightBase_T3D.cpp:161–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161void afxT3DLightBaseData::packData(BitStream* stream)
162{
163 Parent::packData(stream);
164
165 // note: BitStream's overloaded write() for LinearColorF will convert
166 // to ColorI for transfer and then back to LinearColorF. This is fine
167 // for most color usage but for lighting colors we want to preserve
168 // "pushed" color values which may be greater than 1.0 so the color
169 // is instead sent as individual color primaries.
170 stream->write( mColor.red );
171 stream->write( mColor.green );
172 stream->write( mColor.blue );
173
174 stream->write( mBrightness );
175 stream->writeFlag( mCastShadows );
176 stream->write( mAnimState.animationPeriod );
177 stream->write( mAnimState.animationPhase );
178 stream->write( mFlareScale );
179
180 writeDatablockID(stream, mAnimationData, mPacked);
181 writeDatablockID(stream, mFlareData, mPacked);
182}
183
184void afxT3DLightBaseData::unpackData(BitStream* stream)
185{

Callers

nothing calls this directly

Calls 3

writeDatablockIDFunction · 0.85
writeMethod · 0.45
writeFlagMethod · 0.45

Tested by

no test coverage detected