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