| 180 | } |
| 181 | |
| 182 | void ItemData::packData(BitStream* stream) |
| 183 | { |
| 184 | Parent::packData(stream); |
| 185 | stream->writeFloat(friction, 10); |
| 186 | stream->writeFloat(elasticity, 10); |
| 187 | stream->writeFlag(sticky); |
| 188 | if(stream->writeFlag(gravityMod != 1.0)) |
| 189 | stream->writeFloat(gravityMod, 10); |
| 190 | if(stream->writeFlag(maxVelocity != -1)) |
| 191 | stream->write(maxVelocity); |
| 192 | |
| 193 | if(stream->writeFlag(lightType != Item::NoLight)) |
| 194 | { |
| 195 | AssertFatal(Item::NumLightTypes < (1 << 2), "ItemData: light type needs more bits"); |
| 196 | stream->writeInt(lightType, 2); |
| 197 | stream->writeFloat(lightColor.red, 7); |
| 198 | stream->writeFloat(lightColor.green, 7); |
| 199 | stream->writeFloat(lightColor.blue, 7); |
| 200 | stream->writeFloat(lightColor.alpha, 7); |
| 201 | stream->write(lightTime); |
| 202 | stream->write(lightRadius); |
| 203 | stream->writeFlag(lightOnlyStatic); |
| 204 | } |
| 205 | |
| 206 | stream->writeFlag(simpleServerCollision); |
| 207 | } |
| 208 | |
| 209 | void ItemData::unpackData(BitStream* stream) |
| 210 | { |
nothing calls this directly
no test coverage detected