Differences From Artifact [64d68c27a0]:
- File
src/MD2.m
— part of check-in
[75e920ae30]
at
2025-03-29 14:25:43
on branch trunk
— Switch from clang-format to manual formatting
clang-format does too many weird things. (user: js, size: 5209) [annotate] [blame] [check-ins using]
To Artifact [c2a1e1b6fe]:
- File src/MD2.m — part of check-in [c634a689e7] at 2025-03-29 17:13:40 on branch trunk — More style fixes (user: js, size: 5076) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
65 66 67 68 69 70 71 | - (bool)loadWithIRI: (OFIRI *)IRI { OFSeekableStream *stream; @try { stream = (OFSeekableStream *)[[OFIRIHandler handlerForIRI: IRI] openItemAtIRI: IRI | | | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | - (bool)loadWithIRI: (OFIRI *)IRI { OFSeekableStream *stream; @try { stream = (OFSeekableStream *)[[OFIRIHandler handlerForIRI: IRI] openItemAtIRI: IRI mode: @"r"]; } @catch (id e) { return false; } if (![stream isKindOfClass: OFSeekableStream.class]) return false; |
︙ | ︙ | |||
88 89 90 91 92 93 94 | _frames = OFAllocMemory(header.numFrames, header.frameSize); } @catch (OFOutOfMemoryException *e) { return false; } [stream seekToOffset: header.offsetFrames whence: OFSeekSet]; [stream readIntoBuffer: _frames | | | | 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 | _frames = OFAllocMemory(header.numFrames, header.frameSize); } @catch (OFOutOfMemoryException *e) { return false; } [stream seekToOffset: header.offsetFrames whence: OFSeekSet]; [stream readIntoBuffer: _frames exactLength: header.frameSize * header.numFrames]; for (int i = 0; i < header.numFrames; ++i) endianswap(_frames + i * header.frameSize, sizeof(float), 6); @try { _glCommands = OFAllocMemory(header.numGlCommands, sizeof(int)); } @catch (OFOutOfMemoryException *e) { return false; } [stream seekToOffset: header.offsetGlCommands whence: OFSeekSet]; [stream readIntoBuffer: _glCommands exactLength: header.numGlCommands * sizeof(int)]; endianswap(_glCommands, sizeof(int), header.numGlCommands); _numFrames = header.numFrames; _numGlCommands = header.numGlCommands; _frameSize = header.frameSize; _numTriangles = header.numTriangles; _numVerts = header.numVertices; |
︙ | ︙ | |||
136 137 138 139 140 141 142 | v->y = -(snap(sn, cv[1] * cf->scale[1]) + cf->translate[1]) / sc; v->z = (snap(sn, cv[2] * cf->scale[2]) + cf->translate[2]) / sc; } } - (void)renderWithLight: (OFColor *)light | | | | | | | | | | | 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | v->y = -(snap(sn, cv[1] * cf->scale[1]) + cf->translate[1]) / sc; v->z = (snap(sn, cv[2] * cf->scale[2]) + cf->translate[2]) / sc; } } - (void)renderWithLight: (OFColor *)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 { for (int i = 0; i < range; i++) if (!_mverts[frame + i]) [self scaleWithFrame: frame + i scale: sc snap: sn]; glPushMatrix(); glTranslatef(position.x, position.y, position.z); |
︙ | ︙ |