-
Notifications
You must be signed in to change notification settings - Fork 0
/
globals.h
62 lines (54 loc) · 1.07 KB
/
globals.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* homm3-wallpaper, live HOMM3 wallpaper
* Copyright (C) 2022 i.Dark_Templar <darktemplar@dark-templar-archives.net>
*
* Subject to terms and condition provided in LICENSE.txt
*
*/
#pragma once
#include <stdint.h>
#include <array>
#include <string>
#include <vector>
enum class DefType: uint32_t
{
unknown = 0x00,
spell = 0x40,
sprite = 0x41,
creature = 0x42,
map = 0x43,
map_hero = 0x44,
terrain = 0x45,
cursor = 0x46,
interface = 0x47,
sprite_frame = 0x48,
battle_hero = 0x49
};
struct DefFrame {
std::string frameName;
uint32_t fullWidth = 0;
uint32_t fullHeight = 0;
uint32_t width = 0;
uint32_t height = 0;
uint32_t x = 0;
uint32_t y = 0;
std::vector<uint8_t> data;
};
struct DefGroup {
std::vector<DefFrame> frames;
};
struct Def {
DefType type = DefType::unknown;
uint32_t fullWidth = 0;
uint32_t fullHeight = 0;
std::array<uint8_t, 256 * 3> rawPalette;
std::vector<DefGroup> groups;
};
struct LodEntry
{
std::string name;
uint32_t offset = 0;
uint32_t full_size = 0;
uint32_t compressed_size = 0;
DefType filetype = DefType::unknown;
};