Skip to content

Commit 5a25a58

Browse files
committed
add loose support for 2018 and 2019
1 parent 448ead5 commit 5a25a58

15 files changed

Lines changed: 67 additions & 57 deletions

classgen/hk_base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
'HK2014',
2626
'HK2015',
2727
'HK2016',
28-
'HK2017'
28+
'HK2017',
29+
'HK2018',
30+
'HK2019',
2931
]
3032
BASE.pointer_x86 = True
3133
BASE.pointer_x64 = True

include/hklib/hk_base.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Havok Format Library
2-
Copyright(C) 2016-2023 Lukas Cone
2+
Copyright(C) 2016-2025 Lukas Cone
33
44
This program is free software : you can redistribute it and / or modify
55
it under the terms of the GNU General Public License as published by
@@ -25,14 +25,14 @@
2525
#define DECLARE_HKCLASS(classname) \
2626
static constexpr JenHash GetHash() { return JenHash(#classname); }
2727

28-
MAKE_ENUM(ENUMSCOPE(hkToolset
29-
: uint8, hkToolset),
30-
EMEMBER(HKUNKVER), EMEMBER(HK500), EMEMBER(HK510), EMEMBER(HK550),
31-
EMEMBER(HK600), EMEMBER(HK610), EMEMBER(HK650), EMEMBER(HK660),
32-
EMEMBER(HK700), EMEMBER(HK710), EMEMBER(HK2010_1), EMEMBER(HK2010_2),
28+
MAKE_ENUM(ENUMSCOPE(hkToolset : uint8, hkToolset), EMEMBER(HKUNKVER),
29+
EMEMBER(HK500), EMEMBER(HK510), EMEMBER(HK550), EMEMBER(HK600),
30+
EMEMBER(HK610), EMEMBER(HK650), EMEMBER(HK660), EMEMBER(HK700),
31+
EMEMBER(HK710), EMEMBER(HK2010_1), EMEMBER(HK2010_2),
3332
EMEMBER(HK2011_1), EMEMBER(HK2011_2), EMEMBER(HK2011_3),
3433
EMEMBER(HK2012_1), EMEMBER(HK2012_2), EMEMBER(HK2013),
35-
EMEMBER(HK2014), EMEMBER(HK2015), EMEMBER(HK2016), EMEMBER(HK2017));
34+
EMEMBER(HK2014), EMEMBER(HK2015), EMEMBER(HK2016), EMEMBER(HK2017),
35+
EMEMBER(HK2018), EMEMBER(HK2019));
3636

3737
using XMLnode = pugi::xml_node;
3838

source/format_new.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ ReadFunc Read<CompileFourCC("SDKV")> =
6060
return HK2016;
6161
case 2017:
6262
return HK2017;
63+
case 2018:
64+
return HK2018;
65+
case 2019:
66+
return HK2019;
6367
default:
6468
return HKUNKVER;
6569
}

source/packfile/hk_base.inl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ enum Members {
77
_count_,
88
};
99
static const std::set<ClassData<_count_>> LAYOUTS {
10-
{{{{HK500, HK2017, 8, 0}}, 16}, {8, 0}, {0x0}},
11-
{{{{HK500, HK2017, 4, 0}}, 8}, {4, 0}, {0x0}}
10+
{{{{HK500, HK2019, 8, 0}}, 16}, {8, 0}, {0x0}},
11+
{{{{HK500, HK2019, 4, 0}}, 8}, {4, 0}, {0x0}}
1212
};
1313
struct Interface {
1414
Interface(char *data_, LayoutLookup layout_): data{data_}, layout{GetLayout(LAYOUTS, {layout_, {LookupFlag::Ptr}})}, lookup{layout_} {}
@@ -63,9 +63,9 @@ enum Members {
6363
};
6464
static const std::set<ClassData<_count_>> LAYOUTS {
6565
{{{{HK500, HK2015, 8, 0}}, 16}, {8, 10, -1, 0}, {0x5}},
66-
{{{{HK2016, HK2017, 8, 0}}, 24}, {16, 18, 8, 0}, {0x5}},
66+
{{{{HK2016, HK2019, 8, 0}}, 24}, {16, 18, 8, 0}, {0x5}},
6767
{{{{HK500, HK2015, 4, 0}}, 8}, {4, 6, -1, 0}, {0x5}},
68-
{{{{HK2016, HK2017, 4, 0}}, 12}, {8, 10, 4, 0}, {0x5}}
68+
{{{{HK2016, HK2019, 4, 0}}, 12}, {8, 10, 4, 0}, {0x5}}
6969
};
7070
struct Interface {
7171
Interface(char *data_, LayoutLookup layout_): data{data_}, layout{GetLayout(LAYOUTS, {layout_, {LookupFlag::Ptr}})}, lookup{layout_} {}

source/packfile/hk_rootlevelcontainer.inl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ enum Members {
99
};
1010
static const std::set<ClassData<_count_>> LAYOUTS {
1111
{{{{HK500, HK660, 8, 0}}, 32}, {8, 0, 16}, {0x0}},
12-
{{{{HK700, HK2017, 8, 0}}, 24}, {8, 0, 16}, {0x0}},
12+
{{{{HK700, HK2019, 8, 0}}, 24}, {8, 0, 16}, {0x0}},
1313
{{{{HK500, HK660, 4, 0}}, 16}, {4, 0, 8}, {0x0}},
14-
{{{{HK700, HK2017, 4, 0}}, 12}, {4, 0, 8}, {0x0}}
14+
{{{{HK700, HK2019, 4, 0}}, 12}, {4, 0, 8}, {0x0}}
1515
};
1616
struct Interface {
1717
Interface(char *data_, LayoutLookup layout_): data{data_}, layout{GetLayout(LAYOUTS, {layout_, {LookupFlag::Ptr}})}, lookup{layout_} {}
@@ -79,9 +79,9 @@ enum Members {
7979
};
8080
static const std::set<ClassData<_count_>> LAYOUTS {
8181
{{{{HK500, HK660, 8, 0}}, 12}, {8, 0}, {0x2}},
82-
{{{{HK700, HK2017, 8, 0}}, 16}, {8, 0}, {0x2}},
82+
{{{{HK700, HK2019, 8, 0}}, 16}, {8, 0}, {0x2}},
8383
{{{{HK500, HK660, 4, 0}}, 8}, {4, 0}, {0x2}},
84-
{{{{HK700, HK2017, 4, 0}}, 12}, {4, 0}, {0x2}}
84+
{{{{HK700, HK2019, 4, 0}}, 12}, {4, 0}, {0x2}}
8585
};
8686
struct Interface {
8787
Interface(char *data_, LayoutLookup layout_): data{data_}, layout{GetLayout(LAYOUTS, {layout_, {LookupFlag::Ptr}})}, lookup{layout_} {}

source/packfile/hka_animated_reference_frame.inl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ enum Members {
1010
static const std::set<ClassData<_count_>> LAYOUTS {
1111
{{{{HK500, HK2011_3, 8, 0}}, 16}, {0, -1}, {0x0}},
1212
{{{{HK2012_1, HK2015, 8, 0}}, 24}, {0, 16}, {0x0}},
13-
{{{{HK2016, HK2017, 8, 0}}, 32}, {0, 24}, {0x0}},
13+
{{{{HK2016, HK2019, 8, 0}}, 32}, {0, 24}, {0x0}},
1414
{{{{HK500, HK2011_3, 4, 0}}, 8}, {0, -1}, {0x0}},
1515
{{{{HK2012_1, HK2015, 4, 0}}, 12}, {0, 8}, {0x0}},
16-
{{{{HK2016, HK2017, 4, 0}}, 16}, {0, 12}, {0x0}},
16+
{{{{HK2016, HK2019, 4, 0}}, 16}, {0, 12}, {0x0}},
1717
{{{{HK500, HK2011_3, 8, 1}}, 16}, {0, -1}, {0x0}},
1818
{{{{HK2012_1, HK2015, 8, 1}}, 16}, {0, 12}, {0x0}},
19-
{{{{HK2016, HK2017, 8, 1}}, 24}, {0, 20}, {0x0}},
19+
{{{{HK2016, HK2019, 8, 1}}, 24}, {0, 20}, {0x0}},
2020
{{{{HK500, HK2011_3, 4, 1}}, 8}, {0, -1}, {0x0}},
2121
{{{{HK2012_1, HK2015, 4, 1}}, 12}, {0, 8}, {0x0}},
22-
{{{{HK2016, HK2017, 4, 1}}, 16}, {0, 12}, {0x0}}
22+
{{{{HK2016, HK2019, 4, 1}}, 16}, {0, 12}, {0x0}}
2323
};
2424
struct Interface {
2525
Interface(char *data_, LayoutLookup layout_): data{data_}, layout{GetLayout(LAYOUTS, {layout_, {LookupFlag::Ptr ,LookupFlag::Padding}})}, lookup{layout_} {}

source/packfile/hka_animated_reference_frame_default.inl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ enum Members {
1313
};
1414
static const std::set<ClassData<_count_>> LAYOUTS {
1515
{{{{HK500, HK2011_3, 8, 0}}, 80}, {0, 48, 32, 64, 56, 16}, {0x88}},
16-
{{{{HK2012_1, HK2017, 8, 0}}, 96}, {0, 64, 48, 80, 72, 32}, {0x88}},
17-
{{{{HK500, HK2017, 4, 0}}, 64}, {0, 48, 32, 56, 52, 16}, {0x88}},
16+
{{{{HK2012_1, HK2019, 8, 0}}, 96}, {0, 64, 48, 80, 72, 32}, {0x88}},
17+
{{{{HK500, HK2019, 4, 0}}, 64}, {0, 48, 32, 56, 52, 16}, {0x88}},
1818
{{{{HK500, HK2015, 8, 1}}, 80}, {0, 48, 32, 64, 56, 16}, {0x88}},
19-
{{{{HK2016, HK2017, 8, 1}}, 96}, {0, 64, 48, 80, 72, 32}, {0x88}},
20-
{{{{HK500, HK2017, 4, 1}}, 64}, {0, 48, 32, 56, 52, 16}, {0x88}}
19+
{{{{HK2016, HK2019, 8, 1}}, 96}, {0, 64, 48, 80, 72, 32}, {0x88}},
20+
{{{{HK500, HK2019, 4, 1}}, 64}, {0, 48, 32, 56, 52, 16}, {0x88}}
2121
};
2222
struct Interface {
2323
Interface(char *data_, LayoutLookup layout_): data{data_}, layout{GetLayout(LAYOUTS, {layout_, {LookupFlag::Ptr ,LookupFlag::Padding}})}, lookup{layout_} {}

source/packfile/hka_animation.inl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ enum Members {
88
_count_,
99
};
1010
static const std::set<ClassData<_count_>> LAYOUTS {
11-
{{{{HK500, HK2017, 8, 0}}, 16}, {8, 0}, {0x8}},
12-
{{{{HK500, HK2017, 4, 0}}, 8}, {4, 0}, {0x8}}
11+
{{{{HK500, HK2019, 8, 0}}, 16}, {8, 0}, {0x8}},
12+
{{{{HK500, HK2019, 4, 0}}, 8}, {4, 0}, {0x8}}
1313
};
1414
struct Interface {
1515
Interface(char *data_, LayoutLookup layout_): data{data_}, layout{GetLayout(LAYOUTS, {layout_, {LookupFlag::Ptr}})}, lookup{layout_} {}
@@ -50,9 +50,9 @@ enum Members {
5050
_count_,
5151
};
5252
static const std::set<ClassData<_count_>> LAYOUTS {
53-
{{{{HK500, HK2017, 8, 0}}, 24}, {8, 0, 16}, {0x20}},
53+
{{{{HK500, HK2019, 8, 0}}, 24}, {8, 0, 16}, {0x20}},
5454
{{{{HK500, HK660, 4, 0}}, 12}, {4, 0, 8}, {0x20}},
55-
{{{{HK700, HK2017, 4, 0}}, 16}, {4, 0, 8}, {0x20}}
55+
{{{{HK700, HK2019, 4, 0}}, 16}, {4, 0, 8}, {0x20}}
5656
};
5757
struct Interface {
5858
Interface(char *data_, LayoutLookup layout_): data{data_}, layout{GetLayout(LAYOUTS, {layout_, {LookupFlag::Ptr}})}, lookup{layout_} {}
@@ -114,18 +114,18 @@ enum Members {
114114
static const std::set<ClassData<_count_>> LAYOUTS {
115115
{{{{HK500, HK510, 8, 0}}, 56}, {16, 40, 0, 20, 32, 48, -1, 24}, {0x8882}},
116116
{{{{HK550, HK2015, 8, 0}}, 56}, {16, 40, 0, 20, 32, 48, 28, 24}, {0xa882}},
117-
{{{{HK2016, HK2017, 8, 0}}, 64}, {24, 48, 0, 28, 40, 56, 36, 32}, {0xa882}},
117+
{{{{HK2016, HK2019, 8, 0}}, 64}, {24, 48, 0, 28, 40, 56, 36, 32}, {0xa882}},
118118
{{{{HK500, HK510, 4, 0}}, 32}, {8, 24, 0, 12, 20, 28, -1, 16}, {0x8882}},
119119
{{{{HK550, HK660, 4, 0}}, 36}, {8, 28, 0, 12, 24, 32, 20, 16}, {0xa882}},
120120
{{{{HK700, HK2015, 4, 0}}, 40}, {8, 28, 0, 12, 24, 32, 20, 16}, {0xa882}},
121-
{{{{HK2016, HK2017, 4, 0}}, 44}, {12, 32, 0, 16, 28, 36, 24, 20}, {0xa882}},
121+
{{{{HK2016, HK2019, 4, 0}}, 44}, {12, 32, 0, 16, 28, 36, 24, 20}, {0xa882}},
122122
{{{{HK500, HK510, 8, 1}}, 48}, {12, 32, 0, 16, 24, 40, -1, 20}, {0x8882}},
123123
{{{{HK550, HK2015, 8, 1}}, 56}, {12, 40, 0, 16, 32, 48, 24, 20}, {0xa882}},
124-
{{{{HK2016, HK2017, 8, 1}}, 64}, {20, 48, 0, 24, 40, 56, 32, 28}, {0xa882}},
124+
{{{{HK2016, HK2019, 8, 1}}, 64}, {20, 48, 0, 24, 40, 56, 32, 28}, {0xa882}},
125125
{{{{HK500, HK510, 4, 1}}, 32}, {8, 24, 0, 12, 20, 28, -1, 16}, {0x8882}},
126126
{{{{HK550, HK660, 4, 1}}, 36}, {8, 28, 0, 12, 24, 32, 20, 16}, {0xa882}},
127127
{{{{HK700, HK2015, 4, 1}}, 40}, {8, 28, 0, 12, 24, 32, 20, 16}, {0xa882}},
128-
{{{{HK2016, HK2017, 4, 1}}, 44}, {12, 32, 0, 16, 28, 36, 24, 20}, {0xa882}}
128+
{{{{HK2016, HK2019, 4, 1}}, 44}, {12, 32, 0, 16, 28, 36, 24, 20}, {0xa882}}
129129
};
130130
struct Interface {
131131
Interface(char *data_, LayoutLookup layout_): data{data_}, layout{GetLayout(LAYOUTS, {layout_, {LookupFlag::Ptr ,LookupFlag::Padding}})}, lookup{layout_} {}

source/packfile/hka_animation_binding.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ static const std::set<ClassData<_count_>> LAYOUTS {
2020
{{{{HK600, HK660, 8, 0}}, 48}, {8, -1, 44, 32, 40, -1, 24, -1, 0, 16}, {0x2200, 0x0}},
2121
{{{{HK700, HK2011_3, 8, 0}}, 72}, {24, 0, 64, 48, 56, -1, 40, -1, 16, 32}, {0x2200, 0x0}},
2222
{{{{HK2012_1, HK2015, 8, 0}}, 88}, {24, 0, 80, 48, 56, 72, 40, 64, 16, 32}, {0x2a00, 0x0}},
23-
{{{{HK2016, HK2017, 8, 0}}, 96}, {32, 0, 88, 56, 64, 80, 48, 72, 24, 40}, {0x2a00, 0x0}},
23+
{{{{HK2016, HK2019, 8, 0}}, 96}, {32, 0, 88, 56, 64, 80, 48, 72, 24, 40}, {0x2a00, 0x0}},
2424
{{{{HK500, HK510, 4, 0}}, 16}, {0, -1, 12, -1, -1, -1, 8, -1, -1, 4}, {0x2000, 0x0}},
2525
{{{{HK550, HK550, 4, 0}}, 24}, {0, -1, 20, 12, 16, -1, 8, -1, -1, 4}, {0x2200, 0x0}},
2626
{{{{HK600, HK660, 4, 0}}, 28}, {4, -1, 24, 16, 20, -1, 12, -1, 0, 8}, {0x2200, 0x0}},
2727
{{{{HK700, HK2011_3, 4, 0}}, 44}, {12, 0, 40, 28, 32, -1, 20, -1, 8, 16}, {0x2200, 0x0}},
2828
{{{{HK2012_1, HK2015, 4, 0}}, 56}, {12, 0, 52, 28, 32, 44, 20, 40, 8, 16}, {0x2a00, 0x0}},
29-
{{{{HK2016, HK2017, 4, 0}}, 60}, {16, 0, 56, 32, 36, 48, 24, 44, 12, 20}, {0x2a00, 0x0}}
29+
{{{{HK2016, HK2019, 4, 0}}, 60}, {16, 0, 56, 32, 36, 48, 24, 44, 12, 20}, {0x2a00, 0x0}}
3030
};
3131
struct Interface {
3232
Interface(char *data_, LayoutLookup layout_): data{data_}, layout{GetLayout(LAYOUTS, {layout_, {LookupFlag::Ptr}})}, lookup{layout_} {}

source/packfile/hka_animation_container.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ enum Members {
1818
static const std::set<ClassData<_count_>> LAYOUTS {
1919
{{{{HK500, HK660, 8, 0}}, 76}, {16, 48, -1, 32, 24, 56, 40, 8, 72, 0, 64}, {0xaa00, 0x2}},
2020
{{{{HK700, HK2015, 8, 0}}, 96}, {32, 64, 0, 48, 40, 72, 56, 24, 88, 16, 80}, {0xaa00, 0x2}},
21-
{{{{HK2016, HK2017, 8, 0}}, 104}, {40, 72, 0, 56, 48, 80, 64, 32, 96, 24, 88}, {0xaa00, 0x2}},
21+
{{{{HK2016, HK2019, 8, 0}}, 104}, {40, 72, 0, 56, 48, 80, 64, 32, 96, 24, 88}, {0xaa00, 0x2}},
2222
{{{{HK500, HK660, 4, 0}}, 40}, {8, 24, -1, 16, 12, 28, 20, 4, 36, 0, 32}, {0xaa00, 0x2}},
2323
{{{{HK700, HK2015, 4, 0}}, 68}, {20, 44, 0, 32, 24, 48, 36, 12, 60, 8, 56}, {0xaa00, 0x2}},
24-
{{{{HK2016, HK2017, 4, 0}}, 72}, {24, 48, 0, 36, 28, 52, 40, 16, 64, 12, 60}, {0xaa00, 0x2}}
24+
{{{{HK2016, HK2019, 4, 0}}, 72}, {24, 48, 0, 36, 28, 52, 40, 16, 64, 12, 60}, {0xaa00, 0x2}}
2525
};
2626
struct Interface {
2727
Interface(char *data_, LayoutLookup layout_): data{data_}, layout{GetLayout(LAYOUTS, {layout_, {LookupFlag::Ptr}})}, lookup{layout_} {}

0 commit comments

Comments
 (0)