Differences From Artifact [5d964620ef]:
- File src/renderextras.mm — part of check-in [d2f07d884a] at 2025-03-12 00:16:05 on branch trunk — Be more tolerant of invalid arguments (user: js, size: 9890) [annotate] [blame] [check-ins using]
To Artifact [87f5ac882b]:
- File
src/renderextras.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: 9799) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
199 200 201 202 203 204 205 | getvar(@"selxs"), getvar(@"selys")]; } } void loadsky(OFString *basename) { | < | | | | | | | | | | | | < | | | | | | | | < | 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 | getvar(@"selxs"), getvar(@"selys")]; } } void loadsky(OFString *basename) { static OFString *lastsky = @""; basename = [basename stringByReplacingOccurrencesOfString:@"\\" withString:@"/"]; if ([lastsky isEqual:basename]) return; static const OFString *side[] = { @"ft", @"bk", @"lf", @"rt", @"dn", @"up" }; int texnum = 14; loopi(6) { OFString *path = [OFString stringWithFormat:@"packages/%@_%@.jpg", basename, side[i]]; int xs, ys; if (!installtex(texnum + i, [Cube.sharedInstance.gameDataIRI IRIByAppendingPathComponent:path], &xs, &ys, true)) conoutf(@"could not load sky textures"); } lastsky = basename; } COMMAND(loadsky, ARG_1STR) float cursordepth = 0.9f; GLint viewport[4]; GLdouble mm[16], pm[16]; OFVector3D worldpos; |
︙ | ︙ | |||
363 364 365 366 367 368 369 | dblend -= curtime / 3; if (dblend < 0) dblend = 0; } glEnable(GL_TEXTURE_2D); | < | | | | | | | | < | 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 | dblend -= curtime / 3; if (dblend < 0) dblend = 0; } glEnable(GL_TEXTURE_2D); OFString *command = getcurcommand(); OFString *player = playerincrosshair(); if (command) draw_textf(@"> %@_", 20, 1570, 2, command); else if (closeent.length > 0) draw_text(closeent, 20, 1570, 2); else if (player != nil) draw_text(player, 20, 1570, 2); renderscores(); if (!rendermenu()) { glBlendFunc(GL_SRC_ALPHA, GL_SRC_ALPHA); glBindTexture(GL_TEXTURE_2D, 1); glBegin(GL_QUADS); glColor3ub(255, 255, 255); |
︙ | ︙ |