remove d3dx dependency, severely improve memory usage if necessary (#19)

* basic tga/hdr image loading

* bgr tga tex

* convert to dds during loading
doesn't work yet, fails to create textures from dds memory

* remove ext member from TextureFileStruct

* do not convert images, leads to weird loading problems...

* use regex matching for tpf loading

* convert non-RGBA images to RGBA

* remove d3dx (mostly)

* fix moving wrong image

* move TextureFunction to module

* move FileLoader to ModfileLoader module

* move TextureClient to module

* spaces

* ifdef debug

* 1.6.0

* compress images to dxt5 (bc3_unorm) to use less memory

* remove unnecessary directxtex source code patch

* don't move unnecessarily

* only compress if mods in filesystem use up more than 400mb

* use std::future to prepare to multithread image loading
fails when using std::launch::async though, maybe something in the directxtex library is not thread safe

* remove d3dx sdk from workflows

* remove extern "C"

* catch exception when saving texture

* make loading async (call CoInitializeEx)

* support DXGI_FORMAT_BC1_UNORM (DXT1) compressed textures without warning

* don't warn for BC2 BC4 or BC5 either

* update README.md
This commit is contained in:
DubbleClick
2023-12-04 19:50:56 +01:00
committed by GitHub
parent b49428bafd
commit 9e593e83ee
24 changed files with 881 additions and 895 deletions
-52
View File
@@ -26,66 +26,14 @@ jobs:
with:
fetch-depth: 0
- name: Config
run: echo "DXSDK_DIR=DXSDK" >> $GITHUB_ENV
shell: bash
- name: Cache
id: cache
uses: actions/cache@v1
with:
path: DXSDK
key: DXSDK
- name: Cache create
if: steps.cache.outputs.cache-hit != 'true'
run: |
curl -L https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe -o _DX2010_.exe
7z x _DX2010_.exe DXSDK/Include
7z x _DX2010_.exe DXSDK/Lib/x86
shell: bash
- name: Echo cache
run: echo ${{ env.DXSDK_DIR }}
- name: List dxsdk files
run: |
cd DXSDK
ls
cd Include
ls
cd ../Lib/x86
ls
- name: Copy DirectX headers to project include directory
run: Copy-Item -Path "${{ env.DXSDK_DIR }}/Include/*" -Destination header/ -Recurse -Force
env:
DXSDK_DIR: ${{ env.DXSDK_DIR }}
shell: pwsh
- name: Ensure Lib directory exists and copy DirectX libraries
run: |
$libDir = "Lib/"
if (-Not (Test-Path -Path $libDir)) {
New-Item -ItemType Directory -Path $libDir
}
Copy-Item -Path "${{ env.DXSDK_DIR }}/Lib/x86/*" -Destination $libDir -Recurse -Force
env:
DXSDK_DIR: ${{ env.DXSDK_DIR }}
shell: pwsh
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.3.1
- name: Build CMake Files
run: cmake -S . -B build -A Win32
env:
DXSDK_DIR: ${{ env.DXSDK_DIR }}
- name: Build binaries
run: cmake --build build --config Release
env:
DXSDK_DIR: ${{ env.DXSDK_DIR }}
- name: Retrieve version
id: set_version
-53
View File
@@ -29,64 +29,11 @@ jobs:
with:
fetch-depth: 0
#https://stackoverflow.com/questions/61037714/how-to-install-an-old-version-of-the-direct-x-api-in-github-actions
- name: Config
run: echo "DXSDK_DIR=DXSDK" >> $GITHUB_ENV
shell: bash
- name: Cache
id: cache
uses: actions/cache@v1
with:
path: DXSDK
key: DXSDK
- name: Cache create
if: steps.cache.outputs.cache-hit != 'true'
run: |
curl -L https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe -o _DX2010_.exe
7z x _DX2010_.exe DXSDK/Include
7z x _DX2010_.exe DXSDK/Lib/x86
shell: bash
- name: Echo cache
run: echo ${{ env.DXSDK_DIR }}
- name: List dxsdk files
run: |
cd DXSDK
ls
cd Include
ls
cd ../Lib/x86
ls
- name: Copy DirectX headers to project include directory
run: Copy-Item -Path "${{ env.DXSDK_DIR }}/Include/*" -Destination header/ -Recurse -Force
env:
DXSDK_DIR: ${{ env.DXSDK_DIR }}
shell: pwsh
- name: Ensure Lib directory exists and copy DirectX libraries
run: |
$libDir = "Lib/"
if (-Not (Test-Path -Path $libDir)) {
New-Item -ItemType Directory -Path $libDir
}
Copy-Item -Path "${{ env.DXSDK_DIR }}/Lib/x86/*" -Destination $libDir -Recurse -Force
env:
DXSDK_DIR: ${{ env.DXSDK_DIR }}
shell: pwsh
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.3.1
- name: Build CMake Files
run: cmake -S . -B build -A Win32
env:
DXSDK_DIR: ${{ env.DXSDK_DIR }}
- name: Build binaries
run: cmake --build build --config Release
env:
DXSDK_DIR: ${{ env.DXSDK_DIR }}