X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=blobdiff_plain;f=src%2Fmsdos.c;h=efcd80205918fd491e3524139bab1884c4fd071f;hp=ebc8319542c1863c22541662323d99327590b71f;hb=3d97e3d9c20a984e70dae5e63e7c5069fb136c91;hpb=182260bf970d56e056a8c0c580ad61302d21ab0f diff --git a/src/msdos.c b/src/msdos.c index ebc83195..efcd8020 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -52,9 +52,11 @@ static int global_colormap_entries_used = 0; boolean wait_for_vsync; +/* extern int playing_sounds; extern struct SoundControl playlist[MAX_SOUNDS_PLAYING]; extern struct SoundControl emptySoundControl; +*/ static BITMAP *Read_PCX_to_AllegroBitmap(char *); @@ -86,7 +88,7 @@ static void allegro_drivers() joystick_event = FALSE; reserve_voices(MAX_SOUNDS_PLAYING, 0); - if (install_sound(DIGI_AUTODETECT, MIDI_NONE, "ROCKS.SND") == -1) + if (install_sound(DIGI_AUTODETECT, MIDI_NONE, NULL) == -1) if (install_sound(DIGI_SB, MIDI_NONE, NULL) == -1) sound_status = SOUND_OFF; } @@ -739,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; } @@ -762,57 +768,6 @@ KeySym XLookupKeysym(XKeyEvent *key_event, int index) return key_event->state; } -void sound_handler(struct SoundControl snd_ctrl) -{ - int i; - - if (snd_ctrl.fade_sound) - { - if (!playing_sounds) - return; - - for (i=0; i