Differences From Artifact [4b55922953]:
- File
src/MD2.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: 4961) [annotate] [blame] [check-ins using]
To Artifact [3c502ddbf2]:
- File src/MD2.mm — part of check-in [89fbd7a152] at 2025-03-20 13:21:56 on branch trunk — Make more use of convenience methods (user: js, size: 4988) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
39 40 41 42 43 44 45 46 47 48 49 50 51 52 | int _numFrames; int _numVerts; char *_frames; OFVector3D **_mverts; int _displaylist; int _displaylistverts; } - (void)dealloc { if (_glCommands) delete[] _glCommands; if (_frames) delete[] _frames; | > > > > > | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | int _numFrames; int _numVerts; char *_frames; OFVector3D **_mverts; int _displaylist; int _displaylistverts; } + (instancetype)md2 { return [[self alloc] init]; } - (void)dealloc { if (_glCommands) delete[] _glCommands; if (_frames) delete[] _frames; |
︙ | ︙ | |||
122 123 124 125 126 127 128 | v->z = (snap(sn, cv[2] * cf->scale[2]) + cf->translate[2]) / sc; } } - (void)renderWithLight:(OFVector3D)light frame:(int)frame range:(int)range | | < < | | 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 | v->z = (snap(sn, cv[2] * cf->scale[2]) + cf->translate[2]) / sc; } } - (void)renderWithLight:(OFVector3D)light frame:(int)frame range:(int)range position:(OFVector3D)position yaw:(float)yaw pitch:(float)pitch scale:(float)sc speed:(float)speed snap:(int)sn basetime:(int)basetime { loopi(range) if (!_mverts[frame + i])[self scaleWithFrame:frame + i scale:sc snap:sn]; glPushMatrix(); glTranslatef(position.x, position.y, position.z); glRotatef(yaw + 180, 0, -1, 0); glRotatef(pitch, 0, 0, 1); glColor3fv((float *)&light); if (_displaylist && frame == 0 && range == 1) { glCallList(_displaylist); |
︙ | ︙ |