Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
GeraldKimmersdorfer committed Dec 1, 2023
2 parents b4fd748 + 45f331d commit 36e1221
Show file tree
Hide file tree
Showing 38 changed files with 224 additions and 4,180 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/CMakeLists.txt.user
/extern/*
/doc/*
/doc
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 7 additions & 10 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,22 @@ qt_add_qml_module(alpineapp
StatsWindow.qml
GeneralSettings.qml
GlSettings.qml
FABGroup.qml
components/ValSlider.qml
components/ValRangeSlider.qml
FloatingActionButtonGroup.qml
components/LabledSlider.qml
components/LabledRangeSlider.qml
components/ColorPicker.qml
components/PageDrawer.qml
components/CheckGroup.qml
components/SetPanel.qml
components/SetTitle.qml
components/SettingsPanel.qml
components/SettingsTitle.qml
components/DrawerButton.qml
components/DrawerSeparator.qml
components/DrawerSpacer.qml
components/VectorEditor.qml
components/DatePicker.qml
components/DateMonthTablePicker.qml
components/RoundMapButton.qml
components/FAButton.qml
components/FloatingActionButton.qml
RESOURCES
icons/camera_operation_centre.svg
icons/compass.svg
icons/current_location.svg
icons/mascot.jpg
icons/menu.svg
icons/peak.svg
Expand All @@ -86,6 +82,7 @@ qt_add_qml_module(alpineapp
icons/material/navigation.svg
icons/material/navigation_offset.svg
icons/material/chevron_left.svg
icons/material/visibility_off.svg
icons/presets/basic.png
icons/presets/shaded.png
icons/presets/snow.png
Expand Down
19 changes: 10 additions & 9 deletions app/FABGroup.qml → app/FloatingActionButtonGroup.qml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*****************************************************************************
* Alpine Terrain Renderer
* Copyright (C) 2023 Adam Celarek
* Copyright (C) 2023 Gerald Kimmersdorfer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -57,21 +58,21 @@ ColumnLayout {
}
}

FAButton {
FloatingActionButton {
rotation: map.camera_rotation_from_north
image: "../icons/material/navigation_offset.svg"
onClicked: map.rotate_north()
size: parent.width
}

FAButton {
FloatingActionButton {
id: fab_location
image: checked ? "../icons/material/my_location.svg" : "../icons/material/location_searching.svg"
checkable: true
size: parent.width
}

FAButton {
FloatingActionButton {
id: fab_presets
image: checked ? "../icons/material/chevron_left.svg" : "../icons/material/format_paint.svg"
size: parent.width
Expand All @@ -92,9 +93,9 @@ ColumnLayout {
spacing: 0
height: parent.height

FAButton {
FloatingActionButton {
image: "../icons/presets/basic.png"
onClicked: map.set_gl_preset("AAABVHjaY2BgYLL_wAAGGPRhY2EHIL3_1sRPCSD-6yYtMP8y37QHDAiAU__NmTMXgOgHDAIMWGi4_h8Q2oGDAQU4OGA31yGTAS9wsIPSIlC63wFFH4yGm_sAlSYBKAAxIxTDAQAHqCOM")
onClicked: map.set_gl_preset("AAABIHjaY2BgYLL_wAAGGPRhY2EHEP303YEDIPrZPr0FQHr_EU-HBAYEwKn_5syZIPX2DxgEGLDQcP0_ILQDBwMKcHBgwAoc7KC0CJTuhyh0yGRAoeHueIBK4wAKQMwIxXAAAFQuIIw")
size: parent.height
image_size: 42
image_opacity: 1.0
Expand All @@ -103,9 +104,9 @@ ColumnLayout {
ToolTip.text: qsTr("BASIC-Preset: Fast with no shading")
}

FAButton {
FloatingActionButton {
image: "../icons/presets/shaded.png"
onClicked: map.set_gl_preset("AAABVHjaY2BgYLL_wAAGGPSRapEGIL3_1sRPCSD-6yYtBxD_Mt-0BwwIgFP_HY07CiD6AYMAAxYarv8HhHbgYEABDg7YzXXIZMALHOygtAiU7ndA0Qej4eY-QKWxAEY0GsZWgNIo8gALIiNv")
onClicked: map.set_gl_preset("AAABIHjaY2BgYLL_wAAGGPRhY2EHEP1s0rwEMG32D0TvPxS4yIEBAXDqvzlz5gIQ_YBBgAELDdf_A0I7cDCgAAcHBqzAwQ5Ki0DpfohCh0wGFBrujgeoNBAwQjEyXwFNHEwDAMaIIAM")
size: parent.height
image_size: 42
image_opacity: 1.0
Expand All @@ -114,9 +115,9 @@ ColumnLayout {
ToolTip.text: qsTr("SHADED-Preset: Shading + SSAO + CSM")
}

FAButton {
FloatingActionButton {
image: "../icons/presets/snow.png"
onClicked: map.set_gl_preset("AAABVHjaY2BgYLL_wAAGGPRhY2EHIL3_1sQLB0D8101mIPH9l_maExgQAKf-mzNnLgDRDxgEGLDQcP0_ILQDBwMKcHDAbq5DJqo6mDhcnx2UFoHS_Q4o-mA03NwHqDQWwIhGw9gKUBpFHgAbsyQ2")
onClicked: map.set_gl_preset("AAABIHjaY2BgYLL_wAAGGPRhY2EHEP1s0rwEMG32D0TvPxS4yIEBAXDqvzlz5gIQ_YBBgAELDdf_A0I7cDCgAAcHVPPg4nZQWgRK90MUOmQyoNBwdzxApYGAEYqR-Qpo4mAaAFhrITI")
size: parent.height
image_size: 42
image_opacity: 1.0
Expand Down
12 changes: 6 additions & 6 deletions app/GeneralSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import Alpine

import "components"

SetPanel {
SettingsPanel {
Component.onCompleted: {
// when creating the this component, values are read from the renderer
// after that we establish a binding, so this component can set values on the renderer
Expand Down Expand Up @@ -71,7 +71,7 @@ SetPanel {
}

Label { text: qsTr("Time:") }
ValSlider {
LabledSlider {
property int hours;
property int minutes;
id: currentTime;
Expand Down Expand Up @@ -110,19 +110,19 @@ SetPanel {
CheckGroup {
name: qsTr("Camera")
Label { text: qsTr("Field of view:") }
ValSlider {
LabledSlider {
id: fov_slider;
from: 15; to: 120; stepSize: 1;
}

Label { text: qsTr("Frame limiter:") }
ValSlider {
LabledSlider {
id: frame_rate_slider;
from: 2; to: 120; stepSize: 1;
}

Label { text: qsTr("Level of detail:") }
ValSlider {
LabledSlider {
id: lod_slider;
from: 0.1; to: 2.0; stepSize: 0.1;
}
Expand All @@ -132,7 +132,7 @@ SetPanel {
name: qsTr("Cache & Network")

Label { text: qsTr("Cache size:") }
ValSlider {
LabledSlider {
id: cache_size_slider;
from: 1000; to: 20000; stepSize: 1000;
}
Expand Down
73 changes: 20 additions & 53 deletions app/GlSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,11 @@ import Alpine

import "components"

SetPanel {
SettingsPanel {

function update_control_values() {
let conf = map.shared_config;
wireframe_mode.currentIndex = conf.wireframe_mode;
normal_mode.currentIndex = conf.normal_mode;
curtain_settings_mode.currentIndex = conf.curtain_settings.x;
curtain_settings_height_mode.currentIndex = conf.curtain_settings.y;
curtain_settings_height_reference.value = conf.curtain_settings.z;
height_lines_enabled.checked = conf.height_lines_enabled;
phong_enabled.checked = conf.phong_enabled;
sun_light_color.color = Qt.rgba(conf.sun_light.x, conf.sun_light.y, conf.sun_light.z, conf.sun_light.w);
Expand Down Expand Up @@ -101,11 +97,20 @@ SetPanel {
onActivated: map.shared_config.overlay_mode = currentValue;
}

Label {
visible: overlay_mode.currentValue > 0 && overlay_mode.currentValue < 100 && snow_enabled.checked
text: "This overlay does not work in combination with the snow cover activated!"
color: "red"
wrapMode: Text.WordWrap
Layout.preferredWidth: parent.width
Layout.columnSpan: 2
}

Label {
text: "Strength:"
visible: overlay_strength.visible;
}
ValSlider {
LabledSlider {
id: overlay_strength;
from: 0.0; to: 1.0; stepSize: 0.01;
visible: overlay_mode.currentValue > 0
Expand All @@ -121,15 +126,6 @@ SetPanel {
onCheckStateChanged: map.shared_config.overlay_postshading_enabled = this.checked;
}

Label { text: "Wireframe:" }
ComboBox {
id: wireframe_mode;
Layout.fillWidth: true;
model: ["disabled", "with shading", "white"];
currentIndex: 0; // Init with 0 necessary otherwise onCurrentIndexChanged gets emited on startup (because def:-1)!
onCurrentIndexChanged: map.shared_config.wireframe_mode = currentIndex;
}

Label { text: "Normals:" }
ComboBox {
id: normal_mode;
Expand All @@ -138,35 +134,6 @@ SetPanel {
currentIndex: 0; // Init with 0 necessary otherwise onCurrentIndexChanged gets emited on startup (because def:-1)!
onCurrentIndexChanged: map.shared_config.normal_mode = currentIndex;
}

}

CheckGroup {
name: "Curtains"
Label { text: "Mode:" }
ComboBox {
id: curtain_settings_mode;
Layout.fillWidth: true;
model: ["Off", "Normal", "Highlighted", "Hide Rest"]
currentIndex: 0; // Init with 0 necessary otherwise onCurrentIndexChanged gets emited on startup (because def:-1)!
onCurrentIndexChanged: map.shared_config.curtain_settings.x = currentIndex;
}

Label { text: "Height:" }
ComboBox {
id: curtain_settings_height_mode;
Layout.fillWidth: true;
model: ["Fixed", "Automatic"];
currentIndex: 0; // Init with 0 necessary otherwise onCurrentIndexChanged gets emited on startup (because def:-1)!
onCurrentIndexChanged: map.shared_config.curtain_settings.y = currentIndex;
}

Label { text: "Ref.-Height:" }
ValSlider {
id: curtain_settings_height_reference;
from: 1.0; to: 500.0; stepSize: 1.0;
onMoved: map.shared_config.curtain_settings.z = this.value;
}
}

CheckGroup {
Expand All @@ -183,43 +150,43 @@ SetPanel {
onCheckedChanged: map.shared_config.snow_settings_angle.x = this.checked;

Label { text: "Angle:" }
ValRangeSlider {
LabledRangeSlider {
id: snow_settings_angle;
from: 0.0; to: 90.0; stepSize: 0.1;
first.onMoved: map.shared_config.snow_settings_angle.y = this.first.value;
second.onMoved: map.shared_config.snow_settings_angle.z = this.second.value;
}

Label { text: "Angle Blend:" }
ValSlider {
LabledSlider {
id: snow_settings_angle_blend;
from: 0.0; to: 90.0; stepSize: 0.01;
onMoved: map.shared_config.snow_settings_angle.w = this.value;
}

Label { text: "Snow-Line:" }
ValSlider {
LabledSlider {
id: snow_settings_alt_min;
from: 0.0; to: 4000.0; stepSize: 1.0;
onMoved: map.shared_config.snow_settings_alt.x = this.value;
}

Label { text: "Snow-Line Variation:" }
ValSlider {
LabledSlider {
id: snow_settings_alt_var;
from: 0.0; to: 1000.0; stepSize: 1.0;
onMoved: map.shared_config.snow_settings_alt.y = this.value;
}

Label { text: "Snow-Line Blend:" }
ValSlider {
LabledSlider {
id: snow_settings_alt_blend;
from: 0.0; to: 1000.0; stepSize: 1.0;
onMoved: map.shared_config.snow_settings_alt.z = this.value;
}

Label { text: "Snow Specular:" }
ValSlider {
LabledSlider {
id: snow_settings_specular;
from: 0.0; to: 5.0; stepSize: 0.1;
onMoved: map.shared_config.snow_settings_alt.w = this.value;
Expand Down Expand Up @@ -284,21 +251,21 @@ SetPanel {
onCheckedChanged: map.shared_config.ssao_enabled = this.checked;

Label { text: "Kernel-Size:" }
ValSlider {
LabledSlider {
id: ssao_kernel;
from: 5; to: 64; stepSize: 1;
onMoved: map.shared_config.ssao_kernel = value;
}

Label { text: "Falloff-To:" }
ValSlider {
LabledSlider {
id: ssao_falloff_to_value;
from: 0.0; to: 1.0; stepSize: 0.01;
onMoved: map.shared_config.ssao_falloff_to_value = value;
}

Label { text: "Blur-Size:" }
ValSlider {
LabledSlider {
id: ssao_blur_kernel_size;
from: 0; to: 2; stepSize: 1; snapMode: Slider.SnapAlways;
onMoved: map.shared_config.ssao_blur_kernel_size = value;
Expand Down
Loading

0 comments on commit 36e1221

Please sign in to comment.