diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e6bcc4f --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "third_party/libpixel"] + path = third_party/libpixel + url = https://github.com/modeco80/libpixel.git diff --git a/hexpat/pak.hexpat b/hexpat/pak.hexpat index 35995ca..04f09d2 100644 --- a/hexpat/pak.hexpat +++ b/hexpat/pak.hexpat @@ -1,3 +1,10 @@ +// +// EuropaTools +// +// (C) 2021-2022 modeco80 +// +// SPDX-License-Identifier: LGPL-3.0-or-later +// #pragma endian little diff --git a/hexpat/yatf.hexpat b/hexpat/yatf.hexpat new file mode 100644 index 0000000..fab1504 --- /dev/null +++ b/hexpat/yatf.hexpat @@ -0,0 +1,59 @@ +// +// EuropaTools +// +// (C) 2021-2022 modeco80 +// +// SPDX-License-Identifier: LGPL-3.0-or-later +// + +// YATF pattern + +#include +#pragma endian little + +namespace europa { + + // YATF header. + struct TexHeader { + char magic[4]; // 'YATF' + + // Flag descriptions: + // + // 0x1 - unknown? (always pressent) + // 0x30000 - direct color (no palette) + // 0x1000000 - uses alpha + u32 flags; + + // Always zeroed. + u32 zero; + + // these are swapped backwards + // for some reason. + u32 height; + u32 width; + }; + + // A YATF file. + struct TexFile { + TexHeader header; + + if(header.flags & 0x1000000) { + std::print("[YATF] this YATF uses alpha?"); + } + + if(!(header.flags & 0x30000)) { + std::print("[YATF] this YATF is palettized"); + + u32 palette[256]; + u8 bitmap[header.width * header.height]; + } else { + std::print("[YATF] this YATF is direct color"); + + u32 bitmap[header.width * header.height]; + } + }; + +} // namespace europa + + +europa::TexFile tex @ 0x0; diff --git a/third_party/libpixel b/third_party/libpixel new file mode 160000 index 0000000..e7be111 --- /dev/null +++ b/third_party/libpixel @@ -0,0 +1 @@ +Subproject commit e7be1115575317e9b80c5c1be04fa2e950badb97