diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9fb775e24f..0247cc9673 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,9 +3,6 @@ name: Build Cemu on: workflow_call: inputs: - deploymode: - required: false - type: string experimentalversion: required: false type: string @@ -24,20 +21,12 @@ jobs: submodules: "recursive" fetch-depth: 0 - - name: Setup release mode parameters (for deploy) - if: ${{ inputs.deploymode == 'release' }} + - name: Setup release mode parameters run: | echo "BUILD_MODE=release" >> $GITHUB_ENV echo "BUILD_FLAGS=" >> $GITHUB_ENV echo "Build mode is release" - - name: Setup debug mode parameters (for continous build) - if: ${{ inputs.deploymode != 'release' }} - run: | - echo "BUILD_MODE=debug" >> $GITHUB_ENV - echo "BUILD_FLAGS=" >> $GITHUB_ENV - echo "Build mode is debug" - - name: Setup version for experimental if: ${{ inputs.experimentalversion != '' }} run: | @@ -81,12 +70,10 @@ jobs: cmake --build build - name: Prepare artifact - if: ${{ inputs.deploymode == 'release' }} run: mv bin/Cemu_release bin/Cemu - name: Upload artifact uses: actions/upload-artifact@v4 - if: ${{ inputs.deploymode == 'release' }} with: name: cemu-bin-linux-x64 path: ./bin/Cemu @@ -128,19 +115,12 @@ jobs: with: submodules: "recursive" - - name: Setup release mode parameters (for deploy) - if: ${{ inputs.deploymode == 'release' }} + - name: Setup release mode parameters run: | echo "BUILD_MODE=release" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append echo "BUILD_FLAGS=" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append echo "Build mode is release" - - - name: Setup debug mode parameters (for continous build) - if: ${{ inputs.deploymode != 'release' }} - run: | - echo "BUILD_MODE=debug" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append - echo "BUILD_FLAGS=" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append - echo "Build mode is debug" + - name: Setup version for experimental if: ${{ inputs.experimentalversion != '' }} run: | @@ -184,12 +164,10 @@ jobs: cmake --build . --config ${{ env.BUILD_MODE }} - name: Prepare artifact - if: ${{ inputs.deploymode == 'release' }} run: Rename-Item bin/Cemu_release.exe Cemu.exe - name: Upload artifact uses: actions/upload-artifact@v4 - if: ${{ inputs.deploymode == 'release' }} with: name: cemu-bin-windows-x64 path: ./bin/Cemu.exe @@ -202,19 +180,12 @@ jobs: with: submodules: "recursive" - - name: Setup release mode parameters (for deploy) - if: ${{ inputs.deploymode == 'release' }} + - name: Setup release mode parameters run: | echo "BUILD_MODE=release" >> $GITHUB_ENV echo "BUILD_FLAGS=" >> $GITHUB_ENV echo "Build mode is release" - - name: Setup debug mode parameters (for continous build) - if: ${{ inputs.deploymode != 'release' }} - run: | - echo "BUILD_MODE=debug" >> $GITHUB_ENV - echo "BUILD_FLAGS=" >> $GITHUB_ENV - echo "Build mode is debug" - + - name: Setup version for experimental if: ${{ inputs.experimentalversion != '' }} run: | @@ -275,7 +246,6 @@ jobs: cmake --build build - name: Prepare artifact - if: ${{ inputs.deploymode == 'release' }} run: | mkdir bin/Cemu_app mv bin/Cemu_release.app bin/Cemu_app/Cemu.app @@ -289,7 +259,6 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v4 - if: ${{ inputs.deploymode == 'release' }} with: name: cemu-bin-macos-x64 path: ./bin/Cemu.dmg diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index 49ef79e9ff..d60e0ecf3e 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -17,5 +17,4 @@ jobs: build: uses: ./.github/workflows/build.yml with: - deploymode: release experimentalversion: 999999 diff --git a/.github/workflows/deploy_experimental_release.yml b/.github/workflows/deploy_experimental_release.yml index a8c5ec53dc..2098050ffa 100644 --- a/.github/workflows/deploy_experimental_release.yml +++ b/.github/workflows/deploy_experimental_release.yml @@ -1,20 +1,84 @@ name: Deploy experimental release on: workflow_dispatch: + inputs: + changelog0: + description: 'Enter the changelog lines for this release. Each line is a feature / bullet point. Do not use dash.' + required: true + type: string + changelog1: + description: 'Feature 2' + required: false + type: string + changelog2: + description: 'Feature 3' + required: false + type: string + changelog3: + description: 'Feature 4' + required: false + type: string + changelog4: + description: 'Feature 5' + required: false + type: string + changelog5: + description: 'Feature 6' + required: false + type: string + changelog6: + description: 'Feature 7' + required: false + type: string + changelog7: + description: 'Feature 8' + required: false + type: string + changelog8: + description: 'Feature 9' + required: false + type: string + changelog9: + description: 'Feature 10' + required: false + type: string jobs: + calculate-version: + name: Calculate Version + uses: ./.github/workflows/determine_release_version.yml call-release-build: uses: ./.github/workflows/build.yml + needs: calculate-version with: - deploymode: release experimentalversion: ${{ github.run_number }} + version_major: ${{ needs.calculate-version.outputs.next_version_major }} + version_minor: ${{ needs.calculate-version.outputs.next_version_minor }} deploy: name: Deploy experimental release runs-on: ubuntu-22.04 - needs: call-release-build + needs: [call-release-build, calculate-version] steps: - - uses: actions/checkout@v3 - + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Generate changelog + id: generate_changelog + run: | + CHANGELOG="" + if [ -n "${{ github.event.inputs.changelog0 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog0 }}\n"; fi + if [ -n "${{ github.event.inputs.changelog1 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog1 }}\n"; fi + if [ -n "${{ github.event.inputs.changelog2 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog2 }}\n"; fi + if [ -n "${{ github.event.inputs.changelog3 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog3 }}\n"; fi + if [ -n "${{ github.event.inputs.changelog4 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog4 }}\n"; fi + if [ -n "${{ github.event.inputs.changelog5 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog5 }}\n"; fi + if [ -n "${{ github.event.inputs.changelog6 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog6 }}\n"; fi + if [ -n "${{ github.event.inputs.changelog7 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog7 }}\n"; fi + if [ -n "${{ github.event.inputs.changelog8 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog8 }}\n"; fi + if [ -n "${{ github.event.inputs.changelog9 }}" ]; then CHANGELOG="$CHANGELOG- ${{ github.event.inputs.changelog9 }}\n"; fi + echo -e "$CHANGELOG" + echo "RELEASE_BODY=$CHANGELOG" >> $GITHUB_ENV - uses: actions/download-artifact@v4 with: name: cemu-bin-linux-x64 @@ -40,15 +104,13 @@ jobs: mkdir upload sudo apt install zip - - name: Get version + - name: Get version (via determine version) run: | - echo "Experimental version: ${{ github.run_number }}" - ls - gcc -o getversion .github/getversion.cpp - ./getversion - echo "Cemu CI version: $(./getversion)" - echo "CEMU_FOLDER_NAME=Cemu_$(./getversion)-${{ github.run_number }}" >> $GITHUB_ENV - echo "CEMU_VERSION=$(./getversion)-${{ github.run_number }}" >> $GITHUB_ENV + echo "Version: ${{ needs.calculate-version.outputs.next_version }}" + echo "CEMU_FOLDER_NAME=Cemu_${{ needs.calculate-version.outputs.next_version }}" + echo "CEMU_VERSION=${{ needs.calculate-version.outputs.next_version }}" + echo "CEMU_FOLDER_NAME=Cemu_${{ needs.calculate-version.outputs.next_version }}" >> $GITHUB_ENV + echo "CEMU_VERSION=${{ needs.calculate-version.outputs.next_version }}" >> $GITHUB_ENV - name: Create release from windows-bin run: | @@ -83,4 +145,11 @@ jobs: wget -O ghr.tar.gz https://github.com/tcnksm/ghr/releases/download/v0.15.0/ghr_v0.15.0_linux_amd64.tar.gz tar xvzf ghr.tar.gz; rm ghr.tar.gz echo "[INFO] Release tag: v${{ env.CEMU_VERSION }}" - ghr_v0.15.0_linux_amd64/ghr -prerelease -t ${{ secrets.GITHUB_TOKEN }} -n "Cemu ${{ env.CEMU_VERSION }} (Experimental)" -b "Cemu experimental release" "v${{ env.CEMU_VERSION }}" ./upload + CHANGELOG_UNESCAPED=$(printf "%s\n" "${{ env.RELEASE_BODY }}" | sed 's/\\n/\n/g') + RELEASE_BODY=$(printf "%s\n%s\n\n%s\n\n%s\n%s" \ + "Cemu ${{ env.CEMU_VERSION }} (Experimental)" \ + "" \ + "This is an experimental release." \ + "" \ + "$CHANGELOG_UNESCAPED") + ghr_v0.15.0_linux_amd64/ghr -draft -t ${{ secrets.GITHUB_TOKEN }} -n "Cemu ${{ env.CEMU_VERSION }}" -b "$RELEASE_BODY" "v${{ env.CEMU_VERSION }}" ./upload diff --git a/.github/workflows/determine_release_version.yml b/.github/workflows/determine_release_version.yml new file mode 100644 index 0000000000..c01c09af6c --- /dev/null +++ b/.github/workflows/determine_release_version.yml @@ -0,0 +1,70 @@ +name: Calculate Next Version from release history + +on: + workflow_dispatch: + workflow_call: + outputs: + next_version: + description: "The next semantic version" + value: ${{ jobs.calculate-version.outputs.next_version }} + next_version_major: + description: "The next semantic version (major)" + value: ${{ jobs.calculate-version.outputs.next_version_major }} + next_version_minor: + description: "The next semantic version (minor)" + value: ${{ jobs.calculate-version.outputs.next_version_minor }} + +jobs: + calculate-version: + runs-on: ubuntu-latest + outputs: + next_version: ${{ steps.calculate_next_version.outputs.next_version }} + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Get all releases + id: get_all_releases + run: | + # Fetch all releases and check for API errors + RESPONSE=$(curl -s -o response.json -w "%{http_code}" "https://api.github.com/repos/${{ github.repository }}/releases?per_page=100") + if [ "$RESPONSE" -ne 200 ]; then + echo "Failed to fetch releases. HTTP status: $RESPONSE" + cat response.json + exit 1 + fi + + # Extract and sort tags + ALL_TAGS=$(jq -r '.[].tag_name' response.json | grep -E '^v[0-9]+\.[0-9]+(-[0-9]+)?$' | sed 's/-.*//' | sort -V | tail -n 1) + + # Exit if no tags were found + if [ -z "$ALL_TAGS" ]; then + echo "No valid tags found." + exit 1 + fi + + echo "::set-output name=tag::$ALL_TAGS" + + - name: Calculate next semver minor + id: calculate_next_version + run: | + LATEST_VERSION=${{ steps.get_all_releases.outputs.tag }} + + # strip 'v' prefix and split into major.minor + LATEST_VERSION=${LATEST_VERSION//v/} + IFS='.' read -r -a VERSION_PARTS <<< "$LATEST_VERSION" + + MAJOR=${VERSION_PARTS[0]} + MINOR=${VERSION_PARTS[1]} + + # increment the minor version + MINOR=$((MINOR + 1)) + + # construct the next version as . + NEXT_VERSION="${MAJOR}.${MINOR}" + # but also set individual fields + NEXT_VERSION_MAJOR="${MAJOR}" + NEXT_VERSION_MINOR="${MINOR}" + + echo "Next version: $NEXT_VERSION" + echo "::set-output name=next_version::$NEXT_VERSION" \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 48e1863708..7cd63e9ceb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,18 +2,26 @@ cmake_minimum_required(VERSION 3.21.1) option(ENABLE_VCPKG "Enable the vcpkg package manager" ON) option(MACOS_BUNDLE "The executable when built on macOS will be created as an application bundle" OFF) -set(EXPERIMENTAL_VERSION "" CACHE STRING "") # used by CI script to set experimental version -if (EXPERIMENTAL_VERSION) - add_definitions(-DEMULATOR_VERSION_MINOR=${EXPERIMENTAL_VERSION}) - execute_process( - COMMAND git log --format=%h -1 - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - OUTPUT_VARIABLE GIT_HASH - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - add_definitions(-DEMULATOR_HASH=${GIT_HASH}) -endif() +# used by CI script to set version: +#set(EXPERIMENTAL_VERSION "" CACHE STRING "") +set(EMULATOR_VERSION_MAJOR "0" CACHE STRING "0") +set(EMULATOR_VERSION_MINOR "0" CACHE STRING "0") +set(EMULATOR_VERSION_PATCH "0" CACHE STRING "0") + +#if (EXPERIMENTAL_VERSION) +#endif() +add_definitions(-DEMULATOR_VERSION_MAJOR2=${EMULATOR_VERSION_MAJOR}) +add_definitions(-DEMULATOR_VERSION_MINOR2=${EMULATOR_VERSION_MINOR}) +add_definitions(-DEMULATOR_VERSION_PATCH2=${EMULATOR_VERSION_PATCH}) + +execute_process( + COMMAND git log --format=%h -1 + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + OUTPUT_VARIABLE GIT_HASH + OUTPUT_STRIP_TRAILING_WHITESPACE +) +add_definitions(-DEMULATOR_HASH=${GIT_HASH}) if (ENABLE_VCPKG) # check if vcpkg is shallow and unshallow it if necessary diff --git a/src/Cafe/HW/Latte/Renderer/RendererShader.cpp b/src/Cafe/HW/Latte/Renderer/RendererShader.cpp index f66dc9f4b9..98ead68d6b 100644 --- a/src/Cafe/HW/Latte/Renderer/RendererShader.cpp +++ b/src/Cafe/HW/Latte/Renderer/RendererShader.cpp @@ -12,9 +12,9 @@ uint32 RendererShader::GeneratePrecompiledCacheId() v += (uint32)(*s); s++; } - v += (EMULATOR_VERSION_LEAD * 1000000u); - v += (EMULATOR_VERSION_MAJOR * 10000u); - v += (EMULATOR_VERSION_MINOR * 100u); + v += (EMULATOR_VERSION_MAJOR2 * 1000000u); + v += (EMULATOR_VERSION_MINOR2 * 10000u); + v += (EMULATOR_VERSION_PATCH2 * 100u); // settings that can influence shaders v += (uint32)g_current_game_profile->GetAccurateShaderMul() * 133; diff --git a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp index fb54a80396..05ebe0e9bf 100644 --- a/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp +++ b/src/Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.cpp @@ -125,7 +125,7 @@ std::vector VulkanRenderer::GetDevices() VkApplicationInfo app_info{}; app_info.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; app_info.pApplicationName = EMULATOR_NAME; - app_info.applicationVersion = VK_MAKE_VERSION(EMULATOR_VERSION_LEAD, EMULATOR_VERSION_MAJOR, EMULATOR_VERSION_MINOR); + app_info.applicationVersion = VK_MAKE_VERSION(EMULATOR_VERSION_MAJOR2, EMULATOR_VERSION_MINOR2, EMULATOR_VERSION_PATCH2); app_info.pEngineName = EMULATOR_NAME; app_info.engineVersion = app_info.applicationVersion; app_info.apiVersion = apiVersion; @@ -339,7 +339,7 @@ VulkanRenderer::VulkanRenderer() VkApplicationInfo app_info{}; app_info.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO; app_info.pApplicationName = EMULATOR_NAME; - app_info.applicationVersion = VK_MAKE_VERSION(EMULATOR_VERSION_LEAD, EMULATOR_VERSION_MAJOR, EMULATOR_VERSION_MINOR); + app_info.applicationVersion = VK_MAKE_VERSION(EMULATOR_VERSION_MAJOR2, EMULATOR_VERSION_MINOR2, EMULATOR_VERSION_PATCH2); app_info.pEngineName = EMULATOR_NAME; app_info.engineVersion = app_info.applicationVersion; app_info.apiVersion = apiVersion; diff --git a/src/Common/version.h b/src/Common/version.h index 8c08f238b1..e3333572ed 100644 --- a/src/Common/version.h +++ b/src/Common/version.h @@ -1,36 +1,70 @@ #ifndef EMULATOR_NAME #define EMULATOR_NAME "Cemu" -#define EMULATOR_VERSION_LEAD 2 -#define EMULATOR_VERSION_MAJOR 0 + +// #define EMULATOR_VERSION_MAJOR2 0 +// #define EMULATOR_VERSION_MINOR2 2 +// #define EMULATOR_VERSION_PATCH2 0 + +// undefine EMULATOR_VERSION_LEAD and EMULATOR_VERSION_MAJOR if empty +// #if !defined(EMULATOR_VERSION_LEAD) || EMULATOR_VERSION_LEAD == 0 +// #undef EMULATOR_VERSION_LEAD +// #endif +// #if !defined(EMULATOR_VERSION_MAJOR) || EMULATOR_VERSION_MAJOR == 0 +// #undef EMULATOR_VERSION_MAJOR +// #endif +// +// #ifndef EMULATOR_VERSION_LEAD +// #define EMULATOR_VERSION_LEAD 2 +// #endif +// +// #ifndef EMULATOR_VERSION_MAJOR +// #define EMULATOR_VERSION_MAJOR 0 +// #endif // the minor version is used for experimental builds to indicate the build index. Set by command line option from CI build script // if zero, the version text will be constructed as LEAD.MAJOR, otherwise as LEAD.MAJOR-MINOR -#if defined(EMULATOR_VERSION_MINOR) && EMULATOR_VERSION_MINOR == 0 -#define EMULATOR_VERSION_SUFFIX "" -#else #define EMULATOR_VERSION_SUFFIX " (experimental)" -#endif -#ifndef EMULATOR_VERSION_MINOR -#define EMULATOR_VERSION_MINOR 0 -#endif +// #if defined(EMULATOR_VERSION_MINOR) && EMULATOR_VERSION_MINOR == 0 +// #define EMULATOR_VERSION_SUFFIX "" +// #else +// #endif +// +// #ifndef EMULATOR_VERSION_MINOR +// #define EMULATOR_VERSION_MINOR 0 +// #endif #define _XSTRINGFY(s) _STRINGFY(s) #define _STRINGFY(s) #s -#if EMULATOR_VERSION_MINOR != 0 -#if defined(EMULATOR_HASH) && EMULATOR_VERSION_MINOR == 999999 -#define BUILD_VERSION_WITH_NAME_STRING (EMULATOR_NAME " " _XSTRINGFY(EMULATOR_VERSION_LEAD) "." _XSTRINGFY(EMULATOR_VERSION_MAJOR) "-" _XSTRINGFY(EMULATOR_HASH) EMULATOR_VERSION_SUFFIX) -#define BUILD_VERSION_STRING (_XSTRINGFY(EMULATOR_VERSION_LEAD) "." _XSTRINGFY(EMULATOR_VERSION_MAJOR) "-" _XSTRINGFY(EMULATOR_HASH) EMULATOR_VERSION_SUFFIX) -#else -#define BUILD_VERSION_WITH_NAME_STRING (EMULATOR_NAME " " _XSTRINGFY(EMULATOR_VERSION_LEAD) "." _XSTRINGFY(EMULATOR_VERSION_MAJOR) "-" _XSTRINGFY(EMULATOR_VERSION_MINOR) EMULATOR_VERSION_SUFFIX) -#define BUILD_VERSION_STRING (_XSTRINGFY(EMULATOR_VERSION_LEAD) "." _XSTRINGFY(EMULATOR_VERSION_MAJOR) "-" _XSTRINGFY(EMULATOR_VERSION_MINOR) EMULATOR_VERSION_SUFFIX) -#endif +// #if EMULATOR_VERSION_PATCH2 != 0 +// #if defined(EMULATOR_HASH) && EMULATOR_VERSION_MINOR == 999999 +// #define BUILD_VERSION_WITH_NAME_STRING (EMULATOR_NAME " " _XSTRINGFY(EMULATOR_VERSION_MAJOR2) "." _XSTRINGFY(EMULATOR_VERSION_MINOR2) "-" _XSTRINGFY(EMULATOR_HASH) EMULATOR_VERSION_SUFFIX) +// #define BUILD_VERSION_STRING (_XSTRINGFY(EMULATOR_VERSION_LEAD) "." _XSTRINGFY(EMULATOR_VERSION_MINOR2) "-" _XSTRINGFY(EMULATOR_HASH) EMULATOR_VERSION_SUFFIX) +// #else +// #define BUILD_VERSION_WITH_NAME_STRING (EMULATOR_NAME " " _XSTRINGFY(EMULATOR_VERSION_MAJOR2) "." _XSTRINGFY(EMULATOR_VERSION_MINOR2) "-" _XSTRINGFY(EMULATOR_VERSION_PATCH2) EMULATOR_VERSION_SUFFIX) +// #define BUILD_VERSION_STRING (_XSTRINGFY(EMULATOR_VERSION_MAJOR2) "." _XSTRINGFY(EMULATOR_VERSION_MINOR2) "-" _XSTRINGFY(EMULATOR_VERSION_PATCH2) EMULATOR_VERSION_SUFFIX) +// #endif +// #else +// #define BUILD_VERSION_STRING (_XSTRINGFY(EMULATOR_VERSION_LEAD) "." _XSTRINGFY(EMULATOR_VERSION_MINOR2) EMULATOR_VERSION_SUFFIX) +// #define BUILD_VERSION_WITH_NAME_STRING (EMULATOR_NAME " " _XSTRINGFY(EMULATOR_VERSION_MAJOR2) "." _XSTRINGFY(EMULATOR_VERSION_MINOR2) EMULATOR_VERSION_SUFFIX) +// #endif + +#if EMULATOR_VERSION_MAJOR2 != 0 +// no version provided. Only show commit hash +#define BUILD_VERSION_WITH_NAME_STRING (EMULATOR_NAME " " _XSTRINGFY(EMULATOR_VERSION_MAJOR2) "." _XSTRINGFY(EMULATOR_VERSION_MINOR2) "-" _XSTRINGFY(EMULATOR_HASH) EMULATOR_VERSION_SUFFIX) +#define BUILD_VERSION_STRING (_XSTRINGFY(EMULATOR_VERSION_LEAD) "." _XSTRINGFY(EMULATOR_VERSION_MINOR2) "-" _XSTRINGFY(EMULATOR_HASH) EMULATOR_VERSION_SUFFIX) #else -#define BUILD_VERSION_STRING (_XSTRINGFY(EMULATOR_VERSION_LEAD) "." _XSTRINGFY(EMULATOR_VERSION_MAJOR) EMULATOR_VERSION_SUFFIX) -#define BUILD_VERSION_WITH_NAME_STRING (EMULATOR_NAME " " _XSTRINGFY(EMULATOR_VERSION_LEAD) "." _XSTRINGFY(EMULATOR_VERSION_MAJOR) EMULATOR_VERSION_SUFFIX) +// #define BUILD_VERSION_STRING (_XSTRINGFY(EMULATOR_VERSION_LEAD) "." _XSTRINGFY(EMULATOR_VERSION_MINOR2) EMULATOR_VERSION_SUFFIX) +// #define BUILD_VERSION_WITH_NAME_STRING (EMULATOR_NAME " " _XSTRINGFY(EMULATOR_VERSION_MAJOR2) "." _XSTRINGFY(EMULATOR_VERSION_MINOR2) EMULATOR_VERSION_SUFFIX) + +#define BUILD_VERSION_STRING (_XSTRINGFY(EMULATOR_HASH) EMULATOR_VERSION_SUFFIX) +#define BUILD_VERSION_WITH_NAME_STRING (EMULATOR_NAME " " _XSTRINGFY(EMULATOR_HASH) EMULATOR_VERSION_SUFFIX) + #endif + + #endif diff --git a/src/config/LaunchSettings.cpp b/src/config/LaunchSettings.cpp index 1731f50047..45f800366f 100644 --- a/src/config/LaunchSettings.cpp +++ b/src/config/LaunchSettings.cpp @@ -112,10 +112,10 @@ bool LaunchSettings::HandleCommandline(const std::vector& args) { requireConsole(); std::string versionStr; -#if EMULATOR_VERSION_MINOR == 0 - versionStr = fmt::format("{}.{}{}", EMULATOR_VERSION_LEAD, EMULATOR_VERSION_MAJOR, EMULATOR_VERSION_SUFFIX); +#if EMULATOR_VERSION_PATCH2 == 0 + versionStr = fmt::format("{}.{}{}", EMULATOR_VERSION_MAJOR2, EMULATOR_VERSION_MINOR2, EMULATOR_VERSION_SUFFIX); #else - versionStr = fmt::format("{}.{}-{}{}", EMULATOR_VERSION_LEAD, EMULATOR_VERSION_MAJOR, EMULATOR_VERSION_MINOR, EMULATOR_VERSION_SUFFIX); + versionStr = fmt::format("{}.{}-{}{}", EMULATOR_VERSION_MAJOR2, EMULATOR_VERSION_MINOR2, EMULATOR_VERSION_PATCH2, EMULATOR_VERSION_SUFFIX); #endif std::cout << versionStr << std::endl; return false; // exit in main diff --git a/src/gui/DownloadGraphicPacksWindow.cpp b/src/gui/DownloadGraphicPacksWindow.cpp index 03f102d238..5dbc87d7ad 100644 --- a/src/gui/DownloadGraphicPacksWindow.cpp +++ b/src/gui/DownloadGraphicPacksWindow.cpp @@ -115,7 +115,7 @@ void DownloadGraphicPacksWindow::UpdateThread() curlDownloadFileState_t tempDownloadState; std::string queryUrl("https://cemu.info/api2/query_graphicpack_url.php?"); char temp[64]; - sprintf(temp, "version=%d.%d.%d", EMULATOR_VERSION_LEAD, EMULATOR_VERSION_MAJOR, EMULATOR_VERSION_MINOR); + sprintf(temp, "version=%d.%d.%d", EMULATOR_VERSION_MAJOR2, EMULATOR_VERSION_MINOR2, EMULATOR_VERSION_PATCH2); queryUrl.append(temp); queryUrl.append("&"); sprintf(temp, "t=%u", (uint32)std::chrono::seconds(std::time(NULL)).count()); // add a dynamic part to the url to bypass overly aggressive caching (like some proxies do) diff --git a/src/gui/GeneralSettings2.cpp b/src/gui/GeneralSettings2.cpp index 08395cd313..a5c18fabd9 100644 --- a/src/gui/GeneralSettings2.cpp +++ b/src/gui/GeneralSettings2.cpp @@ -162,19 +162,25 @@ wxPanel* GeneralSettings2::AddGeneralPage(wxNotebook* notebook) m_fullscreen_menubar->SetToolTip(_("Displays the menu bar when Cemu is running in fullscreen mode and the mouse cursor is moved to the top")); second_row->Add(m_fullscreen_menubar, 0, botflag, 5); + m_auto_update = new wxCheckBox(box, wxID_ANY, _("Automatically check for updates")); m_auto_update->SetToolTip(_("Automatically checks for new cemu versions on startup")); second_row->Add(m_auto_update, 0, botflag, 5); + + second_row->AddSpacer(10); + m_cutting_edge_updates = new wxCheckBox(box, wxID_ANY, _("Update to cutting-edge")); + m_cutting_edge_updates->SetToolTip(_("Update to new and untested releases")); + second_row->Add(m_cutting_edge_updates, 0, botflag, 5); #if BOOST_OS_LINUX if (!std::getenv("APPIMAGE")) { m_auto_update->Disable(); } #endif - second_row->AddSpacer(10); m_save_screenshot = new wxCheckBox(box, wxID_ANY, _("Save screenshot")); m_save_screenshot->SetToolTip(_("Pressing the screenshot key (F12) will save a screenshot directly to the screenshots folder")); second_row->Add(m_save_screenshot, 0, botflag, 5); + second_row->AddSpacer(10); m_disable_screensaver = new wxCheckBox(box, wxID_ANY, _("Disable screen saver")); m_disable_screensaver->SetToolTip(_("Prevents the system from activating the screen saver or going to sleep while running a game.")); second_row->Add(m_disable_screensaver, 0, botflag, 5); diff --git a/src/gui/GeneralSettings2.h b/src/gui/GeneralSettings2.h index a3429fa1c8..57717c8724 100644 --- a/src/gui/GeneralSettings2.h +++ b/src/gui/GeneralSettings2.h @@ -41,7 +41,7 @@ class GeneralSettings2 : public wxDialog wxCheckBox* m_save_window_position_size; wxCheckBox* m_save_padwindow_position_size; wxCheckBox* m_discord_presence, *m_fullscreen_menubar; - wxCheckBox* m_auto_update, *m_save_screenshot; + wxCheckBox* m_auto_update, *m_cutting_edge_updates, *m_save_screenshot; wxCheckBox* m_disable_screensaver; #if BOOST_OS_LINUX && defined(ENABLE_FERAL_GAMEMODE) wxCheckBox* m_feral_gamemode; diff --git a/src/resource/cemu.rc b/src/resource/cemu.rc index 860ca8fbb3..1f294daf83 100644 --- a/src/resource/cemu.rc +++ b/src/resource/cemu.rc @@ -73,8 +73,8 @@ END #define str(s) #s VS_VERSION_INFO VERSIONINFO -FILEVERSION EMULATOR_VERSION_LEAD, EMULATOR_VERSION_MAJOR, EMULATOR_VERSION_MINOR, 0 -PRODUCTVERSION EMULATOR_VERSION_LEAD, EMULATOR_VERSION_MAJOR, EMULATOR_VERSION_MINOR, 0 +FILEVERSION EMULATOR_VERSION_MAJOR2, EMULATOR_VERSION_MINOR2, EMULATOR_VERSION_PATCH2, 0 +PRODUCTVERSION EMULATOR_VERSION_MAJOR2, EMULATOR_VERSION_MINOR2, EMULATOR_VERSION_PATCH2, 0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -94,7 +94,7 @@ BEGIN VALUE "LegalCopyright", "Team Cemu" VALUE "OriginalFilename", "Cemu.exe" VALUE "ProductName", "Cemu" - VALUE "ProductVersion", xstr(EMULATOR_VERSION_LEAD) "." xstr(EMULATOR_VERSION_MAJOR) "." xstr(EMULATOR_VERSION_MINOR) EMULATOR_VERSION_SUFFIX "\0" + VALUE "ProductVersion", xstr(EMULATOR_VERSION_MAJOR2) "." xstr(EMULATOR_VERSION_MINOR2) "." xstr(EMULATOR_VERSION_PATCH2) EMULATOR_VERSION_SUFFIX "\0" END END BLOCK "VarFileInfo"