Overview
Comment: | Use ObjFW functions for memory management |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
71ebb79f8f6a5c2920c91b004bf274f9 |
User & Date: | js on 2025-03-08 03:26:23 |
Other Links: | manifest | tags |
Context
2025-03-08
| ||
03:40 | More string migration check-in: 4a87b39dfe user: js tags: trunk | |
03:26 | Use ObjFW functions for memory management check-in: 71ebb79f8f user: js tags: trunk | |
03:05 | More style cleanup check-in: 753ff34122 user: js tags: trunk | |
Changes
Modified src/Cube.mm from [b4e9c293d7] to [4d1b18c94e].
︙ | |||
341 342 343 344 345 346 347 | 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | - - - - - - - - - | OFString *msg = [OFString stringWithFormat:@"%@%@ (%s)\n", s, o, SDL_GetError()]; [Cube.sharedInstance showMessage:msg]; [OFApplication terminateWithStatus:1]; } |
︙ |
Modified src/clientgame.mm from [1adcd0a4ff] to [1b8431e6e6].
︙ | |||
96 97 98 99 100 101 102 | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | - + | d->ammo[GUN_SG] = 5; } } dynent * newdynent() // create a new blank player or monster { |
︙ | |||
181 182 183 184 185 186 187 | 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | - + - | } } } void zapdynent(dynent *&d) { |
︙ | |||
277 278 279 280 281 282 283 284 | 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | + - + - | c2sinfo(player1); // do this last, to reduce the // effective frame lag } } lastmillis = millis; } // brute force but effective way to find a free spawn spot in the map void |
︙ |
Modified src/editing.mm from [46292a408f] to [0154fefe79].
︙ | |||
243 244 245 246 247 248 249 | 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | - + - + - + | pruneundos(int maxremain) // bound memory { int t = 0; loopvrev(undos) { t += undos[i]->xs * undos[i]->ys * sizeof(sqr); if (t > maxremain) |
︙ |
Modified src/protos.h from [dbbc22637c] to [10883ae4ba].
︙ | |||
136 137 138 139 140 141 142 | 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | - | // worldocull extern void computeraytable(float vx, float vy); extern int isoccluded(float vx, float vy, float cx, float cy, float csize); // main extern void fatal(OFString *s, OFString *o = @""); |
︙ |
Modified src/rendercubes.mm from [50158effb9] to [a098c5d67b].
︙ | |||
14 15 16 17 18 19 20 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | + - + - - | glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(vertex), &verts[0].r); glTexCoordPointer(2, GL_FLOAT, sizeof(vertex), &verts[0].u); } void reallocv() { verts = |
︙ |
Modified src/rendergl.mm from [9007a349cc] to [ed4ed00e36].
︙ | |||
137 138 139 140 141 142 143 | 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 | - + | } void *scaledimg = s->pixels; if (*xs != s->w) { conoutf(@"warning: quality loss: scaling %@", IRI.string); // for voodoo cards under linux |
︙ |
Modified src/serverutil.mm from [34361918f4] to [89ca7e5bbf].
︙ | |||
104 105 106 107 108 109 110 | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | - - + + | sendmaps(int n, OFString *mapname, int mapsize, uchar *mapdata) { if (mapsize <= 0 || mapsize > 256 * 256) return; copyname = mapname; copysize = mapsize; if (copydata) |
︙ |
Modified src/tools.h from [fd4e5832e2] to [c2f36ac343].
︙ | |||
21 22 23 24 25 26 27 28 29 30 31 32 33 34 | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | + + | #include <string.h> #ifdef __GNUC__ # include <new> #else # include <new.h> #endif #import <ObjFW/ObjFW.h> #ifdef NULL # undef NULL #endif #define NULL 0 typedef unsigned char uchar; typedef unsigned short ushort; |
︙ | |||
123 124 125 126 127 128 129 | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | - + | T *buf; int alen; int ulen; vector() { alen = 8; |
︙ | |||
208 209 210 211 212 213 214 | 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 | - + | qsort(buf, ulen, sizeof(T), (int(__cdecl *)(const void *, const void *))cf); } void realloc() { |
︙ |
Modified src/world.mm from [e205b06d1f] to [2ffb0794b1].
︙ | |||
419 420 421 422 423 424 425 | 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 | - + + + - + - - | void setupworld(int factor) { ssize = 1 << (sfactor = factor); cubicsize = ssize * ssize; mipsize = cubicsize * 134 / 100; |
︙ | |||
491 492 493 494 495 496 497 | 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 | - + | block b = { 8, 8, ssize - 16, ssize - 16 }; edittypexy(SPACE, b); } calclight(); startmap(@"base/unnamed"); if (oldworld) { |
︙ |
Modified src/worldlight.mm from [2af1475366] to [6a518301f9].
︙ | |||
234 235 236 237 238 239 240 | 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | + - + | } // utility functions also used by editing code block * blockcopy(block &s) { block *b = (block *)OFAllocZeroedMemory( |
︙ |