Differences From Artifact [b5a43a0cf0]:
- File
src/savegamedemo.mm
— part of check-in
[489124a92f]
at
2025-03-16 10:11:39
on branch trunk
— Use one autorelease pool per frame
This way, nowhere else autorelease pools need to be managed. (user: js, size: 12136) [annotate] [blame] [check-ins using]
To Artifact [58839045b8]:
- File src/savegamedemo.mm — part of check-in [4b002822f9] at 2025-03-20 16:04:35 on branch trunk — Convert entity to a class (user: js, size: 12143) [annotate] [blame] [check-ins using]
1 2 3 4 5 6 7 8 9 10 11 12 13 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | + | // loading and saving of savegames & demos, dumps the spawn state of all // mapents, the full state of all dynents (monsters + player) #include "cube.h" #import "DynamicEntity.h" #import "Entity.h" #ifdef OF_BIG_ENDIAN static const int islittleendian = 0; #else static const int islittleendian = 1; #endif |
︙ | |||
105 106 107 108 109 110 111 | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | - - + + + | OFData *data = [player1 dataBySerializing]; gzputi(data.count); char map[_MAXDEFSTR] = { 0 }; memcpy(map, getclientmap().UTF8String, min(getclientmap().UTF8StringLength, _MAXDEFSTR - 1)); gzwrite(f, map, _MAXDEFSTR); gzputi(gamemode); |
︙ | |||
201 202 203 204 205 206 207 | 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | - + - - - - - + + + + + + + | void loadgamerest() { if (demoplayback || !f) return; |
︙ |