diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa26b69d..df297907 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,7 +60,7 @@ jobs: uses: jurplel/install-qt-action@v3 with: aqtversion: '==3.1.*' - version: '6.6.0' + version: '6.6.1' host: ${{ matrix.host }} target: 'desktop' arch: ${{ matrix.arch }} diff --git a/.gitignore b/.gitignore index e3709844..68a6e62b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /CMakeLists.txt.user /extern/* +/doc/* +/doc diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b59f5fd..106f20c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,6 +81,8 @@ endif() include(cmake/alp_add_git_repository.cmake) alp_add_git_repository(renderer_static_data URL https://github.com/AlpineMapsOrg/renderer_static_data.git COMMITISH origin/main DO_NOT_ADD_SUBPROJECT) alp_add_git_repository(alpineapp_fonts URL https://github.com/AlpineMapsOrg/fonts.git COMMITISH origin/main DO_NOT_ADD_SUBPROJECT) +alp_add_git_repository(doc URL https://github.com/AlpineMapsOrg/documentation.git COMMITISH origin/main DO_NOT_ADD_SUBPROJECT DESTINATION_PATH doc) + if (ANDROID) alp_add_git_repository(android_openssl URL https://github.com/KDAB/android_openssl.git COMMITISH origin/master DO_NOT_ADD_SUBPROJECT) diff --git a/README.md b/README.md index 6d9cfb08..9a1e0d59 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,20 @@ We use Qt Creator (with mingw on Windows), which is the only tested setup atm an * Some other dependencies will be pulled automatically during building. ## Building the android version -* Due to a [bug](https://bugreports.qt.io/browse/QTBUG-113851) in the Qt/cmake/gradle build system for android, you need to delete all `libc.so` files from the build dir before rebuilding (yes! no, that's not a joke). There is a script that does that in linux [renderer/android/workaround_qt_cmake_build_bug.sh](https://github.com/AlpineMapsOrg/renderer/blob/main/android/workaround_qt_cmake_build_bug.sh), please don't run it anywhere important, definitely not as root;) ). You can add it as a custom build step before everything else in qt creator (in the %{buildDir} working directory). +* We are usually building with Qt Creator, because it works relatively out of the box. However, it should also work on the command line or other IDEs if you set it up correctly. +* You need a Java JDK before you can do anything else. Not all Java versions work, and the error messages might be surprising (or non-existant). I'm running with Java 19, and I can compile for old devices. Iirc a newer version of Java caused issues. [Android documents the required Java version](https://developer.android.com/build/jdks), but as said, for me Java 19 works as well. It might change in the future. +* Once you have Java, go to Qt Creator Preferences -> Devices -> Android. There click "Set Up SDK" to automatically download and install an Android SDK. +* Finally, you might need to click on SDK Manager to install a fitting SDK Platform (take the newest, it also works for older devices), and ndk (newest as well). +* Then Google the internet to find out how to enable the developer mode on Android. +* On linux, you'll have to setup some udev rules. Run `Android/SDK/platform-tools/adb devices` and you should get instructions. +* If there are problems, check out the [documentation from Qt](https://doc.qt.io/qt-6/android-getting-started.html) +* Finally, you are welcome to ask in discord if something is not working! ## Building the WebAssembly version: * Atm, none of the Qt versions works perfectly in all browsers * In Qt 6.6 touch doesn't work on Firefox (issues #33) -* [WebAssembly version compatible with the Qt version](https://doc-snapshots.qt.io/qt6-dev/wasm.html#installing-emscripten) -* The threaded version doesn't seem to work atm, so use the non-threaded! +* [The Qt documentation is quite good on how to get it to run](https://doc-snapshots.qt.io/qt6-dev/wasm.html#installing-emscripten). Be aware that only specific versions of emscripten work for specific versions of Qt, and the error messages are not helpfull. +* The threaded version doesn't seem to work atm, so use the non-threaded (bug reported)! * There are a number of other bugs, we track them with the upstream tag. # Code style diff --git a/app/android/workaround_qt_cmake_build_bug.sh b/app/android/workaround_qt_cmake_build_bug.sh deleted file mode 100755 index 445bb557..00000000 --- a/app/android/workaround_qt_cmake_build_bug.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - - -if ! pwd | grep -Eq ".*build.*Android.*" -# if [[ $(pwd) =~ "*build*Android*" ]] -then - echo -e "\033[1;31mIt seems we are not in an Android build dir. The workaround should be started only in a Android build dir, anything else could destroy your system (this safeguard can easily fail)!\033[0m" - echo -e "\033[33mReason: The directory $(pwd) doesn't match the regexp.\033[0m" - exit -fi - -for required_file_name in ./CMakeCache.txt build.ninja -do - if [ ! -f $required_file_name ] - then - echo -e "\033[1;31mIt seems we are not in an Android build dir. The workaround should be started only in an Android build dir, anything else could destroy your system (this safeguard can easily fail)!\033[0m" - echo -e "\033[33mReason: $required_file_name does not exist in $(pwd)\033[0m" - exit - fi -done - -for required_dir_name in app plain_renderer nucleus gl_engine sherpa CMakeFiles -do - if [ ! -d $required_dir_name ] - then - echo -e "\033[1;31mIt seems we are not in an Android build dir. The workaround should be started only in an Android build dir, anything else could destroy your system (this safeguard can easily fail)!\033[0m\n" - echo -e "\033[33mReason: The directory $required_dir_name does not exist in $(pwd)\033[0m" - exit - fi -done - -echo -e "\033[1;32mDeleting all libc.so from the build directory as a workaround for QTBUG-111284 / QTBUG-113851 (UnsatisfiedLinkError on Android)\033[0m" -echo -e "\033[32mNote: In directory $(pwd)\033[0m" -find -iname "libc.so" -delete diff --git a/app/main.cpp b/app/main.cpp index 46514a3a..f4f64ceb 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -48,7 +48,6 @@ int main(int argc, char **argv) { - // QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Floor); QQuickWindow::setGraphicsApi(QSGRendererInterface::GraphicsApi::OpenGLRhi); QApplication app(argc, argv); app.setWindowIcon(QIcon("app/icons/favicon.ico")); diff --git a/cmake/alp_add_git_repository.cmake b/cmake/alp_add_git_repository.cmake index 4e36360b..4938457f 100644 --- a/cmake/alp_add_git_repository.cmake +++ b/cmake/alp_add_git_repository.cmake @@ -26,13 +26,17 @@ find_package(Git 2.22 REQUIRED) function(alp_add_git_repository name) set(options DO_NOT_ADD_SUBPROJECT) - set(oneValueArgs URL COMMITISH) + set(oneValueArgs URL COMMITISH DESTINATION_PATH) set(multiValueArgs ) cmake_parse_arguments(PARSE_ARGV 1 PARAM "${options}" "${oneValueArgs}" "${multiValueArgs}") file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/${ALP_EXTERN_DIR} ) set(repo_dir ${CMAKE_SOURCE_DIR}/${ALP_EXTERN_DIR}/${name}) set(short_repo_dir ${ALP_EXTERN_DIR}/${name}) + if (DEFINED PARAM_DESTINATION_PATH AND NOT PARAM_DESTINATION_PATH STREQUAL "") + set(repo_dir ${CMAKE_SOURCE_DIR}/${PARAM_DESTINATION_PATH}) + set(short_repo_dir ${PARAM_DESTINATION_PATH}) + endif() set(${name}_SOURCE_DIR "${repo_dir}" PARENT_SCOPE) @@ -70,8 +74,7 @@ function(alp_add_git_repository name) endif() else() message(STATUS "Clonging ${PARAM_URL} to ${short_repo_dir}.") - execute_process(COMMAND ${GIT_EXECUTABLE} clone --recurse-submodules ${PARAM_URL} ${name} - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/${ALP_EXTERN_DIR} + execute_process(COMMAND ${GIT_EXECUTABLE} clone --recurse-submodules ${PARAM_URL} ${repo_dir} RESULT_VARIABLE GIT_CLONE_RESULT) if (NOT ${GIT_CLONE_RESULT}) execute_process(COMMAND ${GIT_EXECUTABLE} checkout --quiet ${PARAM_COMMITISH} diff --git a/doc/gl_renderer_design.svg b/doc/gl_renderer_design.svg deleted file mode 100644 index 3edf5969..00000000 --- a/doc/gl_renderer_design.svg +++ /dev/null @@ -1,3723 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - State diagram:https://webgl2fundamentals.org/webgl/lessons/resources/webgl-state-diagram.html#no-helpStackOverflow about what is the state of VAOs (index buffer, pointers and formats to vertex data buffers):https://stackoverflow.com/questions/20908828/are-vertexarrayobjects-used-in-practiceStackOverflow on replacing (the old) glVertexAttribPointer with a set of new functions, that set format and pointer separately:https://stackoverflow.com/questions/21153729/glbindvertexbuffer-vs-glbindbuffer/21154258https://stackoverflow.com/questions/37972229/glvertexattribpointer-and-glvertexattribformat-whats-the-differenceMore mildely related:State change is expensive, try reducing: https://www.youtube.com/watch?v=-bCeNzgiJ8I - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/doc/report_fancy_alpine_maps.pdf b/doc/report_fancy_alpine_maps.pdf deleted file mode 100644 index 6c25ff6f..00000000 Binary files a/doc/report_fancy_alpine_maps.pdf and /dev/null differ diff --git a/unittests/nucleus/nucleus_tile_scheduler_rate_limiter.cpp b/unittests/nucleus/nucleus_tile_scheduler_rate_limiter.cpp index e11b8bdd..3da19dab 100644 --- a/unittests/nucleus/nucleus_tile_scheduler_rate_limiter.cpp +++ b/unittests/nucleus/nucleus_tile_scheduler_rate_limiter.cpp @@ -29,6 +29,8 @@ constexpr auto timing_multiplicator = 200; #elif defined __ANDROID__ constexpr auto timing_multiplicator = 50; +#elif defined _MSC_VER +constexpr auto timing_multiplicator = 50; #else constexpr auto timing_multiplicator = 10; #endif