Add definitions of constants
MODIFY
CMakeLists.txt
CMakeLists.txt
@@ -112,6 +112,8 @@ add_library(lcf
src/generated/lsd_savevehiclelocation.cpp
src/generated/rpg_chipset.cpp
src/generated/rpg_enums.cpp
+ src/generated/rpg_savepartylocation.cpp
+ src/generated/rpg_state.cpp
src/generated/rpg_system.cpp
)

MODIFY
Makefile.am
Makefile.am
@@ -111,6 +111,8 @@ liblcf_la_SOURCES = \
src/generated/lsd_savevehiclelocation.cpp \
src/generated/rpg_chipset.cpp \
src/generated/rpg_enums.cpp \
+ src/generated/rpg_savepartylocation.cpp \
+ src/generated/rpg_state.cpp \
src/generated/rpg_system.cpp
pkginclude_HEADERS = \
src/command_codes.h \

MODIFY
builds/vs2015/liblcf.vcxproj
builds/vs2015/liblcf.vcxproj
<ClCompile Include="..\..\src\generated\lsd_savetitle.cpp" />
<ClCompile Include="..\..\src\generated\lsd_savevehiclelocation.cpp" />
<ClCompile Include="..\..\src\generated\rpg_chipset.cpp" />
+ <ClCompile Include="..\..\src\generated\rpg_savepartylocation.cpp" />
+ <ClCompile Include="..\..\src\generated\rpg_state.cpp" />
<ClCompile Include="..\..\src\generated\rpg_system.cpp" />
</ItemGroup>
<ItemGroup>

MODIFY
generator/generate.py
generator/generate.py
@@ -339,7 +339,7 @@ def generate():
type=filetype
))
- if needs_ctor(struct.name):
+ if needs_ctor(struct.name) or struct.name in constants:
filepath = os.path.join(tmp_dir, 'rpg_%s.cpp' % filename)
with open(filepath, 'w') as f:
f.write(rpg_source_tmpl.render(

MODIFY
generator/templates/rpg_source.tmpl
generator/templates/rpg_source.tmpl
{% include "copyright.tmpl" %}
// Headers
#include "rpg_{{ filename }}.h"
-
+{% if struct_name in constants -%}
+{%- for name, type, value, comment in constants[struct_name] %}
+constexpr {{ type }} RPG::{{ struct_name }}::{{ name }};
+{%- endfor %}
+{%- endif %}
+{% if struct_name is needs_ctor -%}
/**
* Constructor.
*/
RPG::{{ struct_name }}::{{ struct_name }}() {
Init();
}
+{%- endif %}

ADD
src/generated/rpg_savepartylocation.cpp
src/generated/rpg_savepartylocation.cpp
Binary files /dev/null and b/src/generated/rpg_savepartylocation.cpp differ

ADD
src/generated/rpg_state.cpp
src/generated/rpg_state.cpp
Binary files /dev/null and b/src/generated/rpg_state.cpp differ

Add definitions of constants