ref: 8fdd9fd8f11094993f6ef7cff482093a022e7681
parent: a5d7c6f7104a6f4beaa653f24794dcd79a425110
author: Olav Sørensen <olav.sorensen@live.no>
date: Fri Jul 8 14:35:52 EDT 2022
Remove compiler warnings
--- a/make-linux.sh
+++ b/make-linux.sh
@@ -3,7 +3,7 @@
rm release/other/ft2-clone &> /dev/null
echo Compiling, please wait patiently...
-gcc -DNDEBUG -DHAS_MIDI -D__LINUX_ALSA__ -DHAS_LIBFLAC src/rtmidi/*.cpp src/gfxdata/*.c src/mixer/*.c src/scopes/*.c src/modloaders/*.c src/smploaders/*.c src/libflac/*.c src/*.c -lSDL2 -lpthread -lasound -lstdc++ -lm -Wshadow -Winit-self -Wall -Wno-missing-field-initializers -Wno-unused-result -Wno-strict-aliasing -Wextra -Wunused -Wunreachable-code -Wswitch-default -march=native -mtune=native -O3 -o release/other/ft2-clone
+gcc -DNDEBUG -DHAS_MIDI -D__LINUX_ALSA__ -DHAS_LIBFLAC src/rtmidi/*.cpp src/gfxdata/*.c src/mixer/*.c src/scopes/*.c src/modloaders/*.c src/smploaders/*.c src/libflac/*.c src/*.c -lSDL2 -lpthread -lasound -lstdc++ -lm -Wshadow -Winit-self -Wall -Wno-missing-field-initializers -Wno-unused-result -Wno-strict-aliasing -Wextra -Wunused -Wunreachable-code -Wswitch-default -Wno-stringop-overflow -march=native -mtune=native -O3 -o release/other/ft2-clone
rm src/rtmidi/*.o src/gfxdata/*.o src/*.o &> /dev/null
--- a/src/ft2_mouse.c
+++ b/src/ft2_mouse.c
@@ -685,7 +685,7 @@
}
// mouse 0,0 = open exit dialog (also make sure the test always works in fullscreen mode)
- if (mouse.x == 0 && mouse.y == 0 || (video.fullscreen && (video.renderX > 0 || video.renderY > 0) && (mouse.rawX == 0 && mouse.rawY == 0)))
+ if ((mouse.x == 0 && mouse.y == 0) || (video.fullscreen && (video.renderX > 0 || video.renderY > 0) && (mouse.rawX == 0 && mouse.rawY == 0)))
{
if (quitBox(false) == 1)
editor.throwExit = true;
@@ -834,8 +834,12 @@
{
mouse.buttonState = SDL_GetGlobalMouseState(&mx, &my);
+ mouse.absX = mx;
+ mouse.absY = my;
+
// convert desktop coords to window coords
SDL_GetWindowPosition(video.window, &windowX, &windowY);
+
mx -= windowX;
my -= windowY;
}
@@ -843,6 +847,9 @@
{
// special mode for KMSDRM (XXX: Confirm that this still works...)
mouse.buttonState = SDL_GetMouseState(&mx, &my);
+
+ mouse.absX = mx;
+ mouse.absY = my;
}
mouse.rawX = mx;