Overview
Comment: | Make more use of OFColor |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
932a90c261ff698efcf7980c87900806 |
User & Date: | js on 2025-03-29 13:01:06 |
Other Links: | manifest | tags |
Context
2025-03-29
| ||
14:25 | Switch from clang-format to manual formatting check-in: 75e920ae30 user: js tags: trunk | |
13:01 | Make more use of OFColor check-in: 932a90c261 user: js tags: trunk | |
2025-03-26
| ||
21:47 | Run newer version of clang-format check-in: cc7ebd7f79 user: js tags: trunk | |
Changes
Modified src/MD2.m from [a74f6892f8] to [eb988e3999].
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | + + | #import "MD2.h" #include "cube.h" #import "OFColor+Cube.h" struct md2_header { int magic; int version; int skinWidth, skinHeight; int frameSize; int numSkins, numVertices, numTexcoords; int numTriangles, numGlCommands, numFrames; |
︙ | |||
153 154 155 156 157 158 159 | 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | - - - + | [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); |
︙ |
Added src/OFColor+Cube.h version [7398d21dd3].
Added src/OFColor+Cube.m version [830e6212b6].
Modified src/editing.m from [03b89b7ddc] to [bc0b6a3e18].
︙ | |||
217 218 219 220 221 222 223 | 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | - + + + + - + + + + - + - + + + + - + - + - + + + + | if (SOLID(s)) continue; float h1 = sheight(s, s, z); float h2 = sheight(s, SWS(s, 1, 0, ssize), z); float h3 = sheight(s, SWS(s, 1, 1, ssize), z); float h4 = sheight(s, SWS(s, 0, 1, ssize), z); if (s->tag) |
︙ |
Modified src/meson.build from [fcfe74564e] to [1a1922a166].
︙ | |||
10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | + | 'Identifier.m', 'KeyMapping.m', 'MD2.m', 'MapModelInfo.m', 'Menu.m', 'MenuItem.m', 'Monster.m', 'OFColor+Cube.m', 'OFString+Cube.m', 'Player.m', 'Projectile.m', 'ResolverResult.m', 'ResolverThread.m', 'ServerEntity.m', 'ServerInfo.m', |
︙ |
Modified src/protos.h from [f47d376175] to [655b6d24d9].
︙ | |||
162 163 164 165 166 167 168 | 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | - + | extern bool noteditmode(); extern void pruneundos(int maxremain); // renderextras extern void line(int x1, int y1, float z1, int x2, int y2, float z2); extern void box(const struct block *b, float z1, float z2, float z3, float z4); extern void dot(int x, int y, float z); |
︙ |
Modified src/renderextras.m from [d086f388d4] to [efc1c2688d].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | + - + - + | // renderextras.cpp: misc gl render code and the HUD #include "cube.h" #import "Command.h" #import "Entity.h" #import "OFColor+Cube.h" #import "Player.h" #import "Variable.h" void line(int x1, int y1, float z1, int x2, int y2, float z2) { glBegin(GL_POLYGON); glVertex3f((float)x1, z1, (float)y1); glVertex3f((float)x1, z1, y1 + 0.01f); glVertex3f((float)x2, z2, y2 + 0.01f); glVertex3f((float)x2, z2, (float)y2); glEnd(); xtraverts += 4; } void |
︙ | |||
55 56 57 58 59 60 61 | 56 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 | - + + + + - + - + + + + | blendbox(int x1, int y1, int x2, int y2, bool border) { glDepthMask(GL_FALSE); glDisable(GL_TEXTURE_2D); glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_COLOR); glBegin(GL_QUADS); if (border) |
︙ | |||
122 123 124 125 126 127 128 | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | + + + - + | glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE); glBindTexture(GL_TEXTURE_2D, 4); for (struct sphere *p, **pp = &slist; (p = *pp) != NULL;) { glPushMatrix(); float size = p->size / p->max; [[OFColor colorWithRed:1.0f green:1.0f blue:1.0f |
︙ | |||
347 348 349 350 351 352 353 | 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 | + + - + + + + - + + | glDepthMask(GL_FALSE); if (dblend || underwater) { glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_COLOR); glBegin(GL_QUADS); if (dblend) [[OFColor colorWithRed:0.0f green:0.9f |
︙ | |||
377 378 379 380 381 382 383 | 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 | - + - + - + - + + + + | draw_text(player, 20, 1570, 2); renderscores(); if (!rendermenu()) { glBlendFunc(GL_SRC_ALPHA, GL_SRC_ALPHA); glBindTexture(GL_TEXTURE_2D, 1); glBegin(GL_QUADS); |
︙ |
Modified src/rendergl.m from [a437681d0a] to [a52bf36780].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | + | // rendergl.cpp: core opengl rendering stuff #define gamma math_gamma #include "cube.h" #import "Command.h" #import "Monster.h" #import "OFColor+Cube.h" #import "OFString+Cube.h" #import "Player.h" #import "Variable.h" #ifdef DARWIN # define GL_COMBINE_EXT GL_COMBINE_ARB # define GL_COMBINE_RGB_EXT GL_COMBINE_RGB_ARB |
︙ | |||
467 468 469 470 471 472 473 | 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 | - + | renderstripssky(); glLoadIdentity(); glRotated(player1.pitch, -1.0, 0.0, 0.0); glRotated(player1.yaw, 0.0, 1.0, 0.0); glRotated(90.0, 1.0, 0.0, 0.0); |
︙ |
Modified src/rendertext.m from [4a2a0ee6d3] to [da461b7a90].
1 2 3 4 5 6 7 8 9 10 | 1 2 3 4 5 6 7 8 9 10 11 12 | + + | // rendertext.cpp: based on Don's gl_text.cpp #include "cube.h" #import "OFColor+Cube.h" short char_coords[96][4] = { { 0, 0, 25, 64 }, //! { 25, 0, 54, 64 }, //" { 54, 0, 107, 64 }, // # { 107, 0, 148, 64 }, //$ { 148, 0, 217, 64 }, //% |
︙ | |||
144 145 146 147 148 149 150 | 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 | - + - + + + + | } void draw_text(OFString *string, int left, int top, int gl_num) { glBlendFunc(GL_ONE, GL_ONE); glBindTexture(GL_TEXTURE_2D, gl_num); |
︙ |