Compare commits
16 Commits
43f6759d42
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
c7ae6490cc | ||
|
5041cfa6fa | ||
|
2353d57dd3 | ||
|
8e805522d5 | ||
|
5978a14224 | ||
|
e27276bf65 | ||
|
2f230d7ea7 | ||
|
7a030d50b2 | ||
|
69481869d3 | ||
|
0c9fb6b322 | ||
|
6e029a13a8 | ||
|
97e3e8451e | ||
|
d63ae90332 | ||
|
8fb6f40709 | ||
|
bc039d19cb | ||
|
2482b7dd09 |
116
.github/workflows/cd.yml
vendored
116
.github/workflows/cd.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
|||||||
linux-ubuntu:
|
linux-ubuntu:
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -47,14 +47,14 @@ jobs:
|
|||||||
- name: Compress artifacts
|
- name: Compress artifacts
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
tar -czvf ${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-${{ runner.os }}-ubuntu22.04-x86_64.tar.gz -C ${{github.workspace}}/build/bin/ .
|
tar -czvf ${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-${{ runner.os }}-ubuntu24.04-x86_64.tar.gz -C ${{github.workspace}}/build/bin/ .
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-${{ runner.os }}-ubuntu22.04-x86_64
|
name: ${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-${{ runner.os }}-ubuntu24.04-x86_64
|
||||||
# TODO: do propper packing
|
# TODO: do propper packing
|
||||||
path: |
|
path: |
|
||||||
${{github.workspace}}/${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-${{ runner.os }}-ubuntu22.04-x86_64.tar.gz
|
${{github.workspace}}/${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-${{ runner.os }}-ubuntu24.04-x86_64.tar.gz
|
||||||
|
|
||||||
android:
|
android:
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
@@ -165,7 +165,12 @@ jobs:
|
|||||||
windows:
|
windows:
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
|
|
||||||
runs-on: windows-2022
|
runs-on: ${{matrix.os}}
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
type: ['', 'asan']
|
||||||
|
os: ['windows-2022']
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
# vcpkg caching action
|
# vcpkg caching action
|
||||||
@@ -199,7 +204,8 @@ jobs:
|
|||||||
#- uses: ilammy/setup-nasm@v1
|
#- uses: ilammy/setup-nasm@v1
|
||||||
|
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DTOMATO_DEP_LIBWEBP_USE_SYSTEM=ON -DSDLIMAGE_VENDORED=OFF -DSDLIMAGE_DEPS_SHARED=OFF -DSDLIMAGE_JXL=OFF -DSDLIMAGE_AVIF=OFF -DPKG_CONFIG_EXECUTABLE=C:/vcpkg/installed/x64-windows/tools/pkgconf/pkgconf.exe -DTOMATO_BREAKPAD=ON -DTOMATO_TOX_AV=ON
|
# TODO: og asan had this -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
|
||||||
|
run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DTOMATO_DEP_LIBWEBP_USE_SYSTEM=ON -DSDLIMAGE_VENDORED=OFF -DSDLIMAGE_DEPS_SHARED=OFF -DSDLIMAGE_JXL=OFF -DSDLIMAGE_AVIF=OFF -DPKG_CONFIG_EXECUTABLE=C:/vcpkg/installed/x64-windows/tools/pkgconf/pkgconf.exe -DTOMATO_BREAKPAD=ON -DTOMATO_TOX_AV=ON -DTOMATO_ASAN=${{matrix.type == 'asan' && 'ON' || 'OFF'}}
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -t tomato
|
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -t tomato
|
||||||
@@ -223,92 +229,28 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
Remove-Item "${{github.workspace}}/build/bin/*.ilk"
|
Remove-Item "${{github.workspace}}/build/bin/*.ilk"
|
||||||
|
|
||||||
- name: Compress artifacts
|
- name: Add asan runtime deps
|
||||||
|
if: ${{matrix.type == 'asan'}}
|
||||||
|
# msvc redist does not ship them
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
Compress-Archive -Path ${{github.workspace}}/build/bin/* -Destination ${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-${{ runner.os }}-msvc-x86_64.zip
|
Copy-Item "$env:VCToolsInstallDir/bin/Hostx64/x64/clang_rt.asan_dynamic-x86_64.dll" -Destination "${{github.workspace}}/build/bin/"
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{github.event.repository.name}}-${{steps.tag.outputs.name}}-${{runner.os}}-msvc-x86_64
|
|
||||||
# TODO: do propper packing
|
|
||||||
path: |
|
|
||||||
${{github.workspace}}/${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-${{ runner.os }}-msvc-x86_64.zip
|
|
||||||
|
|
||||||
|
|
||||||
windows-asan:
|
|
||||||
timeout-minutes: 15
|
|
||||||
|
|
||||||
runs-on: windows-2022
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
# vcpkg caching action
|
|
||||||
actions: read
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Restore vcpkg cache
|
|
||||||
id: vcpkg-cache
|
|
||||||
uses: TAServers/vcpkg-cache@v3
|
|
||||||
with:
|
|
||||||
token: ${{secrets.GITHUB_TOKEN}}
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
|
||||||
env:
|
|
||||||
VCPKG_FEATURE_FLAGS: "binarycaching"
|
|
||||||
VCPKG_BINARY_SOURCES: "clear;files,${{steps.vcpkg-cache.outputs.path}},readwrite"
|
|
||||||
run: vcpkg install pkgconf:x64-windows libsodium:x64-windows-static pthreads:x64-windows-static opus:x64-windows-static libvpx:x64-windows-static zstd:x64-windows-static libwebp:x64-windows-static libpng:x64-windows-static libjpeg-turbo:x64-windows-static freetype:x64-windows-static
|
|
||||||
|
|
||||||
|
|
||||||
# setup vs env
|
|
||||||
- uses: ilammy/msvc-dev-cmd@v1
|
|
||||||
with:
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
## sdl_image vendored needs nasm for dav1d
|
|
||||||
#- uses: ilammy/setup-nasm@v1
|
|
||||||
|
|
||||||
- name: Configure CMake
|
|
||||||
run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DTOMATO_ASAN=ON -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DTOMATO_DEP_LIBWEBP_USE_SYSTEM=ON -DSDLIMAGE_VENDORED=OFF -DSDLIMAGE_DEPS_SHARED=OFF -DSDLIMAGE_JXL=OFF -DSDLIMAGE_AVIF=OFF -DPKG_CONFIG_EXECUTABLE=C:/vcpkg/installed/x64-windows/tools/pkgconf/pkgconf.exe -DTOMATO_TOX_AV=ON
|
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4 -t tomato
|
|
||||||
|
|
||||||
- name: Determine tag name
|
|
||||||
id: tag
|
|
||||||
shell: bash
|
|
||||||
# taken from llama.cpp
|
|
||||||
run: |
|
|
||||||
SHORT_HASH="$(git rev-parse --short=7 HEAD)"
|
|
||||||
if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
|
|
||||||
echo "name=dev-${SHORT_HASH}" >> $GITHUB_OUTPUT
|
|
||||||
else
|
|
||||||
SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
|
|
||||||
echo "name=dev-${SAFE_NAME}-${SHORT_HASH}" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Clean temporary artifacts
|
|
||||||
# msvc sometimes produces .ilk files, which are used for linking only
|
|
||||||
shell: powershell
|
|
||||||
run: |
|
|
||||||
Remove-Item "${{github.workspace}}/build/bin/*.ilk"
|
|
||||||
|
|
||||||
- name: Compress artifacts
|
- name: Compress artifacts
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
Compress-Archive -Path ${{github.workspace}}/build/bin/* -Destination ${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-${{ runner.os }}-msvc-asan-x86_64.zip
|
Compress-Archive -Path ${{github.workspace}}/build/bin/* -Destination ${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-${{ runner.os }}-msvc${{matrix.type == 'asan' && '-asan' || ''}}-x86_64.zip
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-${{ runner.os }}-msvc-asan-x86_64
|
name: ${{github.event.repository.name}}-${{steps.tag.outputs.name}}-${{runner.os}}-msvc${{matrix.type == 'asan' && '-asan' || ''}}-x86_64
|
||||||
# TODO: do propper packing
|
# TODO: do propper packing
|
||||||
path: |
|
path: |
|
||||||
${{github.workspace}}/${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-${{ runner.os }}-msvc-asan-x86_64.zip
|
${{github.workspace}}/${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-${{ runner.os }}-msvc${{matrix.type == 'asan' && '-asan' || ''}}-x86_64.zip
|
||||||
|
|
||||||
|
# - name: Configure CMake
|
||||||
|
# run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DTOMATO_ASAN=ON -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DTOMATO_DEP_LIBWEBP_USE_SYSTEM=ON -DSDLIMAGE_VENDORED=OFF -DSDLIMAGE_DEPS_SHARED=OFF -DSDLIMAGE_JXL=OFF -DSDLIMAGE_AVIF=OFF -DPKG_CONFIG_EXECUTABLE=C:/vcpkg/installed/x64-windows/tools/pkgconf/pkgconf.exe -DTOMATO_TOX_AV=ON
|
||||||
|
|
||||||
|
|
||||||
dumpsyms:
|
dumpsyms:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -317,7 +259,7 @@ jobs:
|
|||||||
- linux-ubuntu
|
- linux-ubuntu
|
||||||
- android
|
- android
|
||||||
- windows
|
- windows
|
||||||
- windows-asan
|
#- windows-asan
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@@ -358,8 +300,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir ./artifacts/extract
|
mkdir ./artifacts/extract
|
||||||
|
|
||||||
echo $(unar -D -o ./artifacts/extract/ ./artifacts/${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-Linux-ubuntu22.04-x86_64/*)
|
echo $(unar -D -o ./artifacts/extract/ ./artifacts/${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-Linux-ubuntu24.04-x86_64/*)
|
||||||
dump_syms -s tomato-dev-ubuntu22.04-x86_64-sym ./artifacts/extract/tomato
|
dump_syms -s tomato-dev-ubuntu24.04-x86_64-sym ./artifacts/extract/tomato
|
||||||
rm -rf ./artifacts/extract/*
|
rm -rf ./artifacts/extract/*
|
||||||
|
|
||||||
echo $(unar -D -o ./artifacts/extract/ ./artifacts/${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-Windows-msvc-x86_64/*)
|
echo $(unar -D -o ./artifacts/extract/ ./artifacts/${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-Windows-msvc-x86_64/*)
|
||||||
@@ -369,14 +311,14 @@ jobs:
|
|||||||
- name: Compress symbol stores
|
- name: Compress symbol stores
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
tar -czvf ${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-Linux-ubuntu22.04-x86_64-symbol_store.tar.gz -C ./tomato-dev-ubuntu22.04-x86_64-sym .
|
tar -czvf ${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-Linux-ubuntu24.04-x86_64-symbol_store.tar.gz -C ./tomato-dev-ubuntu24.04-x86_64-sym .
|
||||||
tar -czvf ${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-Windows-msvc-x86_64-symbol_store.tar.gz -C ./tomato-dev-Windows-msvc-x86_64-sym .
|
tar -czvf ${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-Windows-msvc-x86_64-symbol_store.tar.gz -C ./tomato-dev-Windows-msvc-x86_64-sym .
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-symbol_stores
|
name: ${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-symbol_stores
|
||||||
path: |
|
path: |
|
||||||
${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-Linux-ubuntu22.04-x86_64-symbol_store.tar.gz
|
${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-Linux-ubuntu24.04-x86_64-symbol_store.tar.gz
|
||||||
${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-Windows-msvc-x86_64-symbol_store.tar.gz
|
${{ github.event.repository.name }}-${{ steps.tag.outputs.name }}-Windows-msvc-x86_64-symbol_store.tar.gz
|
||||||
|
|
||||||
release:
|
release:
|
||||||
@@ -388,7 +330,7 @@ jobs:
|
|||||||
- linux-ubuntu
|
- linux-ubuntu
|
||||||
- android
|
- android
|
||||||
- windows
|
- windows
|
||||||
- windows-asan
|
#- windows-asan
|
||||||
- dumpsyms
|
- dumpsyms
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
|
47
.github/workflows/ci.yml
vendored
47
.github/workflows/ci.yml
vendored
@@ -7,13 +7,21 @@ on:
|
|||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
# maybe pull into matrix?
|
||||||
BUILD_TYPE: Debug
|
BUILD_TYPE: Debug
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
linux:
|
linux:
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{matrix.os}}
|
||||||
|
name: ${{matrix.type}} on ${{matrix.os}}
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
type: ['', 'asan']
|
||||||
|
os: ['ubuntu-latest', 'ubuntu-24.04-arm']
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -26,34 +34,10 @@ jobs:
|
|||||||
- name: ccache
|
- name: ccache
|
||||||
uses: hendrikmuhs/ccache-action@v1.2
|
uses: hendrikmuhs/ccache-action@v1.2
|
||||||
with:
|
with:
|
||||||
key: ${{github.event.repository.name}}-${{github.job}}
|
key: ${{github.event.repository.name}}-${{github.job}}-${{matrix.os}}-${{matrix.type}}
|
||||||
|
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DTOMATO_ASAN=${{matrix.type == 'asan' && 'ON' || 'OFF'}}
|
||||||
|
|
||||||
- name: Build
|
|
||||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4 -t tomato
|
|
||||||
|
|
||||||
linux-arm:
|
|
||||||
timeout-minutes: 10
|
|
||||||
|
|
||||||
runs-on: ubuntu-24.04-arm
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
|
|
||||||
- name: Install Dependencies
|
|
||||||
run: sudo apt update && sudo apt -y install libsodium-dev cmake libx11-dev libxext-dev libxrandr-dev
|
|
||||||
|
|
||||||
- name: ccache
|
|
||||||
uses: hendrikmuhs/ccache-action@v1.2
|
|
||||||
with:
|
|
||||||
key: ${{github.event.repository.name}}-${{github.job}}
|
|
||||||
|
|
||||||
- name: Configure CMake
|
|
||||||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4 -t tomato
|
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j 4 -t tomato
|
||||||
@@ -194,15 +178,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
arch: amd64
|
arch: amd64
|
||||||
|
|
||||||
## sdl_image vendored needs nasm for dav1d
|
|
||||||
#- uses: ilammy/setup-nasm@v1
|
|
||||||
|
|
||||||
#- name: ccache
|
|
||||||
# uses: hendrikmuhs/ccache-action@v1.2
|
|
||||||
# with:
|
|
||||||
# variant: sccache
|
|
||||||
# key: ${{github.event.repository.name}}-${{github.job}}
|
|
||||||
|
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DTOMATO_DEP_LIBWEBP_USE_SYSTEM=ON -DSDLIMAGE_VENDORED=OFF -DSDLIMAGE_DEPS_SHARED=OFF -DSDLIMAGE_JXL=OFF -DSDLIMAGE_AVIF=OFF -DPKG_CONFIG_EXECUTABLE=C:/vcpkg/installed/x64-windows/tools/pkgconf/pkgconf.exe
|
run: cmake -G Ninja -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DTOMATO_DEP_LIBWEBP_USE_SYSTEM=ON -DSDLIMAGE_VENDORED=OFF -DSDLIMAGE_DEPS_SHARED=OFF -DSDLIMAGE_JXL=OFF -DSDLIMAGE_AVIF=OFF -DPKG_CONFIG_EXECUTABLE=C:/vcpkg/installed/x64-windows/tools/pkgconf/pkgconf.exe
|
||||||
|
|
||||||
|
1
external/implot/CMakeLists.txt
vendored
1
external/implot/CMakeLists.txt
vendored
@@ -9,7 +9,6 @@ if (NOT TARGET implot)
|
|||||||
#GIT_TAG 193b9d8f92c4a437e84182b171f1ae266e72321f # 05-03-2025
|
#GIT_TAG 193b9d8f92c4a437e84182b171f1ae266e72321f # 05-03-2025
|
||||||
GIT_TAG 3da8bd34299965d3b0ab124df743fe3e076fa222 # 19-03-2025
|
GIT_TAG 3da8bd34299965d3b0ab124df743fe3e076fa222 # 19-03-2025
|
||||||
EXCLUDE_FROM_ALL
|
EXCLUDE_FROM_ALL
|
||||||
CONFIGURE_COMMAND "" # no cmake
|
|
||||||
)
|
)
|
||||||
|
|
||||||
FetchContent_GetProperties(implot)
|
FetchContent_GetProperties(implot)
|
||||||
|
2
external/solanaceae_contact
vendored
2
external/solanaceae_contact
vendored
Submodule external/solanaceae_contact updated: 5adf5bf9da...fdbe643958
2
external/solanaceae_tox
vendored
2
external/solanaceae_tox
vendored
Submodule external/solanaceae_tox updated: 91ae0671b0...83367b2d2e
8
flake.lock
generated
8
flake.lock
generated
@@ -54,16 +54,16 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751290243,
|
"lastModified": 1754292888,
|
||||||
"narHash": "sha256-kNf+obkpJZWar7HZymXZbW+Rlk3HTEIMlpc6FCNz0Ds=",
|
"narHash": "sha256-1ziydHSiDuSnaiPzCQh1mRFBsM2d2yRX9I+5OPGEmIE=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "5ab036a8d97cb9476fbe81b09076e6e91d15e1b6",
|
"rev": "ce01daebf8489ba97bd1609d185ea276efdeb121",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "release-24.11",
|
"ref": "release-25.05",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
# $ nix bundle --bundler github:ralismark/nix-appimage 'git+file:///home/green/workspace/tox/tomato?submodules=1#'
|
# $ nix bundle --bundler github:ralismark/nix-appimage 'git+file:///home/green/workspace/tox/tomato?submodules=1#'
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/release-24.11";
|
nixpkgs.url = "github:NixOS/nixpkgs/release-25.05";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
nlohmann-json = {
|
nlohmann-json = {
|
||||||
url = "github:nlohmann/json/v3.11.3"; # TODO: read version from file
|
url = "github:nlohmann/json/v3.11.3"; # TODO: read version from file
|
||||||
|
@@ -82,6 +82,8 @@ target_sources(tomato PUBLIC
|
|||||||
./sys_tray.cpp
|
./sys_tray.cpp
|
||||||
|
|
||||||
./string_formatter_utils.hpp
|
./string_formatter_utils.hpp
|
||||||
|
./chat_gui/about.hpp
|
||||||
|
./chat_gui/about.cpp
|
||||||
./chat_gui/theme.hpp
|
./chat_gui/theme.hpp
|
||||||
./chat_gui/theme.cpp
|
./chat_gui/theme.cpp
|
||||||
./chat_gui/icons/direct.hpp
|
./chat_gui/icons/direct.hpp
|
||||||
|
54
src/chat_gui/about.cpp
Normal file
54
src/chat_gui/about.cpp
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
#include "./about.hpp"
|
||||||
|
|
||||||
|
#include "./version.hpp"
|
||||||
|
|
||||||
|
#include <imgui.h>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
void ImGuiTomatoAbout(void) {
|
||||||
|
if (ImGui::BeginTabBar("about")) {
|
||||||
|
if (ImGui::BeginTabItem("tomato")) {
|
||||||
|
std::string tomato_version_string {"tomato " TOMATO_VERSION_STR};
|
||||||
|
if (TOMATO_GIT_DEPTH != 0) {
|
||||||
|
tomato_version_string += "-" + std::to_string(TOMATO_GIT_DEPTH);
|
||||||
|
}
|
||||||
|
if (std::string_view{TOMATO_GIT_COMMIT} != "UNK") {
|
||||||
|
tomato_version_string += "+git.";
|
||||||
|
tomato_version_string += TOMATO_GIT_COMMIT;
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::TextUnformatted(tomato_version_string.c_str());
|
||||||
|
|
||||||
|
ImGui::SameLine();
|
||||||
|
if (ImGui::SmallButton("click to copy")) {
|
||||||
|
ImGui::SetClipboardText(tomato_version_string.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::Separator();
|
||||||
|
|
||||||
|
ImGui::TextUnformatted("TODO: tomato license");
|
||||||
|
|
||||||
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ImGui::BeginTabItem("imgui")) {
|
||||||
|
ImGui::ShowAboutWindow();
|
||||||
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ImGui::BeginTabItem("others")) {
|
||||||
|
ImGui::TextUnformatted("TODO: list all the other libs and their licenses");
|
||||||
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ImGui::BeginTabItem("funding")) {
|
||||||
|
ImGui::TextWrapped("Your Help is needed, to keep the project alive, expand it's features and to inspire new features!");
|
||||||
|
ImGui::TextLinkOpenURL("https://github.com/sponsors/Green-Sky");
|
||||||
|
ImGui::TextUnformatted("Contact Me for more ways to help the project. :)");
|
||||||
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::EndTabBar();
|
||||||
|
}
|
||||||
|
}
|
5
src/chat_gui/about.hpp
Normal file
5
src/chat_gui/about.hpp
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
// not a window, just the content
|
||||||
|
void ImGuiTomatoAbout(void);
|
||||||
|
|
@@ -1,6 +1,7 @@
|
|||||||
#include "./contact_list.hpp"
|
#include "./contact_list.hpp"
|
||||||
|
|
||||||
#include <solanaceae/contact/components.hpp>
|
#include <solanaceae/contact/components.hpp>
|
||||||
|
#include <solanaceae/contact/contact_model4.hpp>
|
||||||
#include <solanaceae/message3/components.hpp>
|
#include <solanaceae/message3/components.hpp>
|
||||||
#include <solanaceae/util/utils.hpp>
|
#include <solanaceae/util/utils.hpp>
|
||||||
#include <solanaceae/util/time.hpp>
|
#include <solanaceae/util/time.hpp>
|
||||||
@@ -325,6 +326,7 @@ bool renderContactList(
|
|||||||
) {
|
) {
|
||||||
bool selection_changed {false};
|
bool selection_changed {false};
|
||||||
for (const Contact4 cv : view) {
|
for (const Contact4 cv : view) {
|
||||||
|
ImGui::PushID(entt::to_integral(cv));
|
||||||
ContactHandle4 c{cr, cv};
|
ContactHandle4 c{cr, cv};
|
||||||
const bool selected = selected_c == c;
|
const bool selected = selected_c == c;
|
||||||
|
|
||||||
@@ -342,6 +344,36 @@ bool renderContactList(
|
|||||||
selected_c = c;
|
selected_c = c;
|
||||||
selection_changed = true;
|
selection_changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: move to own function
|
||||||
|
if (ImGui::BeginPopupContextItem("contact_context")) {
|
||||||
|
if (c.all_of<Contact::Components::ContactModel>()) {
|
||||||
|
const auto& cm = c.get<Contact::Components::ContactModel>();
|
||||||
|
// TODO: make hookable
|
||||||
|
if (ImGui::BeginMenu("invite to")) {
|
||||||
|
// big?
|
||||||
|
//for (const auto& c : cr.view<Contact::Components::TagBig>()) {
|
||||||
|
// // filter
|
||||||
|
// if (cr.any_of<Contact::Components::RequestIncoming, Contact::Components::TagRequestOutgoing>(c)) {
|
||||||
|
// continue;
|
||||||
|
// }
|
||||||
|
for (auto [tov] : cr.storage<Contact4>().each()) {
|
||||||
|
if (cm->canInvite(c, tov)) {
|
||||||
|
ContactHandle4 to{cr, tov};
|
||||||
|
|
||||||
|
if (renderContactBig(th, contact_tc, to, 1, false, true, false)) {
|
||||||
|
// TODO: error check
|
||||||
|
cm->invite(c, tov);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui::EndMenu();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::EndPopup();
|
||||||
|
}
|
||||||
|
ImGui::PopID();
|
||||||
}
|
}
|
||||||
return selection_changed;
|
return selection_changed;
|
||||||
}
|
}
|
||||||
|
@@ -478,6 +478,8 @@ float ChatGui4::render(float time_delta, bool window_hidden, bool window_focused
|
|||||||
ImGui::EndChild();
|
ImGui::EndChild();
|
||||||
|
|
||||||
if (ImGui::BeginChild("text_input", {-150, 0})) {
|
if (ImGui::BeginChild("text_input", {-150, 0})) {
|
||||||
|
ImGui::SetNextItemShortcut(ImGuiKey_I, ImGuiInputFlags_RouteGlobal);
|
||||||
|
|
||||||
constexpr ImGuiInputTextFlags input_flags =
|
constexpr ImGuiInputTextFlags input_flags =
|
||||||
//ImGuiInputTextFlags_AllowTabInput |
|
//ImGuiInputTextFlags_AllowTabInput |
|
||||||
ImGuiInputTextFlags_NoHorizontalScroll |
|
ImGuiInputTextFlags_NoHorizontalScroll |
|
||||||
@@ -670,6 +672,28 @@ void ChatGui4::sendFilePath(std::string_view file_path) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ChatGui4::renderChatLog(Contact4 c, bool window_focused, const std::vector<Contact4>* sub_contacts) {
|
void ChatGui4::renderChatLog(Contact4 c, bool window_focused, const std::vector<Contact4>* sub_contacts) {
|
||||||
|
const float scroll_amount {2.f * TEXT_BASE_HEIGHT};
|
||||||
|
bool manually_scrolled {false};
|
||||||
|
// TODO: replace with IsKeyPressed version in the future
|
||||||
|
if (ImGui::Shortcut(ImGuiKey_J, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteGlobal)) {
|
||||||
|
ImGui::SetScrollY(ImGui::GetScrollY() + scroll_amount);
|
||||||
|
manually_scrolled = true;
|
||||||
|
}
|
||||||
|
if (ImGui::Shortcut(ImGuiKey_K, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteGlobal)) {
|
||||||
|
ImGui::SetScrollY(ImGui::GetScrollY() - scroll_amount);
|
||||||
|
manually_scrolled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: figure ot page size
|
||||||
|
if (ImGui::Shortcut(ImGuiKey_PageDown, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteGlobal)) {
|
||||||
|
ImGui::SetScrollY(ImGui::GetScrollY() + scroll_amount*10.f);
|
||||||
|
manually_scrolled = true;
|
||||||
|
}
|
||||||
|
if (ImGui::Shortcut(ImGuiKey_PageUp, ImGuiInputFlags_Repeat | ImGuiInputFlags_RouteGlobal)) {
|
||||||
|
ImGui::SetScrollY(ImGui::GetScrollY() - scroll_amount*10.f);
|
||||||
|
manually_scrolled = true;
|
||||||
|
}
|
||||||
|
|
||||||
auto* msg_reg_ptr = _rmm.get(c);
|
auto* msg_reg_ptr = _rmm.get(c);
|
||||||
|
|
||||||
constexpr ImGuiTableFlags table_flags =
|
constexpr ImGuiTableFlags table_flags =
|
||||||
@@ -1049,8 +1073,13 @@ void ChatGui4::renderChatLog(Contact4 c, bool window_focused, const std::vector<
|
|||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ImGui::Shortcut(ImGuiKey_End, ImGuiInputFlags_RouteGlobal)) {
|
||||||
|
ImGui::SetScrollHereY(1.f);
|
||||||
|
manually_scrolled = true;
|
||||||
|
}
|
||||||
|
|
||||||
// follow if at bottom (this is a frame delayed, but thats just how it works)
|
// follow if at bottom (this is a frame delayed, but thats just how it works)
|
||||||
if (ImGui::GetScrollY() >= ImGui::GetScrollMaxY()) {
|
if (!manually_scrolled && ImGui::GetScrollY() >= ImGui::GetScrollMaxY()) {
|
||||||
ImGui::SetScrollHereY(1.f);
|
ImGui::SetScrollHereY(1.f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
#include <solanaceae/contact/components.hpp>
|
#include <solanaceae/contact/components.hpp>
|
||||||
|
|
||||||
|
#include "./chat_gui/about.hpp"
|
||||||
|
|
||||||
#include "./frame_streams/sdl/sdl_audio2_frame_stream2.hpp"
|
#include "./frame_streams/sdl/sdl_audio2_frame_stream2.hpp"
|
||||||
#include "./frame_streams/sdl/sdl_video_frame_stream2.hpp"
|
#include "./frame_streams/sdl/sdl_video_frame_stream2.hpp"
|
||||||
|
|
||||||
@@ -369,7 +371,14 @@ Screen* MainScreen::render(float time_delta, bool&) {
|
|||||||
if (ImGui::Begin("tomato")) {
|
if (ImGui::Begin("tomato")) {
|
||||||
if (ImGui::BeginMenuBar()) {
|
if (ImGui::BeginMenuBar()) {
|
||||||
// ImGui::Separator(); // why do we not need this????
|
// ImGui::Separator(); // why do we not need this????
|
||||||
if (ImGui::BeginMenu("Performance")) {
|
if (_compute_lower_limit_hit) {
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Text, {1.f, 0.2f, 0.2f, 1.f});
|
||||||
|
}
|
||||||
|
bool perf_menu = ImGui::BeginMenu("Performance");
|
||||||
|
if (_compute_lower_limit_hit) {
|
||||||
|
ImGui::PopStyleColor();
|
||||||
|
}
|
||||||
|
if (perf_menu) {
|
||||||
{ // fps
|
{ // fps
|
||||||
const auto targets = "normal\0reduced\0powersave\0";
|
const auto targets = "normal\0reduced\0powersave\0";
|
||||||
ImGui::SetNextItemWidth(ImGui::GetFontSize()*10);
|
ImGui::SetNextItemWidth(ImGui::GetFontSize()*10);
|
||||||
@@ -386,13 +395,24 @@ Screen* MainScreen::render(float time_delta, bool&) {
|
|||||||
ImGui::Separator();
|
ImGui::Separator();
|
||||||
|
|
||||||
ImGui::Text("render interval: %.0fms (%.2ffps)", _render_interval*1000.f, 1.f/_render_interval);
|
ImGui::Text("render interval: %.0fms (%.2ffps)", _render_interval*1000.f, 1.f/_render_interval);
|
||||||
|
|
||||||
|
if (_compute_lower_limit_hit) {
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Text, {1.f, 0.2f, 0.2f, 1.f});
|
||||||
|
}
|
||||||
ImGui::Text("tick interval: %.0fms (%.2ftps)", _min_tick_interval*1000.f, 1.f/_min_tick_interval);
|
ImGui::Text("tick interval: %.0fms (%.2ftps)", _min_tick_interval*1000.f, 1.f/_min_tick_interval);
|
||||||
|
if (_compute_lower_limit_hit) {
|
||||||
|
ImGui::PopStyleColor();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::EndMenu();
|
ImGui::EndMenu();
|
||||||
}
|
}
|
||||||
if (ImGui::BeginMenu("Settings")) {
|
if (ImGui::BeginMenu("Settings")) {
|
||||||
ImGui::SeparatorText("ImGui");
|
ImGui::SeparatorText("ImGui");
|
||||||
|
|
||||||
|
if (ImGui::MenuItem("About Dear ImGui", nullptr, _show_imgui_about)) {
|
||||||
|
_show_imgui_about = !_show_imgui_about;
|
||||||
|
}
|
||||||
|
|
||||||
if (ImGui::MenuItem("Style Editor", nullptr, _show_tool_style_editor)) {
|
if (ImGui::MenuItem("Style Editor", nullptr, _show_tool_style_editor)) {
|
||||||
_show_tool_style_editor = !_show_tool_style_editor;
|
_show_tool_style_editor = !_show_tool_style_editor;
|
||||||
}
|
}
|
||||||
@@ -415,6 +435,9 @@ Screen* MainScreen::render(float time_delta, bool&) {
|
|||||||
|
|
||||||
ImGui::EndMenu();
|
ImGui::EndMenu();
|
||||||
}
|
}
|
||||||
|
if (ImGui::MenuItem("About", nullptr, _show_about)) {
|
||||||
|
_show_about = !_show_about;
|
||||||
|
}
|
||||||
ImGui::EndMenuBar();
|
ImGui::EndMenuBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -422,6 +445,10 @@ Screen* MainScreen::render(float time_delta, bool&) {
|
|||||||
ImGui::End();
|
ImGui::End();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_show_imgui_about) {
|
||||||
|
ImGui::ShowAboutWindow(&_show_imgui_about);
|
||||||
|
}
|
||||||
|
|
||||||
if (_show_tool_style_editor) {
|
if (_show_tool_style_editor) {
|
||||||
if (ImGui::Begin("Dear ImGui Style Editor", &_show_tool_style_editor)) {
|
if (ImGui::Begin("Dear ImGui Style Editor", &_show_tool_style_editor)) {
|
||||||
ImGui::ShowStyleEditor();
|
ImGui::ShowStyleEditor();
|
||||||
@@ -445,6 +472,15 @@ Screen* MainScreen::render(float time_delta, bool&) {
|
|||||||
ImGui::ShowDemoWindow(&_show_tool_demo);
|
ImGui::ShowDemoWindow(&_show_tool_demo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_show_about) {
|
||||||
|
if (ImGui::Begin("About", &_show_about, ImGuiWindowFlags_AlwaysAutoResize)) {
|
||||||
|
ImGuiTomatoAbout();
|
||||||
|
}
|
||||||
|
ImGui::End();
|
||||||
|
}
|
||||||
|
|
||||||
|
_compute_lower_limit_hit_rendered = true;
|
||||||
|
|
||||||
float tc_unfinished_queue_interval;
|
float tc_unfinished_queue_interval;
|
||||||
{ // load rendered but not loaded textures
|
{ // load rendered but not loaded textures
|
||||||
bool unfinished_work_queue = contact_tc.workLoadQueue();
|
bool unfinished_work_queue = contact_tc.workLoadQueue();
|
||||||
@@ -653,15 +689,24 @@ Screen* MainScreen::tick(float time_delta, bool& quit) {
|
|||||||
|
|
||||||
//std::cout << "MS: min tick interval: " << _min_tick_interval << "\n";
|
//std::cout << "MS: min tick interval: " << _min_tick_interval << "\n";
|
||||||
|
|
||||||
|
float compute_mode_lower_limit = 0;
|
||||||
switch (_compute_perf_mode) {
|
switch (_compute_perf_mode) {
|
||||||
// normal 1ms lower bound
|
// normal 1ms lower bound
|
||||||
case 0: _min_tick_interval = std::max<float>(_min_tick_interval, 0.001f); break;
|
case 0: compute_mode_lower_limit = 0.001f; break;
|
||||||
// in powersave fix the lowerbound to 100ms
|
// in powersave fix the lowerbound to 100ms
|
||||||
case 1: _min_tick_interval = std::max<float>(_min_tick_interval, 0.1f); break;
|
case 1: compute_mode_lower_limit = 0.1f; break;
|
||||||
// extreme 2s
|
// extreme 2s
|
||||||
case 2: _min_tick_interval = std::max<float>(_min_tick_interval, 1.5f); break;
|
case 2: compute_mode_lower_limit = 1.5f; break;
|
||||||
default: std::cerr << "unknown compute perf mode\n"; std::exit(-1);
|
default: std::cerr << "unknown compute perf mode\n"; std::exit(-1);
|
||||||
}
|
}
|
||||||
|
if (compute_mode_lower_limit > _min_tick_interval) {
|
||||||
|
_min_tick_interval = compute_mode_lower_limit;
|
||||||
|
_compute_lower_limit_hit = true;
|
||||||
|
} else if (_compute_lower_limit_hit_rendered) {
|
||||||
|
// stop indicating a limit hit
|
||||||
|
_compute_lower_limit_hit_rendered = false;
|
||||||
|
_compute_lower_limit_hit = false;
|
||||||
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@@ -111,11 +111,13 @@ struct MainScreen final : public Screen {
|
|||||||
DebugVideoTap dvt;
|
DebugVideoTap dvt;
|
||||||
|
|
||||||
|
|
||||||
|
bool _show_imgui_about {false};
|
||||||
bool _show_tool_style_editor {false};
|
bool _show_tool_style_editor {false};
|
||||||
bool _show_tool_metrics {false};
|
bool _show_tool_metrics {false};
|
||||||
bool _show_tool_debug_log {false};
|
bool _show_tool_debug_log {false};
|
||||||
bool _show_tool_id_stack {false};
|
bool _show_tool_id_stack {false};
|
||||||
bool _show_tool_demo {false};
|
bool _show_tool_demo {false};
|
||||||
|
bool _show_about {false};
|
||||||
|
|
||||||
bool _window_focused {true};
|
bool _window_focused {true};
|
||||||
bool _window_hidden {false};
|
bool _window_hidden {false};
|
||||||
@@ -145,6 +147,9 @@ struct MainScreen final : public Screen {
|
|||||||
float _render_interval {1.f/60.f};
|
float _render_interval {1.f/60.f};
|
||||||
float _min_tick_interval {0.f};
|
float _min_tick_interval {0.f};
|
||||||
|
|
||||||
|
bool _compute_lower_limit_hit {false};
|
||||||
|
bool _compute_lower_limit_hit_rendered {false};
|
||||||
|
|
||||||
float nextRender(void) override { return _render_interval; }
|
float nextRender(void) override { return _render_interval; }
|
||||||
float nextTick(void) override { return _min_tick_interval; }
|
float nextTick(void) override { return _min_tick_interval; }
|
||||||
};
|
};
|
||||||
|
@@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
#include "./json_to_config.hpp"
|
#include "./json_to_config.hpp"
|
||||||
|
|
||||||
|
#include "./chat_gui/about.hpp"
|
||||||
|
|
||||||
#include <nlohmann/json.hpp>
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
@@ -55,6 +57,10 @@ StartScreen::StartScreen(const std::vector<std::string_view>& args, SDL_Renderer
|
|||||||
const auto& plugin_path = args.at(ai);
|
const auto& plugin_path = args.at(ai);
|
||||||
// TODO: check for dups
|
// TODO: check for dups
|
||||||
queued_plugin_paths.push_back(static_cast<std::string>(plugin_path));
|
queued_plugin_paths.push_back(static_cast<std::string>(plugin_path));
|
||||||
|
} else if (args.at(ai) == "--crash") {
|
||||||
|
// HACK: force bad pointer
|
||||||
|
int* _p {reinterpret_cast<int*>(args.size())};
|
||||||
|
*_p = 1337;
|
||||||
} else {
|
} else {
|
||||||
std::cerr << "TOMATO error: unknown cli arg: '" << args.at(ai) << "'\n";
|
std::cerr << "TOMATO error: unknown cli arg: '" << args.at(ai) << "'\n";
|
||||||
}
|
}
|
||||||
@@ -178,9 +184,18 @@ Screen* StartScreen::render(float, bool&) {
|
|||||||
const float TEXT_PROCEED_WIDTH = ImGui::CalcTextSize("proceed").x;
|
const float TEXT_PROCEED_WIDTH = ImGui::CalcTextSize("proceed").x;
|
||||||
const float TEXT_BASE_HEIGHT = ImGui::GetTextLineHeightWithSpacing();
|
const float TEXT_BASE_HEIGHT = ImGui::GetTextLineHeightWithSpacing();
|
||||||
|
|
||||||
ImGui::SetNextWindowSize({656,334}, ImGuiCond_FirstUseEver);
|
const ImGuiViewport* viewport = ImGui::GetMainViewport();
|
||||||
ImGui::Begin("start screen");
|
ImGui::SetNextWindowPos(viewport->WorkPos);
|
||||||
|
ImGui::SetNextWindowSize(viewport->WorkSize);
|
||||||
|
|
||||||
|
constexpr auto bg_window_flags =
|
||||||
|
ImGuiWindowFlags_NoDecoration |
|
||||||
|
ImGuiWindowFlags_NoMove |
|
||||||
|
ImGuiWindowFlags_NoResize |
|
||||||
|
ImGuiWindowFlags_NoSavedSettings |
|
||||||
|
ImGuiWindowFlags_NoBringToFrontOnFocus;
|
||||||
|
|
||||||
|
if (ImGui::Begin("start screen", nullptr, bg_window_flags)) {
|
||||||
// TODO: imgui tox profile selector?
|
// TODO: imgui tox profile selector?
|
||||||
|
|
||||||
// +----------------------------
|
// +----------------------------
|
||||||
@@ -389,6 +404,12 @@ Screen* StartScreen::render(float, bool&) {
|
|||||||
|
|
||||||
ImGui::EndTabItem();
|
ImGui::EndTabItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ImGui::BeginTabItem("about")) {
|
||||||
|
ImGuiTomatoAbout();
|
||||||
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::EndTabBar();
|
ImGui::EndTabBar();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -439,6 +460,7 @@ Screen* StartScreen::render(float, bool&) {
|
|||||||
ImGui::TextColored({1.f, 0.5f, 0.5f, 1.f}, "%s", _error_string.c_str());
|
ImGui::TextColored({1.f, 0.5f, 0.5f, 1.f}, "%s", _error_string.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::End(); // start screen
|
ImGui::End(); // start screen
|
||||||
|
|
||||||
|
@@ -10,12 +10,14 @@
|
|||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <filesystem>
|
||||||
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
static void eee(std::string& mod) {
|
static void eee(std::string& mod) {
|
||||||
for (char& c : mod) {
|
for (char& c : mod) {
|
||||||
c ^= 0x59;
|
c ^= 0x37;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,11 +220,30 @@ void ToxClient::saveToxProfile(void) {
|
|||||||
}
|
}
|
||||||
eee(_tox_profile_password);
|
eee(_tox_profile_password);
|
||||||
}
|
}
|
||||||
std::ofstream ofile{_tox_profile_path, std::ios::binary};
|
|
||||||
// TODO: improve
|
std::filesystem::path tmp_path = _tox_profile_path + ".tmp";
|
||||||
for (const auto& ch : data) {
|
tmp_path.replace_filename("." + tmp_path.filename().generic_u8string());
|
||||||
ofile.put(ch);
|
|
||||||
|
try {
|
||||||
|
std::ofstream ofile{tmp_path, std::ios::binary};
|
||||||
|
ofile.write(reinterpret_cast<const char*>(data.data()), data.size());
|
||||||
|
ofile.flush();
|
||||||
|
|
||||||
|
if (!ofile.good()) {
|
||||||
|
// TODO: maybe enable fstream exceptions instead?
|
||||||
|
throw std::runtime_error("write error");
|
||||||
}
|
}
|
||||||
|
} catch (...) {
|
||||||
|
std::filesystem::remove(tmp_path);
|
||||||
|
std::cerr << "TOX saving failed!\n";
|
||||||
|
_save_heat = 10.f;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::filesystem::rename(
|
||||||
|
tmp_path,
|
||||||
|
_tox_profile_path
|
||||||
|
);
|
||||||
|
|
||||||
_tox_profile_dirty = false;
|
_tox_profile_dirty = false;
|
||||||
_save_heat = 10.f;
|
_save_heat = 10.f;
|
||||||
|
Reference in New Issue
Block a user