Serializes the input events into the demo file from vectors to strings
| 276 | |
| 277 | // Serializes the input events into the demo file from vectors to strings |
| 278 | vector<s32> serializeInputs(Stream* stream, vector<s32> inputList, bool writeFlag) |
| 279 | { |
| 280 | s32 keySize = 0; |
| 281 | string keyString; |
| 282 | |
| 283 | // The Vector would consist of the key codes for the input events |
| 284 | // Or it will contain the mouse positions along with yaw/pitch/roll |
| 285 | |
| 286 | if (writeFlag) |
| 287 | { |
| 288 | keyString = convertToString(inputList); |
| 289 | keySize = (s32)keyString.size(); |
| 290 | } |
| 291 | |
| 292 | SERIALIZE(ReplayVersionInit, keySize, 0); |
| 293 | if (!writeFlag) |
| 294 | { |
| 295 | keyString.resize(keySize); |
| 296 | } |
| 297 | |
| 298 | SERIALIZE_BUF(ReplayVersionInit, &keyString[0], keySize); |
| 299 | |
| 300 | if (!writeFlag && keySize > 0) |
| 301 | { |
| 302 | return convertFromString(keyString); |
| 303 | } |
| 304 | return inputList; |
| 305 | } |
| 306 | |
| 307 | void storePDAPosition(Vec2i pos) |
| 308 | { |
no test coverage detected