modeco80
2c0237933c
................. fuck This really needs to be cleaned up before I'm willing to call it "good" but ultimately the API changes here needed to be done anyhow
50 lines
935 B
C++
50 lines
935 B
C++
//
|
|
// EuropaTools
|
|
//
|
|
// (C) 2021-2022 modeco80 <lily.modeco80@protonmail.ch>
|
|
//
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
//
|
|
|
|
#ifndef EUROPA_STRUCTS_YATF_H
|
|
#define EUROPA_STRUCTS_YATF_H
|
|
|
|
#include <europa/structs/ImHexAdapter.hpp>
|
|
#include <europa/util/FourCC.hpp>
|
|
#include <type_traits>
|
|
|
|
namespace europa::structs {
|
|
|
|
struct [[gnu::packed]] YatfHeader {
|
|
constexpr static u32 TextureFlag_Unknown = 0x1;
|
|
|
|
/**
|
|
* Texture does not have a palette
|
|
*/
|
|
constexpr static u32 TextureFlag_NoPalette = 0x30000;
|
|
|
|
/**
|
|
* Texture uses alpha.
|
|
*/
|
|
constexpr static u32 TextureFlag_UsesAlpha = 0x1000000;
|
|
|
|
constexpr static auto ValidMagic = util::FourCC<"YATF", std::endian::little>();
|
|
|
|
u32 magic;
|
|
|
|
u32 flags;
|
|
|
|
// Always zeroed.
|
|
u32 zero;
|
|
|
|
u32 height;
|
|
u32 width;
|
|
|
|
[[nodiscard]] constexpr bool IsValid() const {
|
|
return magic == ValidMagic;
|
|
}
|
|
};
|
|
|
|
} // namespace europa::structs
|
|
|
|
#endif // EUROPA_STRUCTS_YATF_H
|