Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/bme/bme_win.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ unsigned win_mousexrel = 0;
unsigned win_mouseyrel = 0;
unsigned win_mousebuttons = 0;
int win_mousemode = MOUSE_FULLSCREEN_HIDDEN;
float win_mouseywheel = 0.f;
unsigned char win_keystate[SDL_SCANCODE_COUNT] = {0};

// Static variables
Expand Down Expand Up @@ -123,6 +124,7 @@ void win_checkmessages(void)
unsigned keynum;

win_activateclick = 0;
win_mouseywheel = 0.f;

SDL_PumpEvents();

Expand Down Expand Up @@ -192,6 +194,10 @@ void win_checkmessages(void)
}
break;

case SDL_EVENT_MOUSE_WHEEL:
win_mouseywheel = event.wheel.y;
break;

case SDL_EVENT_QUIT:
win_quitted = 1;
break;
Expand Down
1 change: 1 addition & 0 deletions src/bme/bme_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ extern unsigned win_mousexrel;
extern unsigned win_mouseyrel;
extern unsigned win_mousebuttons;
extern int win_mousemode;
extern float win_mouseywheel;
extern SDL_Joystick *joy[MAX_JOYSTICKS];
extern Sint16 joyx[MAX_JOYSTICKS];
extern Sint16 joyy[MAX_JOYSTICKS];
Expand Down
17 changes: 15 additions & 2 deletions src/loadtrk.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ void waitkeymouse(void)
getkey();
if ((rawkey) || (key)) break;
if (win_quitted) break;
if (mouseb) break;
if (mouseb || (win_mouseywheel != 0.f)) break;
}

converthex();
Expand Down Expand Up @@ -683,6 +683,20 @@ void mousecommands(void)
currentSonglen = songlen_stereo[esnum][eschn];
}

if (win_mouseywheel != 0.f)
{
if ((mousey >= dpos.patternsY) &&
(mousey <= dpos.statusBottomY - 1) &&
(mousex >= dpos.patternsX) &&
(mousex <= dpos.patternsX + 11 + (maxChns-1)*13))
{
if (win_mouseywheel > 0.f)
patternup();
else if (win_mouseywheel < 0.f)
patterndown();
}
}

if (!mouseb) return;

// Pattern editpos & pattern number selection
Expand Down Expand Up @@ -845,7 +859,6 @@ void mousecommands(void)
if (mouseb & MOUSEB_RIGHT) previnstr();
}


// Table editpos
for (c = 0; c < MAX_TABLES; c++)
{
Expand Down
Loading