diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml deleted file mode 100644 index 340e954..0000000 --- a/.github/workflows/dotnet.yml +++ /dev/null @@ -1,187 +0,0 @@ -name: .NET -on: push - -jobs: - Linux_amd64: - runs-on: ubuntu-24.04 - container: - image: almalinux:8 - env: - BUILD_TYPE: Release - steps: - - name: Cloning - uses: actions/checkout@v5 - - name: Install packages - run: dnf install -y cmake gcc gcc-c++ - - name: Configure CMake - run: cmake -B "build" -DRAGEPHOTO_C_LIBRARY=ON -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - name: Build - run: cmake --build "build" --config ${{env.BUILD_TYPE}} - - name: Install - run: cmake --install "build" --config ${{env.BUILD_TYPE}} --prefix "install/" - - name: Upload - uses: actions/upload-artifact@v5 - with: - name: AlmaLinux amd64 - path: ${{github.workspace}}/install/ - Linux_arm64: - runs-on: ubuntu-24.04-arm - container: - image: almalinux:8 - env: - BUILD_TYPE: Release - steps: - - name: Cloning - uses: actions/checkout@v5 - - name: Install packages - run: dnf install -y cmake gcc gcc-c++ - - name: Configure CMake - run: cmake -B "build" -DRAGEPHOTO_C_LIBRARY=ON -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - name: Build - run: cmake --build "build" --config ${{env.BUILD_TYPE}} - - name: Install - run: cmake --install "build" --config ${{env.BUILD_TYPE}} --prefix "install/" - - name: Upload - uses: actions/upload-artifact@v5 - with: - name: AlmaLinux arm64 - path: ${{github.workspace}}/install/ - macOS_amd64: - runs-on: macos-15-intel - env: - BUILD_TYPE: Release - steps: - - name: Cloning - uses: actions/checkout@v5 - - name: Configure CMake - run: cmake -B "${{github.workspace}}/build" -DRAGEPHOTO_C_LIBRARY=ON -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja - - name: Build - run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} - - name: Install - run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install/" - - name: Upload - uses: actions/upload-artifact@v5 - with: - name: macOS amd64 - path: ${{github.workspace}}/install/ - macOS_arm64: - runs-on: macos-15 - env: - BUILD_TYPE: Release - steps: - - name: Cloning - uses: actions/checkout@v5 - - name: Configure CMake - run: cmake -B "${{github.workspace}}/build" -DRAGEPHOTO_C_LIBRARY=ON -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja - - name: Build - run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} - - name: Install - run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install/" - - name: Upload - uses: actions/upload-artifact@v5 - with: - name: macOS arm64 - path: ${{github.workspace}}/install/ - Windows: - runs-on: windows-latest - env: - BUILD_TYPE: Release - strategy: - matrix: - arch: - - amd64 - - amd64_x86 - - amd64_arm64 - steps: - - name: Cloning - uses: actions/checkout@v5 - - name: Setup MSVC - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: ${{matrix.arch}} - - name: Configure CMake - run: cmake -B "${{github.workspace}}/build" -DRAGEPHOTO_C_LIBRARY=ON -DRAGEPHOTO_UNICODE=wincvt -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja - - name: Build - run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} - - name: Install - run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install" - - name: Upload - uses: actions/upload-artifact@v5 - with: - name: Windows MSVC ${{matrix.arch}} - path: ${{github.workspace}}/install/ - Release: - needs: [Linux_amd64, Linux_arm64, macOS_amd64, macOS_arm64, Windows] - runs-on: windows-latest - defaults: - run: - shell: pwsh - env: - BUILD_TYPE: Release - steps: - - name: Cloning - uses: actions/checkout@v5 - - name: Download Linux amd64 Assets - uses: actions/download-artifact@v6 - with: - name: AlmaLinux amd64 - path: assets/linux-x64 - - name: Download Linux arm64 Assets - uses: actions/download-artifact@v6 - with: - name: AlmaLinux arm64 - path: assets/linux-arm64 - - name: Download macOS amd64 Assets - uses: actions/download-artifact@v6 - with: - name: macOS amd64 - path: assets/osx-x64 - - name: Download macOS arm64 Assets - uses: actions/download-artifact@v6 - with: - name: macOS arm64 - path: assets/osx-arm64 - - name: Download Windows MSVC amd64 Assets - uses: actions/download-artifact@v6 - with: - name: Windows MSVC amd64 - path: assets/win-x64 - - name: Download Windows MSVC arm64 Assets - uses: actions/download-artifact@v6 - with: - name: Windows MSVC amd64_arm64 - path: assets/win-arm64 - - name: Download Windows MSVC x86 Assets - uses: actions/download-artifact@v6 - with: - name: Windows MSVC amd64_x86 - path: assets/win-x86 - - name: Copy Assets - run: | - mkdir -p "${{github.workspace}}\src\dotnet\runtimes\linux-arm64\native" - mkdir -p "${{github.workspace}}\src\dotnet\runtimes\linux-x64\native" - mkdir -p "${{github.workspace}}\src\dotnet\runtimes\osx-arm64\native" - mkdir -p "${{github.workspace}}\src\dotnet\runtimes\osx-x64\native" - mkdir -p "${{github.workspace}}\src\dotnet\runtimes\win-arm64\native" - mkdir -p "${{github.workspace}}\src\dotnet\runtimes\win-x64\native" - mkdir -p "${{github.workspace}}\src\dotnet\runtimes\win-x86\native" - cp "${{github.workspace}}\assets\linux-arm64\lib64\libragephoto.so" "${{github.workspace}}\src\dotnet\runtimes\linux-arm64\native\libragephoto.so" - cp "${{github.workspace}}\assets\linux-x64\lib64\libragephoto.so" "${{github.workspace}}\src\dotnet\runtimes\linux-x64\native\libragephoto.so" - cp "${{github.workspace}}\assets\osx-arm64\lib\libragephoto.dylib" "${{github.workspace}}\src\dotnet\runtimes\osx-arm64\native\libragephoto.dylib" - cp "${{github.workspace}}\assets\osx-x64\lib\libragephoto.dylib" "${{github.workspace}}\src\dotnet\runtimes\osx-x64\native\libragephoto.dylib" - cp "${{github.workspace}}\assets\win-arm64\bin\libragephoto.dll" "${{github.workspace}}\src\dotnet\runtimes\win-arm64\native\libragephoto.dll" - cp "${{github.workspace}}\assets\win-x64\bin\libragephoto.dll" "${{github.workspace}}\src\dotnet\runtimes\win-x64\native\libragephoto.dll" - cp "${{github.workspace}}\assets\win-x86\bin\libragephoto.dll" "${{github.workspace}}\src\dotnet\runtimes\win-x86\native\libragephoto.dll" - - name: Setup MSBuild - uses: microsoft/setup-msbuild@v2 - - name: Setup .NET - uses: actions/setup-dotnet@v5 - with: - dotnet-version: 8.0.x - - name: Build RagePhoto.Core - run: msbuild "${{github.workspace}}\src\dotnet\RagePhoto.Core.csproj" /t:restore /t:pack /p:Configuration=${{env.BUILD_TYPE}} - - name: Upload - uses: actions/upload-artifact@v5 - with: - name: NuGet Package - path: ${{github.workspace}}\src\dotnet\bin\${{env.BUILD_TYPE}}\RagePhoto.Core.*.nupkg diff --git a/.github/workflows/ubuntu-c.yml b/.github/workflows/ubuntu-c.yml index 9b116a4..f9f0ade 100644 --- a/.github/workflows/ubuntu-c.yml +++ b/.github/workflows/ubuntu-c.yml @@ -7,20 +7,22 @@ jobs: env: BUILD_TYPE: Release steps: - - name: Cloning - uses: actions/checkout@v5 + - uses: actions/checkout@v4 + with: + submodules: recursive - name: Install packages run: | sudo apt-get update -qq sudo apt-get install cmake gcc g++ ninja-build -qq - name: Configure CMake - run: cmake -B "${{github.workspace}}/build" -DRAGEPHOTO_C_LIBRARY=ON -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DRAGEPHOTO_C_LIBRARY=ON -GNinja - name: Build - run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - name: Install - run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install/usr/local" + run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --prefix ${{github.workspace}}/install/usr/local - name: Upload - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v4 with: name: Ubuntu - path: ${{github.workspace}}/install/ + path: | + ${{github.workspace}}/install/ diff --git a/.github/workflows/ubuntu-cxx.yml b/.github/workflows/ubuntu-cxx.yml index b4ba087..6c734fe 100644 --- a/.github/workflows/ubuntu-cxx.yml +++ b/.github/workflows/ubuntu-cxx.yml @@ -6,26 +6,23 @@ jobs: runs-on: ubuntu-latest env: BUILD_TYPE: Release - strategy: - matrix: - cxxstd: - - 11 - - 17 steps: - - name: Cloning - uses: actions/checkout@v5 + - uses: actions/checkout@v4 + with: + submodules: recursive - name: Install packages run: | sudo apt-get update -qq sudo apt-get install cmake gcc g++ ninja-build -qq - name: Configure CMake - run: cmake -B "${{github.workspace}}/build" -DRAGEPHOTO_CXX_STANDARD=${{matrix.cxxstd}} -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja + run: cmake -B ${{github.workspace}}/build -DRAGEPHOTO_CXX_STANDARD=17 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja - name: Build - run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - name: Install - run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install/usr/local" + run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --prefix ${{github.workspace}}/install/usr/local - name: Upload - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v4 with: - name: Ubuntu C++${{matrix.cxxstd}} - path: ${{github.workspace}}/install/ + name: Ubuntu + path: | + ${{github.workspace}}/install/ diff --git a/.github/workflows/webassembly-c.yml b/.github/workflows/webassembly-c.yml index 477ff38..97864fe 100644 --- a/.github/workflows/webassembly-c.yml +++ b/.github/workflows/webassembly-c.yml @@ -7,8 +7,9 @@ jobs: env: BUILD_TYPE: Release steps: - - name: Cloning - uses: actions/checkout@v5 + - uses: actions/checkout@v4 + with: + submodules: recursive - name: Setup emsdk uses: mymindstorm/setup-emsdk@v14 with: @@ -18,11 +19,11 @@ jobs: sudo apt-get update -qq sudo apt-get install cmake ninja-build -qq - name: Configure CMake - run: emcmake cmake -B "${{github.workspace}}/build" -DRAGEPHOTO_C_LIBRARY=ON -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja + run: emcmake cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DRAGEPHOTO_C_LIBRARY=ON -GNinja - name: Build - run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - name: Upload - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v4 with: name: WebAssembly path: | diff --git a/.github/workflows/webassembly-cxx.yml b/.github/workflows/webassembly-cxx.yml index 9cae1f8..8a433d0 100644 --- a/.github/workflows/webassembly-cxx.yml +++ b/.github/workflows/webassembly-cxx.yml @@ -7,8 +7,9 @@ jobs: env: BUILD_TYPE: Release steps: - - name: Cloning - uses: actions/checkout@v5 + - uses: actions/checkout@v4 + with: + submodules: recursive - name: Setup emsdk uses: mymindstorm/setup-emsdk@v14 with: @@ -18,11 +19,11 @@ jobs: sudo apt-get update -qq sudo apt-get install cmake ninja-build -qq - name: Configure CMake - run: emcmake cmake -B "${{github.workspace}}/build" -DRAGEPHOTO_CXX_STANDARD=11 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja + run: emcmake cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DRAGEPHOTO_CXX_STANDARD=11 -GNinja - name: Build - run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - name: Upload - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v4 with: name: WebAssembly path: | diff --git a/.github/workflows/windows-c.yml b/.github/workflows/windows-c.yml index c5545d8..399652c 100644 --- a/.github/workflows/windows-c.yml +++ b/.github/workflows/windows-c.yml @@ -13,20 +13,21 @@ jobs: - amd64_x86 - amd64_arm64 steps: - - name: Cloning - uses: actions/checkout@v5 - - name: Setup MSVC - uses: ilammy/msvc-dev-cmd@v1 + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: ilammy/msvc-dev-cmd@v1 with: arch: ${{matrix.arch}} - name: Configure CMake - run: cmake -B "${{github.workspace}}/build" -DRAGEPHOTO_C_LIBRARY=ON -DRAGEPHOTO_UNICODE=wincvt -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DRAGEPHOTO_C_LIBRARY=ON -DRAGEPHOTO_UNICODE=wincvt -GNinja - name: Build - run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - name: Install - run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install" + run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --prefix ${{github.workspace}}/install - name: Upload - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v4 with: name: Windows MSVC ${{matrix.arch}} - path: ${{github.workspace}}/install/ + path: | + ${{github.workspace}}/install/ diff --git a/.github/workflows/windows-cxx.yml b/.github/workflows/windows-cxx.yml index 64af6cb..6c0efd6 100644 --- a/.github/workflows/windows-cxx.yml +++ b/.github/workflows/windows-cxx.yml @@ -12,24 +12,22 @@ jobs: - amd64 - amd64_x86 - amd64_arm64 - cxxstd: - - 11 - - 17 steps: - - name: Cloning - uses: actions/checkout@v5 - - name: Setup MSVC - uses: ilammy/msvc-dev-cmd@v1 + - uses: actions/checkout@v4 + with: + submodules: recursive + - uses: ilammy/msvc-dev-cmd@v1 with: arch: ${{matrix.arch}} - name: Configure CMake - run: cmake -B "${{github.workspace}}/build" -DRAGEPHOTO_CXX_STANDARD=${{matrix.cxxstd}} -DRAGEPHOTO_UNICODE=wincvt -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -GNinja + run: cmake -B ${{github.workspace}}/build -DRAGEPHOTO_CXX_STANDARD=17 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DRAGEPHOTO_UNICODE=wincvt -GNinja - name: Build - run: cmake --build "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - name: Install - run: cmake --install "${{github.workspace}}/build" --config ${{env.BUILD_TYPE}} --prefix "${{github.workspace}}/install" + run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --prefix ${{github.workspace}}/install - name: Upload - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v4 with: - name: Windows MSVC C++${{matrix.cxxstd}} ${{matrix.arch}} - path: ${{github.workspace}}/install/ + name: Windows MSVC ${{matrix.arch}} + path: | + ${{github.workspace}}/install/ diff --git a/.github/workflows/windows-dotnet.yml b/.github/workflows/windows-dotnet.yml new file mode 100644 index 0000000..72cb53a --- /dev/null +++ b/.github/workflows/windows-dotnet.yml @@ -0,0 +1,78 @@ +name: Windows .NET +on: push + +jobs: + Native: + runs-on: windows-latest + env: + BUILD_TYPE: Release + strategy: + matrix: + arch: + - amd64 + - amd64_x86 + - amd64_arm64 + steps: + - name: Cloning + uses: actions/checkout@v4 + - uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{matrix.arch}} + - name: Configure CMake + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DRAGEPHOTO_C_LIBRARY=ON -DRAGEPHOTO_UNICODE=wincvt -GNinja + - name: Build + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + - name: Install + run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --prefix ${{github.workspace}}/install + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: Windows MSVC ${{matrix.arch}} + path: | + ${{github.workspace}}/install/ + Release: + needs: Native + runs-on: windows-latest + env: + BUILD_TYPE: Release + steps: + - name: Cloning + uses: actions/checkout@v4 + - name: Download Windows MSVC amd64 Assets + uses: actions/download-artifact@v4 + with: + name: Windows MSVC amd64 + path: assets/amd64 + - name: Download Windows MSVC amd64_x86 Assets + uses: actions/download-artifact@v4 + with: + name: Windows MSVC amd64_x86 + path: assets/amd64_x86 + - name: Download Windows MSVC amd64_arm64 Assets + uses: actions/download-artifact@v4 + with: + name: Windows MSVC amd64_arm64 + path: assets/amd64_arm64 + - name: Copy Assets + shell: pwsh + run: | + mkdir -p ${{github.workspace}}\src\dotnet\runtimes\win-arm64\native + mkdir -p ${{github.workspace}}\src\dotnet\runtimes\win-x64\native + mkdir -p ${{github.workspace}}\src\dotnet\runtimes\win-x86\native + cp ${{github.workspace}}\assets\amd64_arm64\bin\libragephoto.dll ${{github.workspace}}\src\dotnet\runtimes\win-arm64\native\libragephoto.dll + cp ${{github.workspace}}\assets\amd64\bin\libragephoto.dll ${{github.workspace}}\src\dotnet\runtimes\win-x64\native\libragephoto.dll + cp ${{github.workspace}}\assets\amd64_x86\bin\libragephoto.dll ${{github.workspace}}\src\dotnet\runtimes\win-x86\native\libragephoto.dll + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v2 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Build Syping.RagePhoto.Core + run: msbuild ${{github.workspace}}\src\dotnet\Syping.RagePhoto.Core.csproj /t:restore /t:pack /p:Configuration=${{env.BUILD_TYPE}} + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: NuGet Package + path: | + ${{github.workspace}}\src\dotnet\bin\${{env.BUILD_TYPE}}\Syping.RagePhoto.Core.*.nupkg diff --git a/CMakeLists.txt b/CMakeLists.txt index df8e7f4..a838af8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ #[[************************************************************************** * libragephoto RAGE Photo Parser -* Copyright (C) 2021-2025 Syping +* Copyright (C) 2021-2024 Syping * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -18,7 +18,7 @@ cmake_minimum_required(VERSION 3.16) cmake_policy(VERSION 3.16...3.28) -project(ragephoto VERSION 0.7.1 LANGUAGES C CXX) +project(ragephoto VERSION 0.6.2 LANGUAGES C CXX) include(GNUInstallDirs) # RagePhoto CMake includes @@ -136,7 +136,6 @@ target_include_directories(ragephoto PUBLIC "${ragephoto_BINARY_DIR}/include" "${ragephoto_SOURCE_DIR}/src/core" ) -target_link_libraries(ragephoto PRIVATE ${LIBRAGEPHOTO_LIBS}) install(TARGETS ragephoto ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" diff --git a/cmake/unicode.cmake b/cmake/unicode.cmake index 079dd7f..686bbf1 100644 --- a/cmake/unicode.cmake +++ b/cmake/unicode.cmake @@ -1,6 +1,6 @@ #[[************************************************************************** * libragephoto RAGE Photo Parser -* Copyright (C) 2021-2025 Syping +* Copyright (C) 2021-2024 Syping * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -17,31 +17,17 @@ ****************************************************************************]] set(RAGEPHOTO_UNICODE "" CACHE STRING "libragephoto Unicode implementation") -set(RAGEPHOTO_UNICODE_LIBS "" CACHE STRING "libragephoto Unicode libraries") if (RAGEPHOTO_UNICODE) string(TOUPPER "UNICODE_${RAGEPHOTO_UNICODE}" UNICODE_DEF) list(APPEND LIBRAGEPHOTO_DEFINES - ${UNICODE_DEF} - ) - list(APPEND LIBRAGEPHOTO_LIBS - ${RAGEPHOTO_UNICODE_LIBS} + "${UNICODE_DEF}" ) message("-- UnicodeCvt - ${RAGEPHOTO_UNICODE}") else() - # RagePhoto test source files - if (RAGEPHOTO_C_LIBRARY) - set(ICONV_SOURCE "${PROJECT_SOURCE_DIR}/tests/IconvTest.c") - set(WINCVT_SOURCE "${PROJECT_SOURCE_DIR}/tests/WincvtTest.c") - else() - set(CODECVT_SOURCE "${PROJECT_SOURCE_DIR}/tests/CodecvtTest.cpp") - set(ICONV_SOURCE "${PROJECT_SOURCE_DIR}/tests/IconvTest.cpp") - set(WINCVT_SOURCE "${PROJECT_SOURCE_DIR}/tests/WincvtTest.cpp") - endif() - # RagePhoto Unicode functionality tests if (NOT RAGEPHOTO_C_LIBRARY) message("-- Testing codecvt") - try_run(CODECVT_RUN CODECVT_COMPILE "${PROJECT_BINARY_DIR}" "${CODECVT_SOURCE}") + try_run(CODECVT_RUN CODECVT_COMPILE "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/tests/CodecvtTest.cpp") if (CODECVT_COMPILE AND CODECVT_RUN EQUAL 0) set(CODECVT_COMPAT TRUE) message("-- Testing codecvt - yes") @@ -51,24 +37,25 @@ else() endif() message("-- Testing iconv") - try_run(ICONV_RUN ICONV_COMPILE "${PROJECT_BINARY_DIR}" "${ICONV_SOURCE}") + if (RAGEPHOTO_C_LIBRARY) + try_run(ICONV_RUN ICONV_COMPILE "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/tests/IconvTest.c") + else() + try_run(ICONV_RUN ICONV_COMPILE "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/tests/IconvTest.cpp") + endif() if (ICONV_COMPILE AND ICONV_RUN EQUAL 0) set(ICONV_COMPAT TRUE) message("-- Testing iconv - yes") else() - try_run(ICONV_RUN ICONV_COMPILE "${PROJECT_BINARY_DIR}" "${ICONV_SOURCE}" LINK_LIBRARIES iconv) - if (ICONV_COMPILE AND ICONV_RUN EQUAL 0) - set(ICONV_COMPAT TRUE) - set(ICONV_LINKED TRUE) - message("-- Testing iconv - yes (linked)") - else() - message("-- Testing iconv - no") - endif() + message("-- Testing iconv - no") endif() if (WIN32) message("-- Testing wincvt") - try_run(WINCVT_RUN WINCVT_COMPILE "${PROJECT_BINARY_DIR}" "${WINCVT_SOURCE}") + if (RAGEPHOTO_C_LIBRARY) + try_run(WINCVT_RUN WINCVT_COMPILE "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/tests/WincvtTest.c") + else() + try_run(WINCVT_RUN WINCVT_COMPILE "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/tests/WincvtTest.cpp") + endif() if (WINCVT_COMPILE AND WINCVT_RUN EQUAL 0) set(WINCVT_COMPAT TRUE) message("-- Testing wincvt - yes") @@ -80,23 +67,18 @@ else() # Unicode implementation for RagePhoto if (WINCVT_COMPAT) list(APPEND LIBRAGEPHOTO_DEFINES - UNICODE_WINCVT + "UNICODE_WINCVT" ) message("-- UnicodeCvt - wincvt") elseif (CODECVT_COMPAT AND NOT RAGEPHOTO_C_LIBRARY) list(APPEND LIBRAGEPHOTO_DEFINES - UNICODE_CODECVT + "UNICODE_CODECVT" ) message("-- UnicodeCvt - codecvt") elseif (ICONV_COMPAT) list(APPEND LIBRAGEPHOTO_DEFINES - UNICODE_ICONV + "UNICODE_ICONV" ) - if (ICONV_LINKED) - list(APPEND LIBRAGEPHOTO_LIBS - iconv - ) - endif() message("-- UnicodeCvt - iconv") else() message("-- UnicodeCvt - none") diff --git a/src/core/RagePhoto.c b/src/core/RagePhoto.c index 4821961..27e7a3b 100644 --- a/src/core/RagePhoto.c +++ b/src/core/RagePhoto.c @@ -984,15 +984,6 @@ bool ragephotodata_savef(RagePhotoData *rp_data, RagePhotoFormatParser *rp_parse return false; #endif } - else if (photoFormat == RAGEPHOTO_FORMAT_JPEG) { - const size_t length = ragephotodata_getsavesizef(rp_data, NULL, photoFormat); - size_t pos = 0; - - writeBuffer(rp_data->jpeg, data, &pos, length, rp_data->jpegSize); - - rp_data->error = RAGEPHOTO_ERROR_NOERROR; // 255 - return true; - } else if (rp_parser) { RagePhotoFormatParser n_parser; memset(&n_parser, 0, sizeof(RagePhotoFormatParser)); @@ -1058,8 +1049,6 @@ size_t ragephotodata_getsavesizef(RagePhotoData *rp_data, RagePhotoFormatParser return (rp_data->jpegBuffer + rp_data->jsonBuffer + rp_data->titlBuffer + rp_data->descBuffer + RAGEPHOTO_GTA5_HEADERSIZE + UINT32_C(56)); else if (photoFormat == RAGEPHOTO_FORMAT_RDR2) return (rp_data->jpegBuffer + rp_data->jsonBuffer + rp_data->titlBuffer + rp_data->descBuffer + RAGEPHOTO_RDR2_HEADERSIZE + UINT32_C(56)); - else if (photoFormat == RAGEPHOTO_FORMAT_JPEG) - return (rp_data->jpegSize); else if (rp_parser) { RagePhotoFormatParser n_parser; memset(&n_parser, 0, sizeof(RagePhotoFormatParser)); @@ -1207,7 +1196,7 @@ void ragephoto_setphotodesc(ragephoto_t instance_t, const char *description, uin } if (bufferSize != 0) { instance->data->descBuffer = bufferSize; - ragephotodata_setbufferoffsets(instance->data); + ragephoto_setbufferoffsets(instance->data); } instance->data->error = RAGEPHOTO_ERROR_NOERROR; // 255 } diff --git a/src/core/RagePhoto.cpp b/src/core/RagePhoto.cpp index 5d15ebc..e556d0e 100644 --- a/src/core/RagePhoto.cpp +++ b/src/core/RagePhoto.cpp @@ -939,15 +939,6 @@ bool RagePhoto::save(char *data, uint32_t photoFormat, RagePhotoData *rp_data, R return false; #endif } - else if (photoFormat == PhotoFormat::JPEG) { - const size_t length = saveSize(photoFormat, rp_data, nullptr); - size_t pos = 0; - - writeBuffer(rp_data->jpeg, data, &pos, length, rp_data->jpegSize); - - rp_data->error = Error::NoError; // 255 - return true; - } else if (rp_parser) { RagePhotoFormatParser n_parser[1]{}; for (size_t i = 0; memcmp(&n_parser[0], &rp_parser[i], sizeof(RagePhotoFormatParser)); i++) { @@ -1013,7 +1004,11 @@ bool RagePhoto::saveFile(const char *filename, uint32_t photoFormat) m_data->error = Error::Uninitialised; // 0 return false; } +#if (RAGEPHOTO_CXX_STD >= 11) && (__cplusplus >= 201103L) + ofs << sdata; +#else ofs.write(sdata.data(), sdata.size()); +#endif ok = ofs.good(); ofs.close(); return ok; @@ -1033,8 +1028,6 @@ size_t RagePhoto::saveSize(uint32_t photoFormat, RagePhotoData *rp_data, RagePho return (rp_data->jpegBuffer + rp_data->jsonBuffer + rp_data->titlBuffer + rp_data->descBuffer + GTA5_HEADERSIZE + UINT32_C(56)); else if (photoFormat == PhotoFormat::RDR2) return (rp_data->jpegBuffer + rp_data->jsonBuffer + rp_data->titlBuffer + rp_data->descBuffer + RDR2_HEADERSIZE + UINT32_C(56)); - else if (photoFormat == PhotoFormat::JPEG) - return (rp_data->jpegSize); else if (rp_parser) { RagePhotoFormatParser n_parser[1]{}; for (size_t i = 0; memcmp(&n_parser[0], &rp_parser[i], sizeof(RagePhotoFormatParser)); i++) { diff --git a/src/core/RagePhotoLibrary.h b/src/core/RagePhotoLibrary.h index 66896eb..3e45bcb 100644 --- a/src/core/RagePhotoLibrary.h +++ b/src/core/RagePhotoLibrary.h @@ -71,16 +71,16 @@ #if defined(__DARWIN_BYTE_ORDER) && defined(__DARWIN_LITTLE_ENDIAN) && __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN #define LIBRAGEPHOTO_LITTLE_ENDIAN #endif // __DARWIN_BYTE_ORDER -#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) - #include - #if defined(_BYTE_ORDER) && defined(_LITTLE_ENDIAN) && _BYTE_ORDER == _LITTLE_ENDIAN - #define LIBRAGEPHOTO_LITTLE_ENDIAN - #endif // _BYTE_ORDER #elif defined(__linux__) #include #if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && __BYTE_ORDER == __LITTLE_ENDIAN #define LIBRAGEPHOTO_LITTLE_ENDIAN #endif // __BYTE_ORDER +#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) + #include + #if defined(_BYTE_ORDER) && defined(_LITTLE_ENDIAN) && _BYTE_ORDER == _LITTLE_ENDIAN + #define LIBRAGEPHOTO_LITTLE_ENDIAN + #endif // _BYTE_ORDER #endif /* RAGEPHOTO LIBRARY ENDIAN END */ diff --git a/src/core/RagePhotoTypedefs.h b/src/core/RagePhotoTypedefs.h index c21a2ef..5a3cabb 100644 --- a/src/core/RagePhotoTypedefs.h +++ b/src/core/RagePhotoTypedefs.h @@ -1,6 +1,6 @@ /***************************************************************************** * libragephoto RAGE Photo Parser -* Copyright (C) 2021-2025 Syping +* Copyright (C) 2021-2024 Syping * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -136,7 +136,6 @@ typedef enum RagePhotoLibraryFlag { #define RAGEPHOTO_ERROR_UNINITIALISED INT32_C(0) /**< Uninitialised, file access failed */ /* RagePhoto formats */ -#define RAGEPHOTO_FORMAT_JPEG UINT32_C(0xE0FFD8FF) /**< JPEG Photo Format */ #define RAGEPHOTO_FORMAT_GTA5 UINT32_C(0x01000000) /**< GTA V Photo Format */ #define RAGEPHOTO_FORMAT_RDR2 UINT32_C(0x04000000) /**< RDR 2 Photo Format */ diff --git a/src/core/ragephoto_c.hpp b/src/core/ragephoto_c.hpp index 9e73c07..b836cb8 100644 --- a/src/core/ragephoto_c.hpp +++ b/src/core/ragephoto_c.hpp @@ -1,6 +1,6 @@ /***************************************************************************** * libragephoto RAGE Photo Parser -* Copyright (C) 2021-2025 Syping +* Copyright (C) 2021-2024 Syping * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: @@ -41,7 +41,7 @@ public: DEFAULT_JSONBUFFER = RAGEPHOTO_DEFAULT_JSONBUFFER, /**< Default JSON Buffer Size */ DEFAULT_TITLBUFFER = RAGEPHOTO_DEFAULT_TITLBUFFER, /**< Default Title Buffer Size */ GTA5_HEADERSIZE = RAGEPHOTO_GTA5_HEADERSIZE, /**< GTA V Header Size */ - RDR2_HEADERSIZE = RAGEPHOTO_RDR2_HEADERSIZE /**< RDR 2 Header Size */ + RDR2_HEADERSIZE = RAGEPHOTO_RDR2_HEADERSIZE, /**< RDR 2 Header Size */ }; /** Parsing and set errors */ enum Error : int32_t { @@ -85,18 +85,17 @@ public: TitleReadError = RAGEPHOTO_ERROR_TITLEREADERROR, /**< Title can't be read */ UnicodeInitError = RAGEPHOTO_ERROR_UNICODEINITERROR, /**< Failed to initialise Unicode decoder */ UnicodeHeaderError = RAGEPHOTO_ERROR_UNICODEHEADERERROR, /**< Header can't be encoded/decoded successfully */ - Uninitialised = RAGEPHOTO_ERROR_UNINITIALISED /**< Uninitialised, file access failed */ + Uninitialised = RAGEPHOTO_ERROR_UNINITIALISED, /**< Uninitialised, file access failed */ }; /** Photo Formats */ enum PhotoFormat : uint32_t { - JPEG = RAGEPHOTO_FORMAT_JPEG, /**< JPEG Photo Format */ GTA5 = RAGEPHOTO_FORMAT_GTA5, /**< GTA V Photo Format */ - RDR2 = RAGEPHOTO_FORMAT_RDR2 /**< RDR 2 Photo Format */ + RDR2 = RAGEPHOTO_FORMAT_RDR2, /**< RDR 2 Photo Format */ }; /** Sign Initials */ enum SignInitials : uint32_t { SIGTA5 = RAGEPHOTO_SIGNINITIAL_GTA5, /**< GTA V Sign Initial */ - SIRDR2 = RAGEPHOTO_SIGNINITIAL_RDR2 /**< RDR 2 Sign Initial */ + SIRDR2 = RAGEPHOTO_SIGNINITIAL_RDR2, /**< RDR 2 Sign Initial */ }; photo() { instance = ragephoto_open(); diff --git a/src/core/ragephoto_cxx.hpp b/src/core/ragephoto_cxx.hpp index c58a06b..c205266 100644 --- a/src/core/ragephoto_cxx.hpp +++ b/src/core/ragephoto_cxx.hpp @@ -44,7 +44,7 @@ public: DEFAULT_JSONBUFFER = RAGEPHOTO_DEFAULT_JSONBUFFER, /**< Default JSON Buffer Size */ DEFAULT_TITLBUFFER = RAGEPHOTO_DEFAULT_TITLBUFFER, /**< Default Title Buffer Size */ GTA5_HEADERSIZE = RAGEPHOTO_GTA5_HEADERSIZE, /**< GTA V Header Size */ - RDR2_HEADERSIZE = RAGEPHOTO_RDR2_HEADERSIZE /**< RDR 2 Header Size */ + RDR2_HEADERSIZE = RAGEPHOTO_RDR2_HEADERSIZE, /**< RDR 2 Header Size */ }; /** Parsing and set errors */ enum Error : int32_t { @@ -88,18 +88,17 @@ public: TitleReadError = RAGEPHOTO_ERROR_TITLEREADERROR, /**< Title can't be read */ UnicodeInitError = RAGEPHOTO_ERROR_UNICODEINITERROR, /**< Failed to initialise Unicode decoder */ UnicodeHeaderError = RAGEPHOTO_ERROR_UNICODEHEADERERROR, /**< Header can't be encoded/decoded successfully */ - Uninitialised = RAGEPHOTO_ERROR_UNINITIALISED /**< Uninitialised, file access failed */ + Uninitialised = RAGEPHOTO_ERROR_UNINITIALISED, /**< Uninitialised, file access failed */ }; /** Photo Formats */ enum PhotoFormat : uint32_t { - JPEG = RAGEPHOTO_FORMAT_JPEG, /**< JPEG Photo Format */ GTA5 = RAGEPHOTO_FORMAT_GTA5, /**< GTA V Photo Format */ - RDR2 = RAGEPHOTO_FORMAT_RDR2 /**< RDR 2 Photo Format */ + RDR2 = RAGEPHOTO_FORMAT_RDR2, /**< RDR 2 Photo Format */ }; /** Sign Initials */ enum SignInitials : uint32_t { SIGTA5 = RAGEPHOTO_SIGNINITIAL_GTA5, /**< GTA V Sign Initial */ - SIRDR2 = RAGEPHOTO_SIGNINITIAL_RDR2 /**< RDR 2 Sign Initial */ + SIRDR2 = RAGEPHOTO_SIGNINITIAL_RDR2, /**< RDR 2 Sign Initial */ }; photo(); ~photo(); diff --git a/src/dotnet/.editorconfig b/src/dotnet/.editorconfig new file mode 100644 index 0000000..d22e388 --- /dev/null +++ b/src/dotnet/.editorconfig @@ -0,0 +1,244 @@ +# Remove the line below if you want to inherit .editorconfig settings from higher directories +root = true + +# C# files +[*.cs] + +#### Core EditorConfig Options #### + +# Indentation and spacing +indent_size = 4 +indent_style = space +tab_width = 4 + +# New line preferences +end_of_line = crlf +insert_final_newline = false + +#### .NET Code Actions #### + +# Type members +dotnet_hide_advanced_members = false +dotnet_member_insertion_location = with_other_members_of_the_same_kind +dotnet_property_generation_behavior = prefer_throwing_properties + +# Symbol search +dotnet_search_reference_assemblies = true + +#### .NET Coding Conventions #### + +# Organize usings +dotnet_separate_import_directive_groups = false +dotnet_sort_system_directives_first = false +file_header_template = unset + +# this. and Me. preferences +dotnet_style_qualification_for_event = false +dotnet_style_qualification_for_field = false +dotnet_style_qualification_for_method = false +dotnet_style_qualification_for_property = false + +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true +dotnet_style_predefined_type_for_member_access = true + +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity +dotnet_style_parentheses_in_other_operators = never_if_unnecessary +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity + +# Modifier preferences +dotnet_style_require_accessibility_modifiers = for_non_interface_members + +# Expression-level preferences +dotnet_prefer_system_hash_code = true +dotnet_style_coalesce_expression = true +dotnet_style_collection_initializer = true +dotnet_style_explicit_tuple_names = true +dotnet_style_namespace_match_folder = true +dotnet_style_null_propagation = true +dotnet_style_object_initializer = true +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_prefer_auto_properties = true +dotnet_style_prefer_collection_expression = when_types_loosely_match +dotnet_style_prefer_compound_assignment = true +dotnet_style_prefer_conditional_expression_over_assignment = true +dotnet_style_prefer_conditional_expression_over_return = true +dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed +dotnet_style_prefer_inferred_anonymous_type_member_names = true +dotnet_style_prefer_inferred_tuple_names = true +dotnet_style_prefer_is_null_check_over_reference_equality_method = true +dotnet_style_prefer_simplified_boolean_expressions = true +dotnet_style_prefer_simplified_interpolation = true + +# Field preferences +dotnet_style_readonly_field = true + +# Parameter preferences +dotnet_code_quality_unused_parameters = all + +# Suppression preferences +dotnet_remove_unnecessary_suppression_exclusions = none + +# New line preferences +dotnet_style_allow_multiple_blank_lines_experimental = true +dotnet_style_allow_statement_immediately_after_block_experimental = true + +#### C# Coding Conventions #### + +# var preferences +csharp_style_var_elsewhere = false +csharp_style_var_for_built_in_types = false +csharp_style_var_when_type_is_apparent = false + +# Expression-bodied members +csharp_style_expression_bodied_accessors = true +csharp_style_expression_bodied_constructors = false +csharp_style_expression_bodied_indexers = true +csharp_style_expression_bodied_lambdas = true +csharp_style_expression_bodied_local_functions = false +csharp_style_expression_bodied_methods = false +csharp_style_expression_bodied_operators = false +csharp_style_expression_bodied_properties = true + +# Pattern matching preferences +csharp_style_pattern_matching_over_as_with_null_check = true +csharp_style_pattern_matching_over_is_with_cast_check = true +csharp_style_prefer_extended_property_pattern = true +csharp_style_prefer_not_pattern = true +csharp_style_prefer_pattern_matching = true +csharp_style_prefer_switch_expression = true + +# Null-checking preferences +csharp_style_conditional_delegate_call = true + +# Modifier preferences +csharp_prefer_static_anonymous_function = true +csharp_prefer_static_local_function = true +csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async +csharp_style_prefer_readonly_struct = true +csharp_style_prefer_readonly_struct_member = true + +# Code-block preferences +csharp_prefer_braces = true +csharp_prefer_simple_using_statement = true +csharp_prefer_system_threading_lock = true +csharp_style_namespace_declarations = block_scoped +csharp_style_prefer_method_group_conversion = true +csharp_style_prefer_primary_constructors = true +csharp_style_prefer_top_level_statements = true + +# Expression-level preferences +csharp_prefer_simple_default_expression = true +csharp_style_deconstructed_variable_declaration = true +csharp_style_implicit_object_creation_when_type_is_apparent = true +csharp_style_inlined_variable_declaration = true +csharp_style_prefer_index_operator = true +csharp_style_prefer_local_over_anonymous_function = true +csharp_style_prefer_null_check_over_type_check = true +csharp_style_prefer_range_operator = true +csharp_style_prefer_tuple_swap = true +csharp_style_prefer_utf8_string_literals = true +csharp_style_throw_expression = true +csharp_style_unused_value_assignment_preference = discard_variable +csharp_style_unused_value_expression_statement_preference = discard_variable + +# 'using' directive preferences +csharp_using_directive_placement = outside_namespace + +# New line preferences +csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true +csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = true +csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = true +csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true +csharp_style_allow_embedded_statements_on_same_line_experimental = true + +#### C# Formatting Rules #### + +# New line preferences +csharp_new_line_before_catch = true +csharp_new_line_before_else = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_open_brace = none +csharp_new_line_between_query_expression_clauses = true + +# Indentation preferences +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = false +csharp_indent_labels = flush_left +csharp_indent_switch_labels = true + +# Space preferences +csharp_space_after_cast = false +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_after_comma = true +csharp_space_after_dot = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_after_semicolon_in_for_statement = true +csharp_space_around_binary_operators = before_and_after +csharp_space_around_declaration_statements = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_before_comma = false +csharp_space_before_dot = false +csharp_space_before_open_square_brackets = false +csharp_space_before_semicolon_in_for_statement = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_between_square_brackets = false + +# Wrapping preferences +csharp_preserve_single_line_blocks = true +csharp_preserve_single_line_statements = true + +#### Naming styles #### + +# Naming rules + +dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion +dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface +dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i + +dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.types_should_be_pascal_case.symbols = types +dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case + +dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion +dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members +dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case + +# Symbol specifications + +dotnet_naming_symbols.interface.applicable_kinds = interface +dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.interface.required_modifiers = + +dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum +dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.types.required_modifiers = + +dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method +dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected +dotnet_naming_symbols.non_field_members.required_modifiers = + +# Naming styles + +dotnet_naming_style.pascal_case.required_prefix = +dotnet_naming_style.pascal_case.required_suffix = +dotnet_naming_style.pascal_case.word_separator = +dotnet_naming_style.pascal_case.capitalization = pascal_case + +dotnet_naming_style.begins_with_i.required_prefix = I +dotnet_naming_style.begins_with_i.required_suffix = +dotnet_naming_style.begins_with_i.word_separator = +dotnet_naming_style.begins_with_i.capitalization = pascal_case diff --git a/src/dotnet/RagePhoto.Core.targets b/src/dotnet/RagePhoto.Core.targets deleted file mode 100644 index 9e84d18..0000000 --- a/src/dotnet/RagePhoto.Core.targets +++ /dev/null @@ -1,21 +0,0 @@ - - - - - PreserveNewest - false - - - - - PreserveNewest - false - - - - - PreserveNewest - false - - - diff --git a/src/dotnet/RagePhoto.cs b/src/dotnet/RagePhoto.cs index d70f26e..2df7b22 100644 --- a/src/dotnet/RagePhoto.cs +++ b/src/dotnet/RagePhoto.cs @@ -2,7 +2,7 @@ using System.Runtime.InteropServices; using System.Text; -namespace RagePhoto { +namespace Syping.RagePhoto { public class Photo : IDisposable { diff --git a/src/dotnet/RagePhotoException.cs b/src/dotnet/RagePhotoException.cs index 4f8fdf6..90f13f4 100644 --- a/src/dotnet/RagePhotoException.cs +++ b/src/dotnet/RagePhotoException.cs @@ -1,6 +1,6 @@ using System; -namespace RagePhoto { +namespace Syping.RagePhoto { public class RagePhotoException : Exception { diff --git a/src/dotnet/RagePhotoTypes.cs b/src/dotnet/RagePhotoTypes.cs index 8c6dbb3..2a94091 100644 --- a/src/dotnet/RagePhotoTypes.cs +++ b/src/dotnet/RagePhotoTypes.cs @@ -1,6 +1,6 @@ using System; -namespace RagePhoto { +namespace Syping.RagePhoto { public enum DefaultSize : UInt32 { DEFAULT_GTA5_PHOTOBUFFER = 524288U, @@ -57,7 +57,6 @@ namespace RagePhoto { } public enum PhotoFormat : UInt32 { - JPEG = 0xE0FFD8FFU, GTA5 = 0x01000000U, RDR2 = 0x04000000U } diff --git a/src/dotnet/RagePhoto.Core.csproj b/src/dotnet/Syping.RagePhoto.Core.csproj similarity index 61% rename from src/dotnet/RagePhoto.Core.csproj rename to src/dotnet/Syping.RagePhoto.Core.csproj index 0cb99f7..5af116d 100644 --- a/src/dotnet/RagePhoto.Core.csproj +++ b/src/dotnet/Syping.RagePhoto.Core.csproj @@ -2,11 +2,11 @@ netstandard2.1;net47 - RagePhoto.Core - RagePhoto - 0.7.1 - 0.7.1 - 0.7.1 + Syping.RagePhoto.Core + Syping.RagePhoto + 0.6.2 + 0.6.2 + 0.6.2 Syping Copyright © 2025 Syping Open Source RAGE Photo Parser for GTA V and RDR 2 @@ -20,14 +20,17 @@ - + + + + PreserveNewest - - PreserveNewest - - + + + + PreserveNewest diff --git a/src/dotnet/RagePhoto.Core.sln b/src/dotnet/Syping.RagePhoto.Core.sln similarity index 86% rename from src/dotnet/RagePhoto.Core.sln rename to src/dotnet/Syping.RagePhoto.Core.sln index af4b776..d6a5a1a 100644 --- a/src/dotnet/RagePhoto.Core.sln +++ b/src/dotnet/Syping.RagePhoto.Core.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.13.35919.96 d17.13 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RagePhoto.Core", "RagePhoto.Core.csproj", "{00E62D4F-74D6-4167-ABB1-852FFEB65C84}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Syping.RagePhoto.Core", "Syping.RagePhoto.Core.csproj", "{00E62D4F-74D6-4167-ABB1-852FFEB65C84}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/dotnet/Syping.RagePhoto.Core.targets b/src/dotnet/Syping.RagePhoto.Core.targets new file mode 100644 index 0000000..1f80551 --- /dev/null +++ b/src/dotnet/Syping.RagePhoto.Core.targets @@ -0,0 +1,17 @@ + + + + PreserveNewest + + + + + PreserveNewest + + + + + PreserveNewest + + + diff --git a/src/python/__init__.py b/src/python/__init__.py index c9b495a..b3a7697 100644 --- a/src/python/__init__.py +++ b/src/python/__init__.py @@ -1,6 +1,6 @@ ############################################################################## # libragephoto for Python -# Copyright (C) 2023-2025 Syping +# Copyright (C) 2023-2024 Syping # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: diff --git a/src/python/__version__.py.in b/src/python/__version__.py.in index 04d9508..0168254 100644 --- a/src/python/__version__.py.in +++ b/src/python/__version__.py.in @@ -1,6 +1,6 @@ ############################################################################## # libragephoto for Python -# Copyright (C) 2023-2025 Syping +# Copyright (C) 2023 Syping # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: diff --git a/src/python/libragephoto_loader.py b/src/python/libragephoto_loader.py index c1f9ccd..2401359 100644 --- a/src/python/libragephoto_loader.py +++ b/src/python/libragephoto_loader.py @@ -1,6 +1,6 @@ ############################################################################## # libragephoto for Python -# Copyright (C) 2023-2025 Syping +# Copyright (C) 2023-2024 Syping # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: diff --git a/src/python/ragephoto.py b/src/python/ragephoto.py index 9b49dc1..a1574c6 100644 --- a/src/python/ragephoto.py +++ b/src/python/ragephoto.py @@ -1,6 +1,6 @@ ############################################################################## # libragephoto for Python -# Copyright (C) 2023-2025 Syping +# Copyright (C) 2023-2024 Syping # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: @@ -73,7 +73,6 @@ class RagePhoto: Uninitialised = 0 class PhotoFormat(IntEnum): - JPEG = 0xE0FFD8FF GTA5 = 0x01000000 RDR2 = 0x04000000 diff --git a/src/python/setup.py.in b/src/python/setup.py.in index ed5db30..7f1cf4b 100644 --- a/src/python/setup.py.in +++ b/src/python/setup.py.in @@ -1,7 +1,7 @@ #!/usr/bin/env python3 ############################################################################## # libragephoto for Python -# Copyright (C) 2023-2025 Syping +# Copyright (C) 2023 Syping # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: