src/mess/video/intv.c
| r1507 | r1508 | |
| 61 | 61 | */ |
| 62 | 62 | } |
| 63 | 63 | |
| 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 |
| 69 | 64 | |
| 70 | | #ifdef min |
| 71 | | #undef min |
| 72 | | #endif |
| 73 | | #define min my_min |
| 74 | | |
| 75 | | static int max(int v1, int v2) { |
| 76 | | return (v1 > v2 ? v1 : v2); |
| 77 | | } |
| 78 | | |
| 79 | | static int min(int v1, int v2) { |
| 80 | | return (v1 < v2 ? v1 : v2); |
| 81 | | } |
| 82 | | |
| 83 | 65 | static int sprites_collide(int spriteNum0, int spriteNum1) { |
| 84 | 66 | UINT8 x1, x2, y1, y2, w1, w2, h1, h2, x0, y0, r0y, r1y, |
| 85 | 67 | width, height, x, y; |
| r1507 | r1508 | |
| 101 | 83 | return FALSE; |
| 102 | 84 | |
| 103 | 85 | //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); |
| 106 | 88 | r0y = 2*(y0-y1); |
| 107 | 89 | 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; |
| 110 | 92 | for (x = 0; x < width; x++) { |
| 111 | 93 | for (y = 0; y < height; y++) { |
| 112 | 94 | if (intv_sprite_buffers[spriteNum0][x0-x1+x][r0y+y] && |