hedgewars/hwengine.pas
changeset 11491 2b30283a402c
parent 11482 e425a6eb9da3
child 11502 66f1cff4284b
--- a/hedgewars/hwengine.pas	Sun Jan 10 12:59:03 2016 +0100
+++ b/hedgewars/hwengine.pas	Sun Jan 10 17:39:27 2016 +0100
@@ -155,11 +155,13 @@
     PrevTime, CurrTime: LongWord;
     isTerminated: boolean;
     previousGameState: TGameState;
+    wheelEvent: boolean;
 begin
     isTerminated:= false;
     PrevTime:= SDL_GetTicks;
     while isTerminated = false do
     begin
+        wheelEvent:= false;
         SDL_PumpEvents();
 
         while SDL_PeepEvents(@event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT) > 0 do
@@ -187,7 +189,10 @@
                     if (GameState >= gsGame) then ProcessMouse(event.button, false);
 
                 SDL_MOUSEWHEEL:
+                    begin
+                    wheelEvent:= true;
                     ProcessMouseWheel(event.wheel.x, event.wheel.y);
+                    end;
 
                 SDL_TEXTINPUT: uChat.TextInput(event.text);
 
@@ -239,6 +244,9 @@
             end; //end case event.type_ of
         end; //end while SDL_PollEvent(@event) <> 0 do
 
+        if (not wheelEvent) then
+            ResetMouseWheel();
+
         if (CursorMovementX <> 0) or (CursorMovementY <> 0) then
             handlePositionUpdate(CursorMovementX * cameraKeyboardSpeed, CursorMovementY * cameraKeyboardSpeed);