31 Commits

Author SHA1 Message Date
Luke Street 5af0cc06a0 Add "virtual" texture replacement API 2026-07-07 12:06:16 -06:00
Irastris 9087a409da Add API for checking if textures have an available replacement (#236)
* Add API for checking if textures have an available replacement

* Add test stubs for arm64

* GXIsTexObjReplaced -> has_replacement
2026-06-27 21:10:07 -06:00
Irastris f170e4d5ed Texture dumping fixes (#235)
* Fix early return in find_replacement overloads for texture dumping

* Make dumping reachable

* Fix TLUT decoding
2026-06-27 18:40:17 -06:00
Luke Street 265928601c Disable texture_replacements debug logs 2026-06-17 20:44:06 -06:00
Luke Street 3f1c26f2a6 Workaround CopyTex incremental ID leakage 2026-06-16 01:51:05 -06:00
Luke Street 0c1b0d6f55 texture_replacements: Fix TLUT hash calc 2026-06-16 00:13:04 -06:00
Luke Street 319f9bb546 Sort texture replacements by path (case-insensitive) 2026-06-15 22:38:27 -06:00
Luke Street 1ebb33f112 Validate texture replacement size before loading
Fixes TwilitRealm/dusklight#1226
2026-06-07 23:48:23 -06:00
Trevor Anderson 19479a53e4 Use mipmaps from .dds file if present (#198)
* Use mipmaps from .dds file if present

* Don't load mips from disk if they're present in the base file

* Keep mipmap count >= 1

* Remove unintended formatting changes

* Validate DDS mipmap handling

---------

Co-authored-by: Luke Street <luke@street.dev>
2026-06-06 08:12:44 -06:00
Luke Street b3afea435a Add ASTC DDS support to texture_replacements (#226) 2026-06-06 07:40:41 -06:00
Luke Street 558ba0a987 Add RG8 and BC1 PC texture formats 2026-05-30 10:03:34 -06:00
Luke Street c214a67adf Runtime texture replacement API 2026-05-30 10:01:40 -06:00
Irastris e254aca5ab Revert "Use mipmaps from .dds file if present (#194)" (#196)
This reverts commit 3249770927.
2026-05-17 13:31:35 -04:00
SrBananaMan 932c89a2f8 Add method to enable/disable textures and reload once changed. (#195) 2026-05-17 09:05:35 -04:00
Trevor Anderson 3249770927 Use mipmaps from .dds file if present (#194)
* Use mipmaps from .dds file if present

* Don't load mips from disk if they're present in the base file
2026-05-17 09:00:53 -04:00
Irastris d10368e2b3 Always display mips and use Linear filter mode on texture replacements (#192) 2026-05-15 16:03:27 -04:00
Pieter-Jan Briers 12316ea6a6 Fix texture replacement mips (#191)
Oops
2026-05-15 13:00:54 -04:00
Pieter-Jan Briers a41a0fb310 Don't crash loading unsupported texture replacements (#182)
So people stop getting crashes from BC textures on Android and iOS.
2026-05-14 15:40:45 -06:00
Luke Street 3643a369ad Split up configPath -> userPath/cachePath 2026-05-13 00:45:19 -06:00
Pieter-Jan Briers f7f3d52cfc Texture loading fixes (#170)
* Implement PNG & arb texture replacements

Fixes #119

For arb textures it's just making sure the file parsing can handle them. Idk if we need to do something special for it.

* Allow non-mipmapped textures to be replaced by mipmapped textures

Some of Henriko's textures (like the cuttable grass) rely on this.

The mipmap bool is no longer part of the runtime key.

* Make texture name the texture replacement key

Might as well? Helped me debug some stuff

* Oops that broke it bad

* libpng instead of spng

* I did it again

* Update libpng fetch

* Add zlib fetch

* Forgot to set the hash

* Add zlib redirect

* Add INCLUDE_DIR(S) to redirect

* Prefer shared for libpng

* Set CMAKE_FIND_PACKAGE_TARGETS_GLOBAL

---------

Co-authored-by: Luke Street <luke@street.dev>
2026-05-12 20:32:43 -06:00
Luke Street 83cdfb40f6 Fix Windows Unicode paths in texture_replacement 2026-05-11 22:06:14 -06:00
Pieter-Jan Briers 72ae17cc74 Log when texture replacements are active (#173)
* Log when texture replacements are active

Figured this might be prudent if we're going to be looking at crash logs

* Fix texture replacement mip load failure logging

Wouldn't log if any mips have already been loaded, which doesn't make much sense.
2026-05-11 07:19:12 -06:00
Julio Sanz 8444ecdc64 added support for symlinks in linux (#167) 2026-05-10 10:55:10 -06:00
Pieter-Jan Briers d61a1824ac Fix handling of Unicode paths on Windows (#166)
* Fix handling of Unicode paths on Windows

I love C++

* Reduce the amount of reinterpret_casts

* Okay? Don't commit the file CLion? Why not?

* Fix texture replacements too
2026-05-10 10:54:59 -06:00
Luke Street f4ea5f31fa Don't create texture_dumps unless enabled 2026-05-09 23:49:11 -06:00