comparison tools/libgutil.c @ 2486:6d12670e0248

Rename DM_SWAP() macro to DM_SWAP_IF().
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 28 Apr 2020 14:45:44 +0300
parents ef08af6887b7
children
comparison
equal deleted inserted replaced
2485:fce2ed3f681f 2486:6d12670e0248
24 const int bpp = screen->format->BytesPerPixel, 24 const int bpp = screen->format->BytesPerPixel,
25 cx0 = screen->clip_rect.x, cy0 = screen->clip_rect.y, 25 cx0 = screen->clip_rect.x, cy0 = screen->clip_rect.y,
26 cx1 = screen->clip_rect.x + screen->clip_rect.w - 1, 26 cx1 = screen->clip_rect.x + screen->clip_rect.w - 1,
27 cy1 = screen->clip_rect.y + screen->clip_rect.h - 1; 27 cy1 = screen->clip_rect.y + screen->clip_rect.h - 1;
28 28
29 DM_SWAP(int, x0, x1); 29 DM_SWAP_IF(int, x0, x1);
30 if (yc < cy0|| yc > cy1 || x1 < cx0 || x0 > cx1) return; 30 if (yc < cy0|| yc > cy1 || x1 < cx0 || x0 > cx1) return;
31 if (x0 < cx0) x0 = cx0; 31 if (x0 < cx0) x0 = cx0;
32 if (x1 > cx1) x1 = cx1; 32 if (x1 > cx1) x1 = cx1;
33 33
34 int x = x1 - x0 + 1; 34 int x = x1 - x0 + 1;
57 pitch = screen->pitch / bpp, 57 pitch = screen->pitch / bpp,
58 cx0 = screen->clip_rect.x, cy0 = screen->clip_rect.y, 58 cx0 = screen->clip_rect.x, cy0 = screen->clip_rect.y,
59 cx1 = screen->clip_rect.x + screen->clip_rect.w - 1, 59 cx1 = screen->clip_rect.x + screen->clip_rect.w - 1,
60 cy1 = screen->clip_rect.y + screen->clip_rect.h - 1; 60 cy1 = screen->clip_rect.y + screen->clip_rect.h - 1;
61 61
62 DM_SWAP(int, y0, y1); 62 DM_SWAP_IF(int, y0, y1);
63 if (xc < cx0 || xc > cx1 || y1 < cy0 || y0 > cy1) return; 63 if (xc < cx0 || xc > cx1 || y1 < cy0 || y0 > cy1) return;
64 if (y0 < cy0) y0 = cy0; 64 if (y0 < cy0) y0 = cy0;
65 if (y1 > cy1) y1 = cy1; 65 if (y1 > cy1) y1 = cy1;
66 66
67 int y = y1 - y0 + 1; 67 int y = y1 - y0 + 1;