From: John Tsiombikas Date: Sat, 1 Sep 2018 09:54:44 +0000 (+0300) Subject: fixed conflicting mouse button mask enum X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosrtxon;a=commitdiff_plain;h=1d7a39ac5b29d684972014960289032c12b64baf fixed conflicting mouse button mask enum --- diff --git a/src/demo.c b/src/demo.c index 2ff25a7..0874104 100644 --- a/src/demo.c +++ b/src/demo.c @@ -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; diff --git a/src/demo.h b/src/demo.h index 63489c7..ac5ca06 100644 --- a/src/demo.h +++ b/src/demo.h @@ -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]; diff --git a/src/sdl/main.c b/src/sdl/main.c index 358d774..65ddd35 100644 --- a/src/sdl/main.c +++ b/src/sdl/main.c @@ -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; }