Previous 15994 Revisions Next

r1508 Saturday 12th January, 2008 at 12:53:11 UTC by Dirk Best
Cleanup of min/max functions
[src/mess/machine]spectrum.c
[src/mess/video]intv.c kc.c

src/mess/video/intv.c
r1507r1508
6161*/
6262}
6363
64/* NPW 20-Apr-2002 - Changing this to fix compilation errors with MSVC */
65#ifdef max
66#undef max
67#endif
68#define max   my_max
6964
70#ifdef min
71#undef min
72#endif
73#define min   my_min
74
75static int max(int v1, int v2) {
76    return (v1 > v2 ? v1 : v2);
77}
78
79static int min(int v1, int v2) {
80    return (v1 < v2 ? v1 : v2);
81}
82
8365static int sprites_collide(int spriteNum0, int spriteNum1) {
8466    UINT8 x1, x2, y1, y2, w1, w2, h1, h2, x0, y0, r0y, r1y,
8567          width, height, x, y;
r1507r1508
10183        return FALSE;
10284
10385    //iterate over the intersecting bits to see if any touch
104    x0 = max(x1, x2);
105    y0 = max(y1, y2);
86    x0 = MAX(x1, x2);
87    y0 = MAX(y1, y2);
10688    r0y = 2*(y0-y1);
10789    r1y = 2*(y0-y2);
108    width = min(x1+w1, x2+w2) - x0;
109    height = (min(y1+h1, y2+h2) - y0) * 2;
90    width = MIN(x1+w1, x2+w2) - x0;
91    height = (MIN(y1+h1, y2+h2) - y0) * 2;
11092    for (x = 0; x < width; x++) {
11193        for (y = 0; y < height; y++) {
11294            if (intv_sprite_buffers[spriteNum0][x0-x1+x][r0y+y] &&
src/mess/video/kc.c
r1507r1508
164164}
165165
166166
167#ifndef MIN
168#define MIN(a,b) ((a<b) ? a : b)
169#endif /* MIN */
170
171167/* height of screen in lines */
172168#define KC85_SCREEN_HEIGHT 256
173169/* width of display in pixels */
src/mess/machine/spectrum.c
r1507r1508
3535#include "image.h"
3636#include "utils.h"
3737
38#ifndef MIN
39#define MIN(x,y) ((x)<(y)?(x):(y))
40#endif
4138
4239static unsigned long TapePosition = 0;
4340static void spectrum_setup_sna(unsigned char *pSnapshot, unsigned long SnapshotSize);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team