2022-09-05 04:24:50 -04:00
|
|
|
//
|
|
|
|
// EuropaTools
|
|
|
|
//
|
2025-01-07 14:17:50 -05:00
|
|
|
// (C) 2021-2025 modeco80 <lily.modeco80@protonmail.ch>
|
2022-09-05 04:24:50 -04:00
|
|
|
//
|
2025-01-07 18:02:27 -05:00
|
|
|
// SPDX-License-Identifier: MIT
|
2022-09-05 04:24:50 -04:00
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef EUROPA_STRUCTS_YATF_H
|
|
|
|
#define EUROPA_STRUCTS_YATF_H
|
|
|
|
|
2022-09-21 03:59:16 -04:00
|
|
|
#include <europa/structs/ImHexAdapter.hpp>
|
|
|
|
#include <europa/util/FourCC.hpp>
|
2022-09-05 04:24:50 -04:00
|
|
|
#include <type_traits>
|
|
|
|
|
|
|
|
namespace europa::structs {
|
|
|
|
|
|
|
|
struct [[gnu::packed]] YatfHeader {
|
2025-01-16 01:12:53 -05:00
|
|
|
enum class TextureFormat : u8 {
|
|
|
|
kTextureFormat8Bpp = 0,
|
|
|
|
kTextureFormatUnknown = 1, // possibly 16bpp?
|
|
|
|
kTextureFormat24Bpp = 2,
|
|
|
|
kTextureFormat32Bpp = 3
|
|
|
|
};
|
2022-09-05 04:24:50 -04:00
|
|
|
|
2025-01-15 23:40:41 -05:00
|
|
|
constexpr static auto ValidMagic = util::FourCC<"YATF", std::endian::big>();
|
2022-09-05 04:24:50 -04:00
|
|
|
|
|
|
|
u32 magic;
|
|
|
|
|
2025-01-16 01:12:53 -05:00
|
|
|
u16 unkThing; // always 0x1
|
|
|
|
|
|
|
|
TextureFormat format;
|
|
|
|
|
|
|
|
u8 unkThing2; // flags?
|
2022-09-05 04:24:50 -04:00
|
|
|
|
|
|
|
// Always zeroed.
|
|
|
|
u32 zero;
|
|
|
|
|
|
|
|
u32 height;
|
|
|
|
u32 width;
|
|
|
|
|
|
|
|
[[nodiscard]] constexpr bool IsValid() const {
|
|
|
|
return magic == ValidMagic;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2022-09-05 20:59:46 -04:00
|
|
|
} // namespace europa::structs
|
2022-09-05 04:24:50 -04:00
|
|
|
|
|
|
|
#endif // EUROPA_STRUCTS_YATF_H
|