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

Method unpackData

Engine/source/T3D/shapeImage.cpp:1180–1388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1178}
1179
1180void ShapeBaseImageData::unpackData(BitStream* stream)
1181{
1182 Parent::unpackData(stream);
1183 computeCRC = stream->readFlag();
1184 if(computeCRC)
1185 {
1186 for( U32 j=0; j<MaxShapes; ++j )
1187 {
1188 stream->read(&mCRC[j]);
1189 }
1190 }
1191
1192 for (U32 j = 0; j < MaxShapes; ++j)
1193 {
1194 UNPACKDATA_ASSET_ARRAY(Shape, j); // shape 0 for normal use, shape 1 for first person use (optional)
1195 }
1196
1197 imageAnimPrefix = stream->readSTString();
1198 imageAnimPrefixFP = stream->readSTString();
1199
1200 stream->read(&mountPoint);
1201 if (stream->readFlag())
1202 mountOffset.identity();
1203 else
1204 stream->readAffineTransform(&mountOffset);
1205 if (stream->readFlag())
1206 eyeOffset.identity();
1207 else
1208 stream->readAffineTransform(&eyeOffset);
1209
1210 animateOnServer = stream->readFlag();
1211
1212 stream->read(&scriptAnimTransitionTime);
1213
1214 useEyeNode = stream->readFlag();
1215
1216 correctMuzzleVector = stream->readFlag();
1217 correctMuzzleVectorTP = stream->readFlag();
1218 firstPerson = stream->readFlag();
1219 stream->read(&mass);
1220 usesEnergy = stream->readFlag();
1221 stream->read(&minEnergy);
1222
1223 for( U32 j=0; j<MaxShapes; ++j )
1224 {
1225 hasFlash[j] = stream->readFlag();
1226 }
1227
1228 projectile = (stream->readFlag() ?
1229 (ProjectileData*)(uintptr_t)stream->readRangedU32(DataBlockObjectIdFirst,
1230 DataBlockObjectIdLast) : 0);
1231
1232 cloakable = stream->readFlag();
1233 lightType = stream->readRangedU32(0, NumLightTypes-1);
1234 if(lightType != NoLight)
1235 {
1236 stream->read(&lightRadius);
1237 stream->read(&lightDuration);

Callers

nothing calls this directly

Calls 10

mathReadFunction · 0.85
readFlagMethod · 0.80
readAffineTransformMethod · 0.80
readRangedU32Method · 0.80
readFloatMethod · 0.80
readIntMethod · 0.80
readSignedIntMethod · 0.80
readMethod · 0.45
readSTStringMethod · 0.45
identityMethod · 0.45

Tested by

no test coverage detected