Skip to content

Commit ecb34cb

Browse files
committed
Flags: Add generated code
1 parent 0206c1a commit ecb34cb

20 files changed

+349
-9
lines changed

CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ set(LCF_SOURCES
4141
src/lmu_movecommand.cpp
4242
src/lmu_reader.cpp
4343
src/log.h
44-
src/lsd_reader.cpp
4544
src/log_handler.cpp
45+
src/lsd_reader.cpp
4646
src/reader_flags.cpp
4747
src/reader_lcf.cpp
4848
src/reader_struct.h
@@ -54,6 +54,8 @@ set(LCF_SOURCES
5454
src/saveopt.cpp
5555
src/writer_lcf.cpp
5656
src/writer_xml.cpp
57+
src/generated/fwd_flags_impl.h
58+
src/generated/fwd_flags_instance.h
5759
src/generated/fwd_struct_impl.h
5860
src/generated/ldb_actor.cpp
5961
src/generated/ldb_animation.cpp
@@ -109,10 +111,13 @@ set(LCF_SOURCES
109111
src/generated/lsd_saveeasyrpgwindow.cpp
110112
src/generated/lsd_saveeasyrpgwindow_flags.h
111113
src/generated/lsd_saveeventexecframe.cpp
114+
src/generated/lsd_saveeventexecframe_easyrpg_runtime_flags.h
112115
src/generated/lsd_saveeventexecstate.cpp
116+
src/generated/lsd_saveeventexecstate_easyrpg_runtime_flags.h
113117
src/generated/lsd_saveinventory.cpp
114118
src/generated/lsd_savemapevent.cpp
115119
src/generated/lsd_savemapeventbase.cpp
120+
src/generated/lsd_savemapeventbase_easyrpg_runtime_flags.h
116121
src/generated/lsd_savemapinfo.cpp
117122
src/generated/lsd_savepanorama.cpp
118123
src/generated/lsd_savepartylocation.cpp
@@ -205,8 +210,8 @@ set(LCF_HEADERS
205210
src/lcf/ldb/reader.h
206211
src/lcf/lmt/reader.h
207212
src/lcf/lmu/reader.h
208-
src/lcf/lsd/reader.h
209213
src/lcf/log_handler.h
214+
src/lcf/lsd/reader.h
210215
src/lcf/reader_lcf.h
211216
src/lcf/reader_util.h
212217
src/lcf/reader_xml.h

Makefile.am

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ liblcf_la_SOURCES = \
5858
src/lmu_movecommand.cpp \
5959
src/lmu_reader.cpp \
6060
src/log.h \
61-
src/lsd_reader.cpp \
6261
src/log_handler.cpp \
62+
src/lsd_reader.cpp \
6363
src/reader_flags.cpp \
6464
src/reader_lcf.cpp \
6565
src/reader_struct.h \
@@ -71,6 +71,8 @@ liblcf_la_SOURCES = \
7171
src/saveopt.cpp \
7272
src/writer_lcf.cpp \
7373
src/writer_xml.cpp \
74+
src/generated/fwd_flags_impl.h \
75+
src/generated/fwd_flags_instance.h \
7476
src/generated/fwd_struct_impl.h \
7577
src/generated/ldb_actor.cpp \
7678
src/generated/ldb_animation.cpp \
@@ -126,10 +128,13 @@ liblcf_la_SOURCES = \
126128
src/generated/lsd_saveeasyrpgwindow.cpp \
127129
src/generated/lsd_saveeasyrpgwindow_flags.h \
128130
src/generated/lsd_saveeventexecframe.cpp \
131+
src/generated/lsd_saveeventexecframe_easyrpg_runtime_flags.h \
129132
src/generated/lsd_saveeventexecstate.cpp \
133+
src/generated/lsd_saveeventexecstate_easyrpg_runtime_flags.h \
130134
src/generated/lsd_saveinventory.cpp \
131135
src/generated/lsd_savemapevent.cpp \
132136
src/generated/lsd_savemapeventbase.cpp \
137+
src/generated/lsd_savemapeventbase_easyrpg_runtime_flags.h \
133138
src/generated/lsd_savemapinfo.cpp \
134139
src/generated/lsd_savepanorama.cpp \
135140
src/generated/lsd_savepartylocation.cpp \

src/generated/fwd_flags_impl.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,17 @@
1313
#include "lcf/rpg/terrain.h"
1414
#include "lcf/rpg/eventpagecondition.h"
1515
#include "lcf/rpg/savepicture.h"
16+
#include "lcf/rpg/saveeventexecframe.h"
17+
#include "lcf/rpg/saveeventexecstate.h"
18+
#include "lcf/rpg/savemapeventbase.h"
1619
#include "lcf/rpg/saveeasyrpgwindow.h"
1720
#include "lcf/rpg/saveeasyrpgtext.h"
1821
template <> struct lcf::TypeCategory<lcf::rpg::TroopPageCondition::TroopPageCondition_Flags> { static const lcf::Category::Index value = lcf::Category::Flags; };
1922
template <> struct lcf::TypeCategory<lcf::rpg::Terrain::Terrain_Flags> { static const lcf::Category::Index value = lcf::Category::Flags; };
2023
template <> struct lcf::TypeCategory<lcf::rpg::EventPageCondition::EventPageCondition_Flags> { static const lcf::Category::Index value = lcf::Category::Flags; };
2124
template <> struct lcf::TypeCategory<lcf::rpg::SavePicture::SavePicture_Flags> { static const lcf::Category::Index value = lcf::Category::Flags; };
25+
template <> struct lcf::TypeCategory<lcf::rpg::SaveEventExecFrame::EasyRpgFrameRuntime_Flags> { static const lcf::Category::Index value = lcf::Category::Flags; };
26+
template <> struct lcf::TypeCategory<lcf::rpg::SaveEventExecState::EasyRpgStateRuntime_Flags> { static const lcf::Category::Index value = lcf::Category::Flags; };
27+
template <> struct lcf::TypeCategory<lcf::rpg::SaveMapEventBase::EasyRpgEventRuntime_Flags> { static const lcf::Category::Index value = lcf::Category::Flags; };
2228
template <> struct lcf::TypeCategory<lcf::rpg::SaveEasyRpgWindow::SaveEasyRpgWindow_Flags> { static const lcf::Category::Index value = lcf::Category::Flags; };
2329
template <> struct lcf::TypeCategory<lcf::rpg::SaveEasyRpgText::SaveEasyRpgText_Flags> { static const lcf::Category::Index value = lcf::Category::Flags; };

src/generated/fwd_flags_instance.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
#include "ldb_terrain_special_flags.h"
1414
#include "lmu_eventpagecondition_flags.h"
1515
#include "lsd_savepicture_flags.h"
16+
#include "lsd_saveeventexecframe_easyrpg_runtime_flags.h"
17+
#include "lsd_saveeventexecstate_easyrpg_runtime_flags.h"
18+
#include "lsd_savemapeventbase_easyrpg_runtime_flags.h"
1619
#include "lsd_saveeasyrpgwindow_flags.h"
1720
#include "lsd_saveeasyrpgtext_flags.h"
1821

@@ -21,6 +24,9 @@ template class Flags<rpg::TroopPageCondition::TroopPageCondition_Flags>;
2124
template class Flags<rpg::Terrain::Terrain_Flags>;
2225
template class Flags<rpg::EventPageCondition::EventPageCondition_Flags>;
2326
template class Flags<rpg::SavePicture::SavePicture_Flags>;
27+
template class Flags<rpg::SaveEventExecFrame::EasyRpgFrameRuntime_Flags>;
28+
template class Flags<rpg::SaveEventExecState::EasyRpgStateRuntime_Flags>;
29+
template class Flags<rpg::SaveMapEventBase::EasyRpgEventRuntime_Flags>;
2430
template class Flags<rpg::SaveEasyRpgWindow::SaveEasyRpgWindow_Flags>;
2531
template class Flags<rpg::SaveEasyRpgText::SaveEasyRpgText_Flags>;
2632
}

src/generated/lcf/lsd/chunks.h

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,8 @@ namespace LSD_Reader {
414414
easyrpg_clone_map_id = 0xCA,
415415
/** The original event id of a cloned event */
416416
easyrpg_clone_event_id = 0xCB,
417+
/** Runtime changes to the engine config */
418+
easyrpg_runtime_flags = 0xCC,
417419
/** */
418420
boarding = 0x65,
419421
/** */
@@ -538,6 +540,8 @@ namespace LSD_Reader {
538540
easyrpg_clone_map_id = 0xCA,
539541
/** The original event id of a cloned event */
540542
easyrpg_clone_event_id = 0xCB,
543+
/** Runtime changes to the engine config */
544+
easyrpg_runtime_flags = 0xCC,
541545
/** Which vehicle */
542546
vehicle = 0x65,
543547
/** From 0 to 255 - In flying vehicles; remaining distance to ascend */
@@ -701,7 +705,9 @@ namespace LSD_Reader {
701705
/** Amount of loop info groups */
702706
maniac_loop_info_size = 0x11,
703707
/** One group of (Current loop count, end loop value) for each identation */
704-
maniac_loop_info = 0x12
708+
maniac_loop_info = 0x12,
709+
/** Runtime changes to the engine config */
710+
easyrpg_runtime_flags = 0xCC
705711
};
706712
};
707713
struct ChunkSaveEventExecState {
@@ -755,7 +761,9 @@ namespace LSD_Reader {
755761
/** Preserved string data of an event */
756762
easyrpg_string = 0xCA,
757763
/** Preserved int parameter of an event */
758-
easyrpg_parameters = 0xCB
764+
easyrpg_parameters = 0xCB,
765+
/** Runtime changes to the engine config */
766+
easyrpg_runtime_flags = 0xCC
759767
};
760768
};
761769
struct ChunkSaveMapEventBase {
@@ -843,7 +851,9 @@ namespace LSD_Reader {
843851
/** The original map id of a cloned event */
844852
easyrpg_clone_map_id = 0xCA,
845853
/** The original event id of a cloned event */
846-
easyrpg_clone_event_id = 0xCB
854+
easyrpg_clone_event_id = 0xCB,
855+
/** Runtime changes to the engine config */
856+
easyrpg_runtime_flags = 0xCC
847857
};
848858
};
849859
struct ChunkSaveMapEvent {
@@ -932,6 +942,8 @@ namespace LSD_Reader {
932942
easyrpg_clone_map_id = 0xCA,
933943
/** The original event id of a cloned event */
934944
easyrpg_clone_event_id = 0xCB,
945+
/** Runtime changes to the engine config */
946+
easyrpg_runtime_flags = 0xCC,
935947
/** If true; this event is waiting for foreground execution. */
936948
waiting_execution = 0x65,
937949
/** Index of custom move route */

src/generated/lcf/rpg/saveeventexecframe.h

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#define LCF_RPG_SAVEEVENTEXECFRAME_H
1414

1515
// Headers
16+
#include <array>
1617
#include <stdint.h>
1718
#include <vector>
1819
#include "lcf/rpg/eventcommand.h"
@@ -38,8 +39,28 @@ namespace rpg {
3839
int32_t maniac_event_page_id = 0;
3940
int32_t maniac_loop_info_size = 0;
4041
std::vector<int32_t> maniac_loop_info;
42+
struct EasyRpgFrameRuntime_Flags {
43+
union {
44+
struct {
45+
bool reserved_1;
46+
};
47+
std::array<bool, 1> flags;
48+
};
49+
EasyRpgFrameRuntime_Flags() noexcept
50+
{}
51+
} easyrpg_runtime_flags;
4152
};
4253

54+
inline bool operator==(const SaveEventExecFrame::EasyRpgFrameRuntime_Flags& l, const SaveEventExecFrame::EasyRpgFrameRuntime_Flags& r) {
55+
return l.flags == r.flags;
56+
}
57+
58+
inline bool operator!=(const SaveEventExecFrame::EasyRpgFrameRuntime_Flags& l, const SaveEventExecFrame::EasyRpgFrameRuntime_Flags& r) {
59+
return !(l == r);
60+
}
61+
62+
std::ostream& operator<<(std::ostream& os, const SaveEventExecFrame::EasyRpgFrameRuntime_Flags& obj);
63+
4364
inline bool operator==(const SaveEventExecFrame& l, const SaveEventExecFrame& r) {
4465
return l.commands == r.commands
4566
&& l.current_command == r.current_command
@@ -50,7 +71,8 @@ namespace rpg {
5071
&& l.maniac_event_id == r.maniac_event_id
5172
&& l.maniac_event_page_id == r.maniac_event_page_id
5273
&& l.maniac_loop_info_size == r.maniac_loop_info_size
53-
&& l.maniac_loop_info == r.maniac_loop_info;
74+
&& l.maniac_loop_info == r.maniac_loop_info
75+
&& l.easyrpg_runtime_flags == r.easyrpg_runtime_flags;
5476
}
5577

5678
inline bool operator!=(const SaveEventExecFrame& l, const SaveEventExecFrame& r) {

src/generated/lcf/rpg/saveeventexecstate.h

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#define LCF_RPG_SAVEEVENTEXECSTATE_H
1414

1515
// Headers
16+
#include <array>
1617
#include <stdint.h>
1718
#include <vector>
1819
#include "lcf/dbstring.h"
@@ -53,8 +54,47 @@ namespace rpg {
5354
bool easyrpg_active = false;
5455
DBString easyrpg_string;
5556
std::vector<int32_t> easyrpg_parameters;
57+
struct EasyRpgStateRuntime_Flags {
58+
union {
59+
struct {
60+
bool conf_override_active;
61+
bool reserved_1;
62+
bool reserved_2;
63+
bool reserved_3;
64+
bool patch_destiny_on;
65+
bool patch_destiny_off;
66+
bool patch_dynrpg_on;
67+
bool patch_dynrpg_off;
68+
bool patch_maniac_on;
69+
bool patch_maniac_of;
70+
bool patch_common_this_event_on;
71+
bool patch_common_this_event_off;
72+
bool patch_unlock_pics_on;
73+
bool patch_unlock_pics_off;
74+
bool patch_keypatch_on;
75+
bool patch_keypatch_off;
76+
bool patch_rpg2k3_cmds_on;
77+
bool patch_rpg2k3_cmds_off;
78+
bool use_rpg2k_battle_system_on;
79+
bool use_rpg2k_battle_system_off;
80+
};
81+
std::array<bool, 20> flags;
82+
};
83+
EasyRpgStateRuntime_Flags() noexcept
84+
{}
85+
} easyrpg_runtime_flags;
5686
};
5787

88+
inline bool operator==(const SaveEventExecState::EasyRpgStateRuntime_Flags& l, const SaveEventExecState::EasyRpgStateRuntime_Flags& r) {
89+
return l.flags == r.flags;
90+
}
91+
92+
inline bool operator!=(const SaveEventExecState::EasyRpgStateRuntime_Flags& l, const SaveEventExecState::EasyRpgStateRuntime_Flags& r) {
93+
return !(l == r);
94+
}
95+
96+
std::ostream& operator<<(std::ostream& os, const SaveEventExecState::EasyRpgStateRuntime_Flags& obj);
97+
5898
inline bool operator==(const SaveEventExecState& l, const SaveEventExecState& r) {
5999
return l.stack == r.stack
60100
&& l.show_message == r.show_message
@@ -80,7 +120,8 @@ namespace rpg {
80120
&& l.wait_key_enter == r.wait_key_enter
81121
&& l.easyrpg_active == r.easyrpg_active
82122
&& l.easyrpg_string == r.easyrpg_string
83-
&& l.easyrpg_parameters == r.easyrpg_parameters;
123+
&& l.easyrpg_parameters == r.easyrpg_parameters
124+
&& l.easyrpg_runtime_flags == r.easyrpg_runtime_flags;
84125
}
85126

86127
inline bool operator!=(const SaveEventExecState& l, const SaveEventExecState& r) {

src/generated/lcf/rpg/savemapeventbase.h

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#define LCF_RPG_SAVEMAPEVENTBASE_H
1414

1515
// Headers
16+
#include <array>
1617
#include <stdint.h>
1718
#include <string>
1819
#include "lcf/enum_tags.h"
@@ -70,8 +71,28 @@ namespace rpg {
7071
int32_t easyrpg_move_failure_count = 0;
7172
uint32_t easyrpg_clone_map_id = 0;
7273
uint32_t easyrpg_clone_event_id = 0;
74+
struct EasyRpgEventRuntime_Flags {
75+
union {
76+
struct {
77+
bool reserved_1;
78+
};
79+
std::array<bool, 1> flags;
80+
};
81+
EasyRpgEventRuntime_Flags() noexcept
82+
{}
83+
} easyrpg_runtime_flags;
7384
};
7485

86+
inline bool operator==(const SaveMapEventBase::EasyRpgEventRuntime_Flags& l, const SaveMapEventBase::EasyRpgEventRuntime_Flags& r) {
87+
return l.flags == r.flags;
88+
}
89+
90+
inline bool operator!=(const SaveMapEventBase::EasyRpgEventRuntime_Flags& l, const SaveMapEventBase::EasyRpgEventRuntime_Flags& r) {
91+
return !(l == r);
92+
}
93+
94+
std::ostream& operator<<(std::ostream& os, const SaveMapEventBase::EasyRpgEventRuntime_Flags& obj);
95+
7596
inline bool operator==(const SaveMapEventBase& l, const SaveMapEventBase& r) {
7697
return l.active == r.active
7798
&& l.map_id == r.map_id
@@ -114,7 +135,8 @@ namespace rpg {
114135
&& l.flash_time_left == r.flash_time_left
115136
&& l.easyrpg_move_failure_count == r.easyrpg_move_failure_count
116137
&& l.easyrpg_clone_map_id == r.easyrpg_clone_map_id
117-
&& l.easyrpg_clone_event_id == r.easyrpg_clone_event_id;
138+
&& l.easyrpg_clone_event_id == r.easyrpg_clone_event_id
139+
&& l.easyrpg_runtime_flags == r.easyrpg_runtime_flags;
118140
}
119141

120142
inline bool operator!=(const SaveMapEventBase& l, const SaveMapEventBase& r) {

src/generated/lsd_saveeventexecframe.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ static TypedField<rpg::SaveEventExecFrame, std::vector<int32_t>> static_maniac_l
102102
0,
103103
0
104104
);
105+
static TypedField<rpg::SaveEventExecFrame, rpg::SaveEventExecFrame::EasyRpgFrameRuntime_Flags> static_easyrpg_runtime_flags(
106+
&rpg::SaveEventExecFrame::easyrpg_runtime_flags,
107+
LSD_Reader::ChunkSaveEventExecFrame::easyrpg_runtime_flags,
108+
"easyrpg_runtime_flags",
109+
0,
110+
0
111+
);
105112

106113

107114
template <>
@@ -118,6 +125,7 @@ Field<rpg::SaveEventExecFrame> const* Struct<rpg::SaveEventExecFrame>::fields[]
118125
&static_maniac_event_page_id,
119126
&static_maniac_loop_info_size,
120127
&static_maniac_loop_info,
128+
&static_easyrpg_runtime_flags,
121129
NULL
122130
};
123131

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/* !!!! GENERATED FILE - DO NOT EDIT !!!!
2+
* --------------------------------------
3+
*
4+
* This file is part of liblcf. Copyright (c) liblcf authors.
5+
* https://github.com/EasyRPG/liblcf - https://easyrpg.org
6+
*
7+
* liblcf is Free/Libre Open Source Software, released under the MIT License.
8+
* For the full copyright and license information, please view the COPYING
9+
* file that was distributed with this source code.
10+
*/
11+
12+
/*
13+
* Headers
14+
*/
15+
#include "lcf/lsd/reader.h"
16+
#include "lcf/lsd/chunks.h"
17+
#include "reader_struct.h"
18+
19+
namespace lcf {
20+
21+
// Read SaveEventExecFrame.
22+
23+
template <>
24+
char const* const Flags<rpg::SaveEventExecFrame::EasyRpgFrameRuntime_Flags>::name = "SaveEventExecFrame_EasyRpgFrameRuntime_Flags";
25+
26+
template <>
27+
decltype(Flags<rpg::SaveEventExecFrame::EasyRpgFrameRuntime_Flags>::flag_names) Flags<rpg::SaveEventExecFrame::EasyRpgFrameRuntime_Flags>::flag_names = {
28+
"reserved_1"
29+
};
30+
31+
template <>
32+
decltype(Flags<rpg::SaveEventExecFrame::EasyRpgFrameRuntime_Flags>::flags_is2k3) Flags<rpg::SaveEventExecFrame::EasyRpgFrameRuntime_Flags>::flags_is2k3 = {
33+
0
34+
};
35+
36+
} //namespace lcf

0 commit comments

Comments
 (0)