ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/Client.xs
(Generate patch)

Comparing deliantra/Deliantra-Client/Client.xs (file contents):
Revision 1.323 by root, Sun Nov 18 01:48:39 2018 UTC vs.
Revision 1.330 by root, Sun Nov 18 15:24:24 2018 UTC

32#include <cstring> 32#include <cstring>
33#include <cstdio> 33#include <cstdio>
34#include <cstdlib> 34#include <cstdlib>
35 35
36#include <utility> 36#include <utility>
37#include <bitset>
37 38
38#define USE_RWOPS 1 // for SDL_mixer:LoadMUS_RW 39#define USE_RWOPS 1 // for SDL_mixer:LoadMUS_RW
39 40
40#include <SDL.h> 41#include <SDL.h>
41#include <SDL_thread.h> 42#include <SDL_thread.h>
204struct cf_layout { 205struct cf_layout {
205 PangoLayout *pl; 206 PangoLayout *pl;
206 float r, g, b, a; // default color for rgba mode 207 float r, g, b, a; // default color for rgba mode
207 int base_height; 208 int base_height;
208 DC__Font font; 209 DC__Font font;
209 rc_t *rc; 210 rc_t rc;
210}; 211};
211 212
212typedef cf_layout *DC__Layout; 213typedef cf_layout *DC__Layout;
213 214
214static DC__Font default_font; 215static DC__Font default_font;
295 maprow *row; 296 maprow *row;
296}; 297};
297 298
298typedef mapgrid *DC__Map; 299typedef mapgrid *DC__Map;
299 300
300static char * 301template<typename T>
302static void
301prepend (char *ptr, int sze, int inc) 303prepend (T *&ptr, int sze, int inc)
302{ 304{
303 char *p; 305 T *p;
304 306
305 New (0, p, sze + inc, char); 307 Newxz (p, sze + inc, T);
306 Zero (p, inc, char);
307 Move (ptr, p + inc, sze, char); 308 Move (ptr, p + inc, sze, T);
308 Safefree (ptr); 309 Safefree (ptr);
309 310
310 return p; 311 ptr = p;
311} 312}
312 313
313static char * 314template<typename T>
315static void
314append (char *ptr, int sze, int inc) 316append (T *&ptr, int sze, int inc)
315{ 317{
316 Renew (ptr, sze + inc, char); 318 Renew (ptr, sze + inc, T);
317 Zero (ptr + sze, inc, char); 319 Zero (ptr + sze, inc, T);
318
319 return ptr;
320} 320}
321
322#define Append(type,ptr,sze,inc) (ptr) = (type *)append ((char *)ptr, (sze) * sizeof (type), (inc) * sizeof (type))
323#define Prepend(type,ptr,sze,inc) (ptr) = (type *)prepend ((char *)ptr, (sze) * sizeof (type), (inc) * sizeof (type))
324 321
325static void 322static void
326need_facenum (struct mapgrid *self, faceid face) 323need_facenum (struct mapgrid *self, faceid face)
327{ 324{
328 while (self->faces <= face) 325 while (self->faces <= face)
329 { 326 {
330 Append (tileid, self->face2tile, self->faces, self->faces); 327 append (self->face2tile, self->faces, self->faces);
331 self->faces *= 2; 328 self->faces *= 2;
332 } 329 }
333} 330}
334 331
335static void 332static void
336need_texid (struct mapgrid *self, int texid) 333need_texid (struct mapgrid *self, int texid)
337{ 334{
338 while (self->texs <= texid) 335 while (self->texs <= texid)
339 { 336 {
340 Append (maptex, self->tex, self->texs, self->texs); 337 append (self->tex, self->texs, self->texs);
341 self->texs *= 2; 338 self->texs *= 2;
342 } 339 }
343} 340}
344 341
345static maprow * 342static maprow *
346map_get_row (mapgrid *self, int y) 343map_get_row (mapgrid *self, int y)
347{ 344{
348 if (0 > y) 345 if (0 > y)
349 { 346 {
350 int extend = - y + MAP_EXTEND_Y; 347 int extend = - y + MAP_EXTEND_Y;
351 Prepend (maprow, self->row, self->rows, extend); 348 prepend (self->row, self->rows, extend);
352 349
353 self->rows += extend; 350 self->rows += extend;
354 self->y += extend; 351 self->y += extend;
355 y += extend; 352 y += extend;
356 } 353 }
357 else if (y >= self->rows) 354 else if (y >= self->rows)
358 { 355 {
359 int extend = y - self->rows + MAP_EXTEND_Y; 356 int extend = y - self->rows + MAP_EXTEND_Y;
360 Append (maprow, self->row, self->rows, extend); 357 append (self->row, self->rows, extend);
361 self->rows += extend; 358 self->rows += extend;
362 } 359 }
363 360
364 return self->row + y; 361 return self->row + y;
365} 362}
375 } 372 }
376 373
377 if (row->c0 > x) 374 if (row->c0 > x)
378 { 375 {
379 int extend = row->c0 - x + MAP_EXTEND_X; 376 int extend = row->c0 - x + MAP_EXTEND_X;
380 Prepend (mapcell, row->col, row->c1 - row->c0, extend); 377 prepend (row->col, row->c1 - row->c0, extend);
381 row->c0 -= extend; 378 row->c0 -= extend;
382 } 379 }
383 else if (x >= row->c1) 380 else if (x >= row->c1)
384 { 381 {
385 int extend = x - row->c1 + MAP_EXTEND_X; 382 int extend = x - row->c1 + MAP_EXTEND_X;
386 Append (mapcell, row->col, row->c1 - row->c0, extend); 383 append (row->col, row->c1 - row->c0, extend);
387 row->c1 += extend; 384 row->c1 += extend;
388 } 385 }
389 386
390 return row->col + (x - row->c0); 387 return row->col + (x - row->c0);
391} 388}
1368 tc_restore (); 1365 tc_restore ();
1369 1366
1370DC::Layout 1367DC::Layout
1371new (SV *klass) 1368new (SV *klass)
1372 CODE: 1369 CODE:
1373 New (0, RETVAL, 1, struct cf_layout); 1370 RETVAL = new cf_layout;
1374 1371
1375 RETVAL->pl = pango_layout_new (opengl_context); 1372 RETVAL->pl = pango_layout_new (opengl_context);
1376 RETVAL->r = 1.; 1373 RETVAL->r = 1.;
1377 RETVAL->g = 1.; 1374 RETVAL->g = 1.;
1378 RETVAL->b = 1.; 1375 RETVAL->b = 1.;
1379 RETVAL->a = 1.; 1376 RETVAL->a = 1.;
1380 RETVAL->base_height = MIN_FONT_HEIGHT; 1377 RETVAL->base_height = MIN_FONT_HEIGHT;
1381 RETVAL->font = 0; 1378 RETVAL->font = 0;
1382 RETVAL->rc = rc_alloc ();
1383 1379
1384 pango_layout_set_wrap (RETVAL->pl, PANGO_WRAP_WORD_CHAR); 1380 pango_layout_set_wrap (RETVAL->pl, PANGO_WRAP_WORD_CHAR);
1385 layout_update_font (RETVAL); 1381 layout_update_font (RETVAL);
1386 OUTPUT: 1382 OUTPUT:
1387 RETVAL 1383 RETVAL
1388 1384
1389void 1385void
1390DESTROY (DC::Layout self) 1386DESTROY (DC::Layout self)
1391 CODE: 1387 CODE:
1392 g_object_unref (self->pl); 1388 g_object_unref (self->pl);
1393 rc_free (self->rc);
1394 Safefree (self); 1389 delete self;
1395 1390
1396void 1391void
1397set_text (DC::Layout self, SV *text_) 1392set_text (DC::Layout self, SV *text_)
1398 CODE: 1393 CODE:
1399{ 1394{
1653} 1648}
1654 1649
1655void 1650void
1656render (DC::Layout self, float x, float y, int flags = 0) 1651render (DC::Layout self, float x, float y, int flags = 0)
1657 CODE: 1652 CODE:
1658 rc_clear (self->rc); 1653 self->rc.clear ();
1659 pango_opengl_render_layout_subpixel ( 1654 pango_opengl_render_layout_subpixel (
1660 self->pl, 1655 self->pl,
1661 self->rc, 1656 &self->rc,
1662 x * PANGO_SCALE, y * PANGO_SCALE, 1657 x * PANGO_SCALE, y * PANGO_SCALE,
1663 self->r, self->g, self->b, self->a, 1658 self->r, self->g, self->b, self->a,
1664 flags 1659 flags
1665 ); 1660 );
1666 // we assume that context_change actually clears/frees stuff 1661 // we assume that context_change actually clears/frees stuff
1677 gl_BlendFuncSeparate (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1672 gl_BlendFuncSeparate (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,
1678 GL_ONE , GL_ONE_MINUS_SRC_ALPHA); 1673 GL_ONE , GL_ONE_MINUS_SRC_ALPHA);
1679 glEnable (GL_ALPHA_TEST); 1674 glEnable (GL_ALPHA_TEST);
1680 glAlphaFunc (GL_GREATER, 7.f / 255.f); 1675 glAlphaFunc (GL_GREATER, 7.f / 255.f);
1681 1676
1682 rc_draw (self->rc); 1677 self->rc.draw ();
1683 1678
1684 glDisable (GL_ALPHA_TEST); 1679 glDisable (GL_ALPHA_TEST);
1685 glDisable (GL_BLEND); 1680 glDisable (GL_BLEND);
1686 glDisable (GL_TEXTURE_2D); 1681 glDisable (GL_TEXTURE_2D);
1687} 1682}
2057 self->ox += dx; self->x += dx; 2052 self->ox += dx; self->x += dx;
2058 self->oy += dy; self->y += dy; 2053 self->oy += dy; self->y += dy;
2059 2054
2060 while (self->y < 0) 2055 while (self->y < 0)
2061 { 2056 {
2062 Prepend (maprow, self->row, self->rows, MAP_EXTEND_Y); 2057 prepend (self->row, self->rows, MAP_EXTEND_Y);
2063 2058
2064 self->rows += MAP_EXTEND_Y; 2059 self->rows += MAP_EXTEND_Y;
2065 self->y += MAP_EXTEND_Y; 2060 self->y += MAP_EXTEND_Y;
2066 } 2061 }
2067} 2062}
2223draw (DC::Map self, int mx, int my, int sw, int sh, int Tw, int Th, U32 player = 0xffffffff, int sdx = 0, int sdy = 0) 2218draw (DC::Map self, int mx, int my, int sw, int sh, int Tw, int Th, U32 player = 0xffffffff, int sdx = 0, int sdy = 0)
2224 CODE: 2219 CODE:
2225{ 2220{
2226 int x, y, z; 2221 int x, y, z;
2227 2222
2228 uint32_t smooth_level[256 / 32]; // one bit for every possible smooth level
2229 static uint8_t smooth_max[256][256]; // egad, fast and wasteful on memory (64k) 2223 static uint8_t smooth_max[256][256]; // egad, fast and wasteful on memory (64k), also, static!
2230 smooth_key skey;
2231 int pl_x, pl_y; 2224 int pl_x, pl_y;
2232 maptex pl_tex; 2225 maptex pl_tex;
2233 rc_t *rc = rc_alloc (); 2226 rc_t rc;
2234 rc_t *rc_ov = rc_alloc (); 2227 rc_t rc_ov;
2235 rc_key_t key; 2228 rc_key_t key;
2236 rc_array_t *arr; 2229 rc_t::array_t *arr;
2237 2230
2238 pl_tex.name = 0; 2231 pl_tex.name = 0;
2239 2232
2240 // that's current max. sorry. 2233 // that's current max. sorry.
2241 if (sw > 255) sw = 255; 2234 if (sw > 255) sw = 255;
2242 if (sh > 255) sh = 255; 2235 if (sh > 255) sh = 255;
2243
2244 // clear key, in case of extra padding
2245 memset (&skey, 0, sizeof (skey));
2246 2236
2247 memset (&key, 0, sizeof (key)); 2237 memset (&key, 0, sizeof (key));
2248 key.r = 255; 2238 key.r = 255;
2249 key.g = 255; 2239 key.g = 255;
2250 key.b = 255; 2240 key.b = 255;
2256 my += self->y; 2246 my += self->y;
2257 2247
2258 // first pass: determine smooth_max 2248 // first pass: determine smooth_max
2259 // rather ugly, if you ask me 2249 // rather ugly, if you ask me
2260 // could also be stored inside mapcell and updated on change 2250 // could also be stored inside mapcell and updated on change
2261 memset (smooth_max, 0, sizeof (smooth_max)); 2251 memset (smooth_max, 0, sizeof (smooth_max[0]) * (sh + 1));
2262 2252
2263 for (y = 0; y < sh; y++) 2253 for (y = 0; y < sh; y++)
2264 if (0 <= y + my && y + my < self->rows) 2254 if (0 <= y + my && y + my < self->rows)
2265 { 2255 {
2266 maprow *row = self->row + (y + my); 2256 maprow *row = self->row + (y + my);
2281 glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 2271 glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
2282 glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); 2272 glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
2283 2273
2284 for (z = 0; z <= 2; z++) 2274 for (z = 0; z <= 2; z++)
2285 { 2275 {
2276 std::bitset<256> smooth_level; // one bit for every possible smooth level
2277 smooth_key skey;
2286 smooth_hash smooth; 2278 smooth_hash smooth;
2287 memset (smooth_level, 0, sizeof (smooth_level));
2288 key.texname = -1; 2279 key.texname = -1;
2289 2280
2290 for (y = 0; y < sh; y++) 2281 for (y = 0; y < sh; y++)
2291 if (0 <= y + my && y + my < self->rows) 2282 if (0 <= y + my && y + my < self->rows)
2292 { 2283 {
2309 2300
2310 if (!tex.name) 2301 if (!tex.name)
2311 tex = self->tex [TEXID_NOFACE]; /* missing, replace by noface */ 2302 tex = self->tex [TEXID_NOFACE]; /* missing, replace by noface */
2312 2303
2313 key.texname = tex.name; 2304 key.texname = tex.name;
2314 arr = rc_array (rc, &key); 2305 arr = &rc.array (key);
2315 } 2306 }
2316 2307
2317 px = (x + 1) * Th - tex.w; 2308 px = (x + 1) * Th - tex.w;
2318 py = (y + 1) * Tw - tex.h; 2309 py = (y + 1) * Tw - tex.h;
2319 2310
2323 pl_y = py; 2314 pl_y = py;
2324 pl_tex = tex; 2315 pl_tex = tex;
2325 continue; 2316 continue;
2326 } 2317 }
2327 2318
2328 rc_t2f_v3f (arr, 0 , 0 , px , py , 0); 2319 arr->t2f_v3f (0 , 0 , px , py , 0);
2329 rc_t2f_v3f (arr, 0 , tex.t, px , py + tex.h, 0); 2320 arr->t2f_v3f (0 , tex.t, px , py + tex.h, 0);
2330 rc_t2f_v3f (arr, tex.s, tex.t, px + tex.w, py + tex.h, 0); 2321 arr->t2f_v3f (tex.s, tex.t, px + tex.w, py + tex.h, 0);
2331 rc_t2f_v3f (arr, tex.s, 0 , px + tex.w, py , 0); 2322 arr->t2f_v3f (tex.s, 0 , px + tex.w, py , 0);
2332 2323
2333 // update smooth hash 2324 // update smooth hash
2334 if (tex.smoothtile) 2325 if (tex.smoothtile)
2335 { 2326 {
2336 skey.tile = tex.smoothtile; 2327 skey.tile = tex.smoothtile;
2337 skey.level = tex.smoothlevel; 2328 skey.level = tex.smoothlevel;
2338 2329
2339 smooth_level [tex.smoothlevel >> 5] |= ((uint32_t)1) << (tex.smoothlevel & 31); 2330 smooth_level[tex.smoothlevel] = 1;
2340 2331
2341 // add bits to current tile and all neighbours. skey.x|y is 2332 // add bits to current tile and all neighbours. skey.x|y is
2342 // shifted +1|+1 so we always stay positive. 2333 // shifted +1|+1 so we always stay positive.
2343 2334
2344 // bits is ___n cccc CCCC bbbb 2335 // bits is ___n cccc CCCC bbbb
2374 { 2365 {
2375 // overlays such as the speech bubble, probably more to come 2366 // overlays such as the speech bubble, probably more to come
2376 if (cell->flags & 1) 2367 if (cell->flags & 1)
2377 { 2368 {
2378 rc_key_t key_ov = key; 2369 rc_key_t key_ov = key;
2379 maptex tex = self->tex [TEXID_SPEECH]; 2370 maptex tex = self->tex[TEXID_SPEECH];
2380 rc_array_t *arr;
2381 int px = x * Tw + Tw * 2 / 32; 2371 int px = x * Tw + Tw * 2 / 32;
2382 int py = y * Th - Th * 6 / 32; 2372 int py = y * Th - Th * 6 / 32;
2383 2373
2384 key_ov.texname = tex.name; 2374 key_ov.texname = tex.name;
2385 arr = rc_array (rc_ov, &key_ov); 2375 rc_t::array_t &arr = rc_ov.array (key_ov);
2386 2376
2387 rc_t2f_v3f (arr, 0 , 0 , px , py , 0); 2377 arr.t2f_v3f (0 , 0 , px , py , 0);
2388 rc_t2f_v3f (arr, 0 , tex.t, px , py + Th, 0); 2378 arr.t2f_v3f (0 , tex.t, px , py + Th, 0);
2389 rc_t2f_v3f (arr, tex.s, tex.t, px + Tw, py + Th, 0); 2379 arr.t2f_v3f (tex.s, tex.t, px + Tw, py + Th, 0);
2390 rc_t2f_v3f (arr, tex.s, 0 , px + Tw, py , 0); 2380 arr.t2f_v3f (tex.s, 0 , px + Tw, py , 0);
2391 } 2381 }
2392 } 2382 }
2393 } 2383 }
2394 } 2384 }
2395 2385
2396 rc_draw (rc); 2386 rc.draw ();
2397 rc_clear (rc); 2387 rc.clear ();
2398 2388
2399 // go through all smoothlevels, lowest to highest, then draw. 2389 // go through all smoothlevels, lowest to highest, then draw.
2400 // this is basically counting sort 2390 // this is basically counting sort
2401 { 2391 {
2402 int w, b; 2392 int w, b;
2403 2393
2404 glEnable (GL_TEXTURE_2D); 2394 glEnable (GL_TEXTURE_2D);
2405 glBegin (GL_QUADS); 2395 glBegin (GL_QUADS);
2406 for (w = 0; w < 256 / 32; ++w) 2396 for (int level = 0; level < smooth_level.size (); ++level)
2397 if (smooth_level[level])
2398 for (auto &&it = smooth.begin (); it != smooth.end (); ++it)
2407 { 2399 {
2408 uint32_t smask = smooth_level [w]; 2400 smooth_key &skey = it->first;
2409 if (smask) 2401 IV bits = it->second;
2410 for (b = 0; b < 32; ++b) 2402
2411 if (smask & (((uint32_t)1) << b)) 2403 if (!(bits & 0x1000)
2404 && skey.level == level
2405 && level > smooth_max [skey.x][skey.y])
2412 { 2406 {
2413 int level = (w << 5) | b; 2407 maptex tex = self->tex [skey.tile];
2408 int px = (((int)skey.x) - 1) * Tw;
2409 int py = (((int)skey.y) - 1) * Th;
2410 int border = bits & 15;
2411 int corner = (bits >> 8) & ~(bits >> 4) & 15;
2412 float dx = tex.s * .0625f; // 16 images/row
2413 float dy = tex.t * .5f ; // 2 images/column
2414
2414 HE *he; 2415 if (tex.name)
2415
2416 for (auto &&it = smooth.begin (); it != smooth.end (); ++it)
2417 { 2416 {
2418 smooth_key &skey = it->first; 2417 // this time avoiding texture state changes
2419 IV bits = it->second; 2418 // save gobs of state changes.
2420 2419 if (key.texname != tex.name)
2421 if (!(bits & 0x1000)
2422 && skey.level == level
2423 && level > smooth_max [skey.x][skey.y])
2424 { 2420 {
2425 maptex tex = self->tex [skey.tile];
2426 int px = (((int)skey.x) - 1) * Tw;
2427 int py = (((int)skey.y) - 1) * Th;
2428 int border = bits & 15;
2429 int corner = (bits >> 8) & ~(bits >> 4) & 15;
2430 float dx = tex.s * .0625f; // 16 images/row
2431 float dy = tex.t * .5f ; // 2 images/column
2432
2433 if (tex.name)
2434 {
2435 // this time avoiding texture state changes
2436 // save gobs of state changes.
2437 if (key.texname != tex.name)
2438 {
2439 self->tex [skey.tile].unused = 0; 2421 self->tex [skey.tile].unused = 0;
2440 2422
2441 glEnd (); 2423 glEnd ();
2442 glBindTexture (GL_TEXTURE_2D, key.texname = tex.name); 2424 glBindTexture (GL_TEXTURE_2D, key.texname = tex.name);
2443 glBegin (GL_QUADS); 2425 glBegin (GL_QUADS);
2444 } 2426 }
2445 2427
2446 if (border) 2428 if (border)
2447 { 2429 {
2448 float ox = border * dx; 2430 float ox = border * dx;
2449 2431
2450 glTexCoord2f (ox , 0.f ); glVertex2i (px , py ); 2432 glTexCoord2f (ox , 0.f ); glVertex2i (px , py );
2451 glTexCoord2f (ox , dy ); glVertex2i (px , py + Th); 2433 glTexCoord2f (ox , dy ); glVertex2i (px , py + Th);
2452 glTexCoord2f (ox + dx, dy ); glVertex2i (px + Tw, py + Th); 2434 glTexCoord2f (ox + dx, dy ); glVertex2i (px + Tw, py + Th);
2453 glTexCoord2f (ox + dx, 0.f ); glVertex2i (px + Tw, py ); 2435 glTexCoord2f (ox + dx, 0.f ); glVertex2i (px + Tw, py );
2454 } 2436 }
2455 2437
2456 if (corner) 2438 if (corner)
2457 { 2439 {
2458 float ox = corner * dx; 2440 float ox = corner * dx;
2459 2441
2460 glTexCoord2f (ox , dy ); glVertex2i (px , py ); 2442 glTexCoord2f (ox , dy ); glVertex2i (px , py );
2461 glTexCoord2f (ox , dy * 2.f); glVertex2i (px , py + Th); 2443 glTexCoord2f (ox , dy * 2.f); glVertex2i (px , py + Th);
2462 glTexCoord2f (ox + dx, dy * 2.f); glVertex2i (px + Tw, py + Th); 2444 glTexCoord2f (ox + dx, dy * 2.f); glVertex2i (px + Tw, py + Th);
2463 glTexCoord2f (ox + dx, dy ); glVertex2i (px + Tw, py ); 2445 glTexCoord2f (ox + dx, dy ); glVertex2i (px + Tw, py );
2464 }
2465 }
2466 } 2446 }
2467 } 2447 }
2468 } 2448 }
2469 } 2449 }
2470 2450
2471 glEnd (); 2451 glEnd ();
2472 glDisable (GL_TEXTURE_2D); 2452 glDisable (GL_TEXTURE_2D);
2473 key.texname = -1; 2453 key.texname = -1;
2474 } 2454 }
2479 maptex tex = pl_tex; 2459 maptex tex = pl_tex;
2480 int px = pl_x + sdx; 2460 int px = pl_x + sdx;
2481 int py = pl_y + sdy; 2461 int py = pl_y + sdy;
2482 2462
2483 key.texname = tex.name; 2463 key.texname = tex.name;
2484 arr = rc_array (rc, &key); 2464 rc_t::array_t &arr = rc.array (key);
2485 2465
2486 rc_t2f_v3f (arr, 0 , 0 , px , py , 0); 2466 arr.t2f_v3f (0 , 0 , px , py , 0);
2487 rc_t2f_v3f (arr, 0 , tex.t, px , py + tex.h, 0); 2467 arr.t2f_v3f (0 , tex.t, px , py + tex.h, 0);
2488 rc_t2f_v3f (arr, tex.s, tex.t, px + tex.w, py + tex.h, 0); 2468 arr.t2f_v3f (tex.s, tex.t, px + tex.w, py + tex.h, 0);
2489 rc_t2f_v3f (arr, tex.s, 0 , px + tex.w, py , 0); 2469 arr.t2f_v3f (tex.s, 0 , px + tex.w, py , 0);
2490 2470
2491 rc_draw (rc); 2471 rc.draw ();
2492 } 2472 }
2493 2473
2494 rc_draw (rc_ov); 2474 rc_ov.draw ();
2495 rc_clear (rc_ov); 2475 rc_ov.clear ();
2496 2476
2497 glDisable (GL_BLEND); 2477 glDisable (GL_BLEND);
2498 rc_free (rc);
2499 rc_free (rc_ov);
2500 2478
2501 // top layer: overlays such as the health bar 2479 // top layer: overlays such as the health bar
2502 for (y = 0; y < sh; y++) 2480 for (y = 0; y < sh; y++)
2503 if (0 <= y + my && y + my < self->rows) 2481 if (0 <= y + my && y + my < self->rows)
2504 { 2482 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines