# HG changeset patch # User Matti Hamalainen # Date 1562662335 -10800 # Node ID 866e036d7706c65916315060d1970aaca3addf45 # Parent cd266022e4a8c32e6eb21f97fa303cf8c36e140d Clean up some code duplication. diff -r cd266022e4a8 -r 866e036d7706 tools/lib64fmts.c --- a/tools/lib64fmts.c Tue Jul 09 10:43:20 2019 +0300 +++ b/tools/lib64fmts.c Tue Jul 09 11:52:15 2019 +0300 @@ -456,17 +456,12 @@ static int fmtGetPixelDrazLace(Uint8 *col, const DMC64Image *img, const int rasterX, const int rasterY) { - const int - x = rasterX / 8, - y = rasterY / 8, - yoffs = y * img->fmt->chWidth, - bmoffs = yoffs * 8 + (rasterY & 7) + (x * 8), - scroffs = yoffs + x, - vshift = 6 - (rasterX & 6); + DM_C64_GENERIC_SC_PIXEL_DEFS(img) + (void) vshift; return dmC64GetGenericMCPixel(col, img, bmoffs, scroffs, - vshift, 0, + 6 - (rasterX & 6), 0, rasterX & 1, 0, img->bgcolor); } @@ -792,17 +787,12 @@ static int fmtGetPixelTruePaint(Uint8 *col, const DMC64Image *img, const int rasterX, const int rasterY) { - const int - x = rasterX / 8, - y = rasterY / 8, - yoffs = y * img->fmt->chWidth, - bmoffs = yoffs * 8 + (rasterY & 7) + (x * 8), - scroffs = yoffs + x, - vshift = 6 - (rasterX & 6); + DM_C64_GENERIC_SC_PIXEL_DEFS(img) + (void) vshift; return dmC64GetGenericMCPixel(col, img, bmoffs, scroffs, - vshift, 0, + 6 - (rasterX & 6), 0, rasterX & 1, 0, img->bgcolor); }