Comment: | Remove loop[ijkl]
They confused clang-format a lot. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
6b85eefc857c74c00d7ef693e312cc15 |
User & Date: | js on 2025-03-23 02:47:40 |
Other Links: | manifest | tags |
2025-03-23
| ||
02:59 | Remove u{char,short,int} check-in: b5bfe2af86 user: js tags: trunk | |
02:47 | Remove loop[ijkl] check-in: 6b85eefc85 user: js tags: trunk | |
02:03 | Convert monster into a class check-in: e8f80b0482 user: js tags: trunk | |
Modified src/MD2.m from [92d0f266d8] to [1b5856edcb].
123 124 125 126 127 128 129 | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | - + - + - + - - + | { OFAssert(_mverts[frame] == NULL); _mverts[frame] = OFAllocMemory(_numVerts, sizeof(OFVector3D)); struct md2_frame *cf = (struct md2_frame *)((char *)_frames + _frameSize * frame); float sc = 16.0f / scale; |
188 189 190 191 192 193 194 | 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | - + - | if (numVertex > 0) { glBegin(GL_TRIANGLE_STRIP); } else { glBegin(GL_TRIANGLE_FAN); numVertex = -numVertex; } |
Modified src/clientgame.m from [d0a68a37a3] to [e2809031d4].
194 195 196 197 198 199 200 | 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | - + - + | lastmillis = millis; } // brute force but effective way to find a free spawn spot in the map void entinmap(DynamicEntity *d) { |
217 218 219 220 221 222 223 | 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 | + - + | int fixspawn = 2; // place at random spawn. also used by monsters! void spawnplayer(DynamicEntity *d) { int r = fixspawn-- > 0 ? 4 : rnd(10) + 1; for (int i = 0; i < r; i++) |
Modified src/clients.m from [90d8557e37] to [e57ccf0fe6].
209 210 211 212 213 214 215 | 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | - + - | capacity:num + 2]; [msg addItem:&num]; [msg addItem:&rel]; [msg addItem:&type]; va_list marker; va_start(marker, type); |
341 342 343 344 345 346 347 | 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 | - - + + | sendstring(player1.team, &p); putint(&p, player1.lifeSequence); } for (OFData *msg in messages) { // send messages collected during the previous frames if (*(int *)[msg itemAtIndex:1]) packet->flags = ENET_PACKET_FLAG_RELIABLE; |
Modified src/commands.m from [5ae3539b0c] to [4117ae0f6a].
236 237 238 239 240 241 242 | 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | - + - | char *p = copy; const int MAXWORDS = 25; // limit, remove OFString *w[MAXWORDS]; int val = 0; for (bool cont = true; cont;) { // for each ; seperated statement int numargs = MAXWORDS; |
417 418 419 420 421 422 423 | 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 | - + - | } void loopa(OFString *times, OFString *body) { int t = times.cube_intValue; |
473 474 475 476 477 478 479 | 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 | - + - | void at(OFString *s_, OFString *pos) { int n = pos.cube_intValue; char *copy __attribute__((__cleanup__(cleanup))) = strdup(s_.UTF8String); char *s = copy; |
Modified src/console.m from [2703ba3edf] to [1ac50365c9].
91 92 93 94 95 96 97 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | - + - - | if (nd == ndraw) break; } i++; } |
Modified src/editing.m from [85210314d4] to [f776852317].
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | - - - - - - - - - + + + + + + + + + + | }; }); } int selh = 0; bool selset = false; |
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 | 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | + + | static struct block *copybuf = NULL; void copy() { EDITSELMP; if (copybuf) OFFreeMemory(copybuf); copybuf = blockcopy(&sel); } void paste() { EDITMP; |
317 318 319 320 321 322 323 | 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 | - + - | blockpaste(copybuf); } void tofronttex() // maintain most recently used of the texture lists when applying // texture { |
367 368 369 370 371 372 373 374 375 376 377 378 379 380 | 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | + | }); } void editheight(int flr, int amount) { EDITSEL; bool isfloor = flr == 0; editheightxy(isfloor, amount, &sel); addmsg(1, 7, SV_EDITH, sel.x, sel.y, sel.xs, sel.ys, isfloor, amount); } COMMAND(editheight, ARG_2INT) void |
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 | 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 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 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 | + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + | }); } void edittex(int type, int dir) { EDITSEL; if (type < 0 || type > 3) return; if (type != lasttype) { tofronttex(); lasttype = type; } int atype = type == 3 ? 1 : type; int i = curedittex[atype]; i = i < 0 ? 0 : i + dir; curedittex[atype] = i = min(max(i, 0), 255); int t = lasttex = hdr.texlists[atype][i]; edittexxy(type, t, &sel); addmsg(1, 7, SV_EDITT, sel.x, sel.y, sel.xs, sel.ys, type, t); } void replace() { EDITSELMP; |
505 506 507 508 509 510 511 | 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 | - + + + + + + - + + + + + + + + + + + + + + + - + + + | s->floor = s->ceil - 1; }); } void equalize(int flr) { |
Modified src/menus.m from [9e1b20764c] to [9134766c32].
57 58 59 60 61 62 63 | 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 | - + - - + - | OFString *title; if (vmenu > 1) title = [OFString stringWithFormat:@"[ %@ menu ]", m.name]; else title = m.name; int mdisp = m.items.count; int w = 0; |
Modified src/physics.m from [6e6b41ef3d] to [0149f2d0e3].
354 355 356 357 358 359 360 | 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | - + - + | pl.timeInAir = 0; } // at high fps, gravity kicks in too fast const float drop = dropf * curtime / gravity / 100 / moveres; // extra smoothness when lifting up stairs const float rise = speed / moveres / 1.2f; |
437 438 439 440 441 442 443 | 437 438 439 440 441 442 443 444 445 446 447 448 449 | + - - - + + + + | } pl.inWater = water; } void moveplayer(DynamicEntity *pl, int moveres, bool local) { for (int i = 0; i < physicsrepeat; i++) |
Modified src/renderextras.m from [81b3ccc9f0] to [2902b001e4].
91 92 93 94 95 96 97 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | - + - | static struct sphere spheres[MAXSPHERES], *slist = NULL, *sempty = NULL; bool sinit = false; void newsphere(const OFVector3D *o, float max, int type) { if (!sinit) { |
214 215 216 217 218 219 220 | 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | - + - | if ([lastsky isEqual:basename]) return; static const OFString *side[] = { @"ft", @"bk", @"lf", @"rt", @"dn", @"up" }; int texnum = 14; |
Modified src/rendergl.m from [d2bce2bd10] to [34f844358a].
108 109 110 111 112 113 114 | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | - + - - - - + + + | s = converted; } @finally { SDL_FreeFormat(format); } } #if 0 |
175 176 177 178 179 180 181 | 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | + + - + | // ( cube texture, frame ) -> ( opengl id, name ) static int mapping[256][MAXFRAMES]; static OFString *mapname[256][MAXFRAMES]; void purgetextures() { for (int i = 0; i < 256; i++) for (int j = 0; j < MAXFRAMES; j++) |
217 218 219 220 221 222 223 | 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | - + - + | return tid; } *xs = *ys = 16; if (tid == 0) return 1; // crosshair :) |
Modified src/renderparticles.m from [63da7f6939] to [8491151e32].
17 18 19 20 21 22 23 | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | - + - | VARP(maxparticles, 100, 2000, MAXPARTICLES - 500); static void newparticle(const OFVector3D *o, const OFVector3D *d, int fade, int type) { if (!parinit) { |
134 135 136 137 138 139 140 | 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | - + - - + - | glDisable(GL_BLEND); glDepthMask(GL_TRUE); } void particle_splash(int type, int num, int fade, const OFVector3D *p) { |
Modified src/savegamedemo.m from [fc99f9e9f6] to [c92a453804].
241 242 243 244 245 246 247 | 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | + - + - - - - - + + + + + | monster.lastAction = monster.trigger = lastmillis + 500; if (monster.state == CS_DEAD) monster.lastAction = 0; } [Monster restoreAll]; int nplayers = gzgeti(); for (int i = 0; i < nplayers; i++) { |
317 318 319 320 321 322 323 | 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 | + - + | gzput(player1.gunSelect); gzput(player1.lastAttackGun); gzputi(player1.lastAction - starttime); gzputi(player1.gunWait); gzputi(player1.health); gzputi(player1.armour); gzput(player1.armourType); for (int i = 0; i < NUMGUNS; i++) |
444 445 446 447 448 449 450 | 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 | + - + | target.gunSelect = gzget(); target.lastAttackGun = gzget(); target.lastAction = scaletime(gzgeti()); target.gunWait = gzgeti(); target.health = gzgeti(); target.armour = gzgeti(); target.armourType = gzget(); for (int i = 0; i < NUMGUNS; i++) |
Modified src/server.m from [7cdeba7547] to [98a7979cee].
249 250 251 252 253 254 255 | 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | + - + | if (cn < 0 || cn >= clients.count || clients[cn].type == ST_EMPTY) { disconnect_client(sender, @"client num"); return; } int size = msgsizelookup(type); assert(size != -1); for (int i = 0; i < size - 2; i++) |
276 277 278 279 280 281 282 | 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | + - + | default: { int size = msgsizelookup(type); if (size == -1) { disconnect_client(sender, @"tag type"); return; } for (int i = 0; i < size - 1; i++) |
542 543 544 545 546 547 548 | 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 | + - + | ENetAddress address = { ENET_HOST_ANY, CUBE_SERVER_PORT }; if (ip.length > 0 && enet_address_set_host(&address, ip.UTF8String) < 0) printf("WARNING: server ip not resolved"); serverhost = enet_host_create(&address, MAXCLIENTS, 0, uprate); if (!serverhost) fatal(@"could not create server host\n"); for (int i = 0; i < MAXCLIENTS; i++) |
Modified src/sound.m from [8879a01acd] to [4ad5c2248e].
142 143 144 145 146 147 148 | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | - - - - - - + + + + + + + + | } void updatevol() { if (nosound) return; |
Modified src/tools.h from [277ccadbda] to [1e36fccfb6].
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | - - - + + + + - - - - - | typedef unsigned short ushort; typedef unsigned int uint; #define max(a, b) (((a) > (b)) ? (a) : (b)) #define min(a, b) (((a) < (b)) ? (a) : (b)) #define rnd(max) (rand() % (max)) #define rndreset() (srand(1)) |
Modified src/tools.m from [f9cb2ee264] to [9fca1834ea].
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 | - - - - - - + + + + + + + + | // implementation of generic tools #include "tools.h" ///////////////////////// misc tools /////////////////////// void endianswap( void *memory, int stride, int length) // little indians as storage format { if (*((char *)&stride)) return; |
Modified src/weapon.m from [6b111961c9] to [acb2ec57ac].
73 74 75 76 77 78 79 | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | - + - | // create random spread of rays for the shotgun void createrays(const OFVector3D *from, const OFVector3D *to) { vdist(dist, dvec, *from, *to); float f = dist * SGSPREAD / 1000; |
164 165 166 167 168 169 170 | 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | - + | p.local = local; p.owner = owner; p.gun = gun; return; } } |
201 202 203 204 205 206 207 | 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | - + | int damage = (int)(qdam * (1 - (dist / RL_DAMRAD))); hit(cn, damage, o, at); vmul(temp, (RL_DAMRAD - dist) * damage / 800); vadd(o.velocity, temp); } } |
318 319 320 321 322 323 324 | 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | + - + | playsound(guns[gun].sound, d == player1 ? NULL : &loc); int pspeed = 25; switch (gun) { case GUN_FIST: break; case GUN_SG: { for (int i = 0; i < SGRAYS; i++) |
367 368 369 370 371 372 373 | 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | + - + + | int qdam = guns[d.gunSelect].damage; if (d.quadMillis) qdam *= 4; if ([d isKindOfClass:Monster.class]) qdam /= MONSTERDAMAGEFACTOR; if (d.gunSelect == GUN_SG) { int damage = 0; for (int r = 0; r < SGRAYS; r++) |
Modified src/world.m from [97ecb02030] to [9e368d7a28].
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 75 76 77 78 79 | - + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - + | // set all cubes with "tag" to space, if tag is 0 then reset ALL tagged cubes // according to type void settag(int tag, int type) { int maxx = 0, maxy = 0, minx = ssize, miny = ssize; |
119 120 121 122 123 124 125 | 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 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 | + - - + + + + - + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + - | o[1] = SWS(w, x + 1, y, ws); o[2] = SWS(w, x + 1, y + 1, ws); o[3] = SWS(w, x, y + 1, ws); // the target cube in the higher mip level struct sqr *r = SWS(v, x / 2, y / 2, vs); *r = *o[0]; uchar nums[MAXTYPE]; for (int i = 0; i < MAXTYPE; i++) |
224 225 226 227 228 229 230 | 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 | + - + + | ->vdelta) goto c; } } { // if any of the constituents is not perfect, // then this one isn't either for (int i = 0; i < 4; i++) |
318 319 320 321 322 323 324 | 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | + - + + | if (t == LIGHT) calclight(); } int findtype(OFString *what) { for (int i = 0; i < MAXENTTYPES; i++) |
424 425 426 427 428 429 430 | 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 | + - + + - + - | int findentity(int type, int index) { for (int i = index; i < ents.count; i++) if (ents[i].type == type) return i; for (int j = 0; j < index; j++) |
466 467 468 469 470 471 472 | 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 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 | - + - - - - - - - - - - - + + + + + + + + + + + + - + - - - + + + + + - - + + + + | } if (factor < SMALLEST_FACTOR) factor = SMALLEST_FACTOR; if (factor > LARGEST_FACTOR) factor = LARGEST_FACTOR; setupworld(factor); |
Modified src/worldio.m from [cfdf69a801] to [a9d5711584].
57 58 59 60 61 62 63 | 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 | - + - - - - - - - - + + + + + + + + + + + - + - - - - - - + + + + + + + - + - - - - - - - - + + + + + + + + | { return s->type != FHF && s->type != CHF; } void voptimize() // reset vdeltas on non-hf cubes { |
118 119 120 121 122 123 124 | 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | - + - | topt(s[0], &wf[0], &uf[0], &wt, &ut); topt(s[1] = SWS(s[0], 0, 1, ssize), &wf[1], &uf[1], &wt, &ut); topt(s[2] = SWS(s[0], 1, 1, ssize), &wf[2], &uf[2], &wt, &ut); topt(s[3] = SWS(s[0], 1, 0, ssize), &wf[3], &uf[3], &wt, &ut); |
206 207 208 209 210 211 212 | 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | - + - | gzputc(f, 255); \ sc -= 255; \ } else { \ gzputc(f, sc); \ sc = 0; \ } \ } |
281 282 283 284 285 286 287 | 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | - + - | if (hdr.version >= 4) { gzread(f, &hdr.waterlevel, sizeof(int) * 16); endianswap(&hdr.waterlevel, sizeof(int), 16); } else { hdr.waterlevel = -100000; } [ents removeAllObjects]; |
308 309 310 311 312 313 314 | 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 | + - + - + - | if (e.attr1 > 32) e.attr1 = 32; // 12_03 and below } } free(world); setupworld(hdr.sfactor); char texuse[256]; for (int i = 0; i < 256; i++) |
378 379 380 381 382 383 384 | 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 | + + - + - + - | if (!SOLID(s)) texuse[s->utex] = texuse[s->ftex] = texuse[s->ctex] = 1; } gzclose(f); calclight(); settagareas(); int xs, ys; for (int i = 0; i < 256; i++) if (texuse[i]) |
Modified src/worldlight.m from [3113d251d8] to [20e5b19402].
57 58 59 60 61 62 63 | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | - + - | int stepg = fast_f2nat(g / (float)steps); int b = light.attr4 << PRECBITS; int stepb = fast_f2nat(b / (float)steps); g /= lightscale; stepg /= lightscale; b /= lightscale; stepb /= lightscale; |
86 87 88 89 90 91 92 | 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 | - + - - + - | int dimness = rnd((255 - light.attr2) / 16 + 1); x += stepx * dimness; y += stepy * dimness; if (OUTBORD(x >> PRECBITS, y >> PRECBITS)) return; |
146 147 148 149 150 151 152 | 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 | - + - - + + + - - - - + + + + - + - - - + + + + | rndtime(); } // median filter, smooths out random noise in light and makes it more mipable void postlightarea(const struct block *a) { |
Modified src/worldocull.m from [8d9314d707] to [504811d94d].
29 30 31 32 33 34 35 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | - + - | odist = getvar(@"fog") * 1.5f; float apitch = (float)fabs(player1.pitch); float af = getvar(@"fov") / 2 + apitch / 1.5f + 3; float byaw = (player1.yaw - 90 + af) / 360 * PI2; float syaw = (player1.yaw - 90 - af) / 360 * PI2; |
Modified src/worldrender.m from [37acc1d08b] to [ae30288fea].
314 315 316 317 318 319 320 | 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | + - + | // does some out of date view frustrum optimisation that doesn't contribute much // anymore void render_world( float vx, float vy, float vh, int yaw, int pitch, float fov, int w, int h) { for (int i = 0; i < LARGEST_FACTOR; i++) |