Mercurial > hg > dmlib
comparison tools/lib64gfx.h @ 2306:e798a41f27a5
Clean up some code duplication.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 08 Jul 2019 12:25:46 +0300 |
parents | ecc17b2e129e |
children | 0f8232c2af63 |
comparison
equal
deleted
inserted
replaced
2305:3bcad61594b4 | 2306:e798a41f27a5 |
---|---|
431 // | 431 // |
432 #define DM_C64_GENERIC_SC_PIXEL_DEFS(ximg) \ | 432 #define DM_C64_GENERIC_SC_PIXEL_DEFS(ximg) \ |
433 const int \ | 433 const int \ |
434 x = rasterX / 8, \ | 434 x = rasterX / 8, \ |
435 y = rasterY / 8, \ | 435 y = rasterY / 8, \ |
436 yb = rasterY & 7, \ | |
436 yoffs = y * ximg->fmt->chWidth, \ | 437 yoffs = y * ximg->fmt->chWidth, \ |
437 bmoffs = yoffs * 8 + (rasterY & 7) + (x * 8), \ | 438 bmoffs = yoffs * 8 + yb + (x * 8), \ |
438 scroffs = yoffs + x, \ | 439 scroffs = yoffs + x, \ |
439 vshift = 7 - (rasterX & 7); | 440 vshift = 7 - (rasterX & 7); |
440 | 441 |
441 | 442 |
442 #define DM_C64_GENERIC_MC_PIXEL_DEFS(ximg) \ | 443 #define DM_C64_GENERIC_MC_PIXEL_DEFS(ximg) \ |
443 const int \ | 444 const int \ |
444 x = rasterX / 4, \ | 445 x = rasterX / 4, \ |
445 y = rasterY / 8, \ | 446 y = rasterY / 8, \ |
447 yb = rasterY & 7, \ | |
446 yoffs = y * (ximg)->fmt->chWidth, \ | 448 yoffs = y * (ximg)->fmt->chWidth, \ |
447 bmoffs = yoffs * 8 + (rasterY & 7) + (x * 8), \ | 449 bmoffs = yoffs * 8 + yb + (x * 8), \ |
448 scroffs = yoffs + x, \ | 450 scroffs = yoffs + x, \ |
449 vshift = 6 - ((rasterX * 2) & 6); | 451 vshift = 6 - ((rasterX * 2) & 6); |
450 | 452 |
451 | 453 |
452 #define DM_C64_GENERIC_CHAR_PIXEL(ximg) \ | 454 #define DM_C64_GENERIC_CHAR_PIXEL(ximg) \ |