From b3cf94536edb87d019f679eee140e6dc8648bf40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marti=CC=81n=20Lucas=20Golini?= Date: Wed, 11 Jan 2023 01:52:32 -0300 Subject: [PATCH] Fixes issue SpartanJ/ecode#4 Fixes issue SpartanJ/ecode#3 --- .gitignore | 3 +-- projects/macos/ecode/{Info.plist => Info.plist.tpl} | 6 +++--- projects/macos/ecode/build.app.sh | 7 +++++++ src/eepp/window/backend/SDL2/inputsdl2.cpp | 1 + 4 files changed, 12 insertions(+), 5 deletions(-) rename projects/macos/ecode/{Info.plist => Info.plist.tpl} (86%) diff --git a/.gitignore b/.gitignore index 233633bf9..db613ff49 100644 --- a/.gitignore +++ b/.gitignore @@ -38,8 +38,7 @@ external_projects.lua src/thirdparty/SDL2/include/SDL2 projects/ios/eepp.app/assets projects/ios/eepp.app/eepp -bin/libeepp-debug.dylib -bin/libeepp.dylib +bin/*.dylib *.iml .idea/ eepp.kdev4 diff --git a/projects/macos/ecode/Info.plist b/projects/macos/ecode/Info.plist.tpl similarity index 86% rename from projects/macos/ecode/Info.plist rename to projects/macos/ecode/Info.plist.tpl index 1159c1d19..1d48ff8db 100644 --- a/projects/macos/ecode/Info.plist +++ b/projects/macos/ecode/Info.plist.tpl @@ -13,15 +13,15 @@ CFBundleIconFile ecode.icns CFBundleShortVersionString - 0.2 + ECODE_VERSION_STRING CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType APPL IFMajorVersion - 0 + ECODE_MAJOR_VERSION IFMinorVersion - 1 + ECODE_MINOR_VERSION NSHighResolutionCapable NSMainNibFile diff --git a/projects/macos/ecode/build.app.sh b/projects/macos/ecode/build.app.sh index 1e08ec625..61e72c606 100755 --- a/projects/macos/ecode/build.app.sh +++ b/projects/macos/ecode/build.app.sh @@ -4,7 +4,14 @@ rm -rf ./ecode.app mkdir -p ecode.app/Contents/MacOS/ mkdir -p ecode.app/Contents/Resources/ cp ../../../bin/assets/icon/ee.icns ecode.app/Contents/Resources/ecode.icns +VERSIONPATH=../../../src/tools/ecode/version.hpp +ECODE_MAJOR_VERSION=$(grep "define ECODE_MAJOR_VERSION" $VERSIONPATH | awk '{print $3}') +ECODE_MINOR_VERSION=$(grep "define ECODE_MINOR_VERSION" $VERSIONPATH | awk '{print $3}') +ECODE_PATCH_LEVEL=$(grep "define ECODE_PATCH_LEVEL" $VERSIONPATH | awk '{print $3}') +ECODE_VERSION_STRING="$ECODE_MAJOR_VERSION"."$ECODE_MINOR_VERSION"."$ECODE_PATCH_LEVEL" +cat Info.plist.tpl | sed "s/ECODE_VERSION_STRING/${ECODE_VERSION_STRING}/g" | sed "s/ECODE_MAJOR_VERSION/${ECODE_MAJOR_VERSION}/g" | sed "s/ECODE_MINOR_VERSION/${ECODE_MINOR_VERSION}/g" > Info.plist cp Info.plist ecode.app/Contents/ +rm Info.plist chmod +x run.sh cp run.sh ecode.app/Contents/MacOS cp ../../../libs/macosx/libeepp.dylib ecode.app/Contents/MacOS diff --git a/src/eepp/window/backend/SDL2/inputsdl2.cpp b/src/eepp/window/backend/SDL2/inputsdl2.cpp index 5d538e32b..ca983269a 100644 --- a/src/eepp/window/backend/SDL2/inputsdl2.cpp +++ b/src/eepp/window/backend/SDL2/inputsdl2.cpp @@ -129,6 +129,7 @@ void InputSDL::sendEvent( const SDL_Event& SDLEvent ) { case SDL_WINDOWEVENT_RESIZED: { event.Type = InputEvent::VideoResize; event.WinID = SDLEvent.window.windowID; + mDPIScale = mWindow->getScale(); event.resize.w = SDLEvent.window.data1 * mDPIScale; event.resize.h = SDLEvent.window.data2 * mDPIScale; break;