X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fmsdos.c;h=7c60e7512b624f327a752f8142cf7bfc125484a2;hb=0c2b6a7610933f9098ec233f7b4c2b52eac3535c;hp=05948fd9f8ccca1e0373abe93201a92f44604768;hpb=50c422d96b6da2c0412b6bd3763e9d1a029a6014;p=rocksndiamonds.git diff --git a/src/msdos.c b/src/msdos.c index 05948fd9..7c60e751 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -525,7 +525,7 @@ static BITMAP *Read_PCX_to_AllegroBitmap(char *filename) if ((bitmap = Image_to_AllegroBitmap(image)) == NULL) return NULL; - set_pallete(global_colormap); + set_palette(global_colormap); return bitmap; } @@ -741,14 +741,18 @@ int XPending(Display *display) /* mouse button event */ if (mouse_b != last_mouse_b) { - for (i=1; i<4; i<<=1) + for (i=0; i<3; i++) /* check all three mouse buttons */ { - if ((last_mouse_b & i) != (mouse_b & i)) + int bitmask = (1 << i); + + if ((last_mouse_b & bitmask) != (mouse_b & bitmask)) { + int mapping[3] = { 1, 3, 2 }; + pending_events++; xbutton = (XButtonEvent *)&event_buffer[pending_events]; - xbutton->type = (mouse_b & i ? ButtonPress : ButtonRelease); - xbutton->button = i; + xbutton->type = (mouse_b & bitmask ? ButtonPress : ButtonRelease); + xbutton->button = mapping[i]; xbutton->x = mouse_x - display->screens[display->default_screen].x; xbutton->y = mouse_y - display->screens[display->default_screen].y; }