Comment: | Convert remaining files to pure Objective-C |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
12cac9666ac09097e06d34da46bf50d1 |
User & Date: | js on 2025-03-20 22:22:40 |
Other Links: | manifest | tags |
2025-03-20
| ||
22:40 | Fix all warnings check-in: 0e7605d101 user: js tags: trunk | |
22:22 | Convert remaining files to pure Objective-C check-in: 12cac9666a user: js tags: trunk | |
21:52 | Convert more files to pure Objective-C check-in: 46c5779570 user: js tags: trunk | |
Modified meson.build from [7cbc99fda4] to [09e98c7860].
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | - + - - - - - - - + + + + + + - |
|
︙ |
Modified src/entities.m from [df6381198b] to [415631efe6].
︙ | |||
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | - - + + | void initEntities() { ents = [[OFMutableArray alloc] init]; } static void |
︙ |
Renamed and modified src/init.mm [1613c5c115] to src/init.m [f9de6a81da].
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - - - + - + + - + - + - - + + - + + |
|
Modified src/meson.build from [a429d4244b] to [d01d70dfdd].
︙ | |||
25 26 27 28 29 30 31 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | - + - - - - - - + + + + + + - + - - - - - + + + + + | 'clientextras.m', 'clientgame.m', 'clients2c.m', 'commands.m', 'console.m', 'editing.m', 'entities.m', |
︙ |
Renamed and modified src/rendergl.mm [19962c058e] to src/rendergl.m [27f04a759e].
︙ | |||
248 249 250 251 252 253 254 | 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 | - - + + | curtex++; return tnum; } else { return mapping[tex][frame] = FIRSTTEX; // temp fix } } |
︙ | |||
277 278 279 280 281 282 283 | 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 | - + - + | static OFMutableData *strips; void renderstripssky() { glBindTexture(GL_TEXTURE_2D, skyoglid); |
︙ | |||
315 316 317 318 319 320 321 | 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | - + + - + | glTexEnvf(GL_TEXTURE_ENV, GL_RGB_SCALE_EXT, amount); } void addstrip(int tex, int start, int n) { if (strips == nil) |
︙ | |||
447 448 449 450 451 452 453 | 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 | - + | curvert = 0; [strips removeAllItems]; render_world(player1.o.x, player1.o.y, player1.o.z, (int)player1.yaw, (int)player1.pitch, (float)fov, w, h); finishstrips(); |
︙ |
Renamed and modified src/rendermd2.mm [10e74a7f04] to src/rendermd2.m [315b2acb14].
︙ | |||
104 105 106 107 108 109 110 | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | - + | tex ? lookuptexture(tex, &xs, &ys) : FIRSTMDL + m.mdlnum); int ix = (int)position.x; int iy = (int)position.z; OFVector3D light = OFMakeVector3D(1, 1, 1); if (!OUTBORD(ix, iy)) { |
︙ |
Renamed and modified src/renderparticles.mm [a86860234b] to src/renderparticles.m [7f852b8ad3].
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | - + - + - + | // renderparticles.cpp #include "cube.h" #import "DynamicEntity.h" const int MAXPARTICLES = 10500; const int NUMPARTCUTOFF = 20; struct particle { OFVector3D o, d; int fade, type; int millis; |
︙ | |||
82 83 84 85 86 87 88 | 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | - - + + | { 1.0f, 1.0f, 1.0f, 20, 8, 1.2f }, // blue: fireball2 { 1.0f, 1.0f, 1.0f, 20, 9, 1.2f }, // green: fireball3 { 1.0f, 0.1f, 0.1f, 0, 7, 0.2f }, // red: demotrack }; int numrender = 0; |
︙ |
Name change from src/rendertext.mm to src/rendertext.m.
Renamed and modified src/rndmap.mm [268a907b0c] to src/rndmap.m [050a1e4f8d].
︙ | |||
63 64 65 66 67 68 69 | 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | - + - + | amplitude; seed += seedstep; } return total; } void |
︙ |
Renamed and modified src/savegamedemo.mm [01e4530b16] to src/savegamedemo.m [e77568d32b].
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | - + - + - + - - + + - + - + - + - + - - + + - + | static gzFile f = NULL; bool demorecording = false; bool demoplayback = false; bool demoloading = false; static OFMutableArray<DynamicEntity *> *playerhistory; int democlientnum = 0; |
︙ | |||
322 323 324 325 326 327 328 | 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | - + | gzput(player1.armourtype); loopi(NUMGUNS) gzput(player1.ammo[i]); gzput(player1.state); gzputi(bdamage); bdamage = 0; gzputi(ddamage); if (ddamage) { |
︙ | |||
449 450 451 452 453 454 455 | 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 | - + | target.armourtype = gzget(); loopi(NUMGUNS) target.ammo[i] = gzget(); target.state = gzget(); target.lastmove = playbacktime; if ((bdamage = gzgeti())) damageblend(bdamage); if ((ddamage = gzgeti())) { |
︙ |
Renamed and modified src/serverbrowser.mm [7fbcf875ca] to src/serverbrowser.m [3cbd2b77d6].
︙ | |||
198 199 200 201 202 203 204 | 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | - + | si.sdesc = @(text); break; } } } } |
︙ |
Renamed and modified src/world.mm [8078c12089] to src/world.m [861b8a0f13].
1 2 3 4 5 6 7 8 9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | - + - + - + - + | // world.cpp: core map management stuff #include "cube.h" #import "DynamicEntity.h" #import "Entity.h" extern OFString *entnames[]; // lookup from map entities above to strings |
︙ | |||
86 87 88 89 90 91 92 | 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | - + - - + + - + - + - + | // main geometric mipmapping routine, recursively rebuild mipmaps within block // b. tries to produce cube out of 4 lower level mips as well as possible, sets // defer to 0 if mipped cube is a perfect mip, i.e. can be rendered at this mip // level indistinguishable from its constituent cubes (saves considerable // rendering time if this is possible). void |
︙ | |||
238 239 240 241 242 243 244 | 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | - + - + | s.y /= 2; s.xs /= 2; s.ys /= 2; remip(&s, level + 1); } void |
︙ | |||
429 430 431 432 433 434 435 | 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 | - + + - + - + - + - + - + | for (int i = index; i < ents.count; i++) if (ents[i].type == type) return i; loopj(index) if (ents[j].type == type) return j; return -1; } |
︙ |
Renamed and modified src/worldio.mm [402ec6ee8c] to src/worldio.m [cfdf69a801].
︙ | |||
49 50 51 52 53 54 55 | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | - + - + - - + + - + - - + + - - - + + + - - + + - - + + - + - - - - - - - + + + + + + + | // the optimize routines below are here to reduce the detrimental effects of // messy mapping by setting certain properties (vdeltas and textures) to // neighbouring values wherever there is no visible difference. This allows the // mipmapper to generate more efficient mips. the reason it is done on save is // to reduce the amount spend in the mipmapper (as that is done in realtime). inline bool |
︙ | |||
181 182 183 184 185 186 187 | 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | - + - + - + - + - + | return; } hdr.version = MAPVERSION; hdr.numents = 0; for (Entity *e in ents) if (e.type != NOTUSED) hdr.numents++; |
︙ | |||
266 267 268 269 270 271 272 | 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | - + - + | setnames(mname); gzFile f = gzopen([cgzname cStringWithEncoding:OFLocale.encoding], "rb9"); if (!f) { conoutf(@"could not read map %@", cgzname); return; } |
︙ | |||
309 310 311 312 313 314 315 | 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 | - + - + - + - + | e.attr1 = 32; // 12_03 and below } } free(world); setupworld(hdr.sfactor); char texuse[256]; loopi(256) texuse[i] = 0; |
︙ | |||
378 379 380 381 382 383 384 | 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | - + | if (!SOLID(s)) texuse[s->utex] = texuse[s->ftex] = texuse[s->ctex] = 1; } gzclose(f); calclight(); settagareas(); int xs, ys; |
︙ |
Renamed and modified src/worldlight.mm [2b192347af] to src/worldlight.m [49154c0e62].
︙ | |||
60 61 62 63 64 65 66 | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | - + | int stepb = fast_f2nat(b / (float)steps); g /= lightscale; stepg /= lightscale; b /= lightscale; stepb /= lightscale; loopi(steps) { |
︙ | |||
89 90 91 92 93 94 95 | 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | - + - + | y += stepy * dimness; if (OUTBORD(x >> PRECBITS, y >> PRECBITS)) return; loopi(steps) { |
︙ | |||
143 144 145 146 147 148 149 150 | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 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 | + - + - - + - + - + - + - - + + - + - - + + - - + + - + - + - - + + - - + + - + - + - + | lightray((float)sx, sy2, l); lightray((float)ex, sy2, l); } rndtime(); } // median filter, smooths out random noise in light and makes it more mipable void |
Name change from src/worldocull.mm to src/worldocull.m.
Renamed and modified src/worldrender.mm [f6cb50b391] to src/worldrender.m [6775552eda].
1 2 3 4 5 6 7 8 9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | - - + + | // worldrender.cpp: goes through all cubes in top down quad tree fashion, // determines what has to be rendered and how (depending on neighbouring cubes), // then calls functions in rendercubes.cpp #include "cube.h" #import "DynamicEntity.h" void |
︙ | |||
79 80 81 82 83 84 85 | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | - + | // mip cubes (used for wall rendering below) bool issemi(int mip, int x, int y, int x1, int y1, int x2, int y2) { if (!(mip--)) return true; |
︙ | |||
117 118 119 120 121 122 123 | 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | - + | // machines however this function will use the higher mip levels only for // perfect mips. void render_seg_new( float vx, float vy, float vh, int mip, int x, int y, int xs, int ys) { |
︙ | |||
160 161 162 163 164 165 166 | 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | - + - - - - + + + + - + | // and are also deferred, and render them recursively. Anything left // (perfect mips and higher lods) we render here. #define LOOPH \ { \ for (int xx = x; xx < xs; xx++) \ for (int yy = y; yy < ys; yy++) { \ |
︙ | |||
217 218 219 220 221 222 223 | 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | - - + + - - + + | LOOPH continue; // walls LOOPD // w // zSt // vu |
︙ | |||
295 296 297 298 299 300 301 | 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 | - - + + - - - - - - + + + + + + | (v->type != SEMISOLID || issemi(mip, xx, yy + 1, 0, 0, 1, 0))) render_wall(s, v, xx, yy + 1, xx + 1, yy + 1, mip, v, u, true); } } } } |
︙ | |||
330 331 332 333 334 335 336 | 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 | - + - + - + - - + + | max(min_lod, (int)(MIN_LOD + (10 - cdist) / 1.0f * widef)); widef = 1.0f; } lod = MAX_LOD; lodtop = lodbot = lodleft = lodright = min_lod; if (yaw > 45 && yaw <= 135) { lodleft = lod; |