fixed conflicting mouse button mask enum
authorJohn Tsiombikas <nuclear@member.fsf.org>
Sat, 1 Sep 2018 09:54:44 +0000 (12:54 +0300)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Sat, 1 Sep 2018 09:54:44 +0000 (12:54 +0300)
src/demo.c
src/demo.h
src/sdl/main.c

index 2ff25a7..0874104 100644 (file)
@@ -211,7 +211,7 @@ void mouse_orbit_update(float *theta, float *phi, float *dist)
                        int dy = mouse_y - prev_my;
 
                        if(dx || dy) {
-                               if(mouse_bmask & MOUSE_LEFT) {
+                               if(mouse_bmask & MOUSE_BN_LEFT) {
                                        float p = *phi;
                                        *theta += dx * 1.0;
                                        p += dy * 1.0;
@@ -220,7 +220,7 @@ void mouse_orbit_update(float *theta, float *phi, float *dist)
                                        if(p > 90) p = 90;
                                        *phi = p;
                                }
-                               if(mouse_bmask & MOUSE_RIGHT) {
+                               if(mouse_bmask & MOUSE_BN_RIGHT) {
                                        *dist += dy * 0.5;
 
                                        if(*dist < 0) *dist = 0;
index 63489c7..ac5ca06 100644 (file)
@@ -14,9 +14,9 @@ extern int mouse_x, mouse_y;
 extern unsigned int mouse_bmask;
 
 enum {
-       MOUSE_LEFT              = 1,
-       MOUSE_RIGHT             = 2,
-       MOUSE_MIDDLE    = 4
+       MOUSE_BN_LEFT           = 1,
+       MOUSE_BN_RIGHT          = 2,
+       MOUSE_BN_MIDDLE         = 4
 };
 
 extern float sball_matrix[16];
index 358d774..65ddd35 100644 (file)
@@ -123,11 +123,11 @@ static int bnmask(int sdlbn)
 {
        switch(sdlbn) {
        case SDL_BUTTON_LEFT:
-               return MOUSE_LEFT;
+               return MOUSE_BN_LEFT;
        case SDL_BUTTON_RIGHT:
-               return MOUSE_RIGHT;
+               return MOUSE_BN_RIGHT;
        case SDL_BUTTON_MIDDLE:
-               return MOUSE_MIDDLE;
+               return MOUSE_BN_MIDDLE;
        default:
                break;
        }