24 Commits

Author SHA1 Message Date
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
Irastris bcbb2c8c4e Fix dumping TLUT textures (#146) 2026-04-30 00:24:40 -06:00
Irastris 8a2b80ecb1 Wildcard and sidecar mip support for texture replacement (#143)
* Implement wildcard parsing for texture and TLUT hashes

* Implement loading sidecar mips
2026-04-27 23:44:07 -06:00
Luke Street 5d420c9f73 Arbitrary mipmap detection & texture cleanup (#131) 2026-04-20 20:33:14 -06:00
Luke Street ac3611e518 Improve resolve_sampled_textures performance considerably & add more traces 2026-04-12 15:35:28 -06:00
Luke Street b1bf531884 FIFOify texture binding (#109)
* FIFOify texture binding

* Use __cntlzw helper

* Some cleanup

* Fix texture eviction & cleanup
2026-04-09 00:14:00 -06:00
Irastris 500d81b22b Implement texture dumping & replacement (#91) 2026-04-06 21:04:01 -06:00