Files
aurora/lib/gfx/dds_io.hpp
T
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

18 lines
644 B
C++

#pragma once
#include "common.hpp"
#include "texture_convert.hpp"
#include <filesystem>
#include <optional>
namespace aurora::gfx::dds {
std::optional<ConvertedTexture> parse_dds_bytes(ArrayRef<uint8_t> bytes) noexcept;
std::optional<ConvertedTexture> load_dds_file(const std::filesystem::path& path) noexcept;
ByteBuffer encode_rgba8_dds(uint32_t width, uint32_t height, ArrayRef<uint8_t> pixels);
bool write_rgba8_dds(const std::filesystem::path& path, uint32_t width, uint32_t height, ArrayRef<u8> pixels) noexcept;
std::optional<ByteBuffer> read_binary_file(const std::filesystem::path& path) noexcept;
} // namespace aurora::gfx::dds