Differences From Artifact [e6c4962238]:
- File src/renderextras.m — part of check-in [d7661be1b1] at 2025-03-23 19:40:00 on branch trunk — Clean up identifiers, use blocks for commands (user: js, size: 9957) [annotate] [blame] [check-ins using]
To Artifact [ace19c9caa]:
- File
src/renderextras.m
— part of check-in
[304230c1e1]
at
2025-03-23 21:52:54
on branch trunk
— Avoid pointless pointers
Passing OFVector3D by reference is annoying and is worse at passing via registers. (user: js, size: 9926) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
89 90 91 92 93 94 95 | int type; struct sphere *next; }; static struct sphere spheres[MAXSPHERES], *slist = NULL, *sempty = NULL; bool sinit = false; void | | | | 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 | int type; struct sphere *next; }; static struct sphere spheres[MAXSPHERES], *slist = NULL, *sempty = NULL; bool sinit = false; void newsphere(OFVector3D o, float max, int type) { if (!sinit) { for (int i = 0; i < MAXSPHERES; i++) { spheres[i].next = sempty; sempty = &spheres[i]; } sinit = true; } if (sempty) { struct sphere *p = sempty; sempty = p->next; p->o = o; p->max = max; p->size = 1; p->type = type; p->next = slist; slist = p; } } |
︙ | ︙ | |||
185 186 187 188 189 190 191 | if (!editmode) return; for (Entity *e in ents) { if (e.type == NOTUSED) continue; | < | | 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | if (!editmode) return; for (Entity *e in ents) { if (e.type == NOTUSED) continue; particle_splash(2, 2, 40, OFMakeVector3D(e.x, e.y, e.z)); } int e = closestent(); if (e >= 0) { Entity *c = ents[e]; closeent = [OFString stringWithFormat:@"closest entity = %@ (%d, %d, " |
︙ | ︙ | |||
268 269 270 271 272 273 274 | gluUnProject(w / 2, h / 2, depthcorrect(cursordepth), mm, pm, viewport, &worldx, &worldz, &worldy); worldpos.x = (float)worldx; worldpos.y = (float)worldy; worldpos.z = (float)worldz; OFVector3D r = OFMakeVector3D(mm[0], mm[4], mm[8]); OFVector3D u = OFMakeVector3D(mm[1], mm[5], mm[9]); | | | 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | gluUnProject(w / 2, h / 2, depthcorrect(cursordepth), mm, pm, viewport, &worldx, &worldz, &worldy); worldpos.x = (float)worldx; worldpos.y = (float)worldy; worldpos.z = (float)worldz; OFVector3D r = OFMakeVector3D(mm[0], mm[4], mm[8]); OFVector3D u = OFMakeVector3D(mm[1], mm[5], mm[9]); setorient(r, u); } void drawicon(float tx, float ty, int x, int y) { glBindTexture(GL_TEXTURE_2D, 5); glBegin(GL_QUADS); |
︙ | ︙ |