1 /* !!!! GENERATED FILE - DO NOT EDIT !!!! 2 * -------------------------------------- 3 * 4 * This file is part of liblcf. Copyright (c) 2021 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 #ifndef LCF_RPG_SAVEPICTURE_H 13 #define LCF_RPG_SAVEPICTURE_H 14 15 // Headers 16 #include <array> 17 #include <stdint.h> 18 #include <string> 19 #include "lcf/enum_tags.h" 20 #include "lcf/context.h" 21 #include <ostream> 22 #include <type_traits> 23 24 /** 25 * rpg::SavePicture class. 26 */ 27 namespace lcf { 28 namespace rpg { 29 class SavePicture { 30 public: 31 enum Effect { 32 Effect_none = 0, 33 Effect_rotation = 1, 34 Effect_wave = 2, 35 Effect_maniac_fixed_angle = 3 36 }; 37 static constexpr auto kEffectTags = lcf::makeEnumTags<Effect>( 38 "none", 39 "rotation", 40 "wave", 41 "maniac_fixed_angle" 42 ); 43 enum MapLayer { 44 MapLayer_none = 0, 45 MapLayer_parallax = 1, 46 MapLayer_tilemap_below = 2, 47 MapLayer_events_below = 3, 48 MapLayer_events_same_as_player = 4, 49 MapLayer_tilemap_above = 5, 50 MapLayer_events_above = 6, 51 MapLayer_weather = 7, 52 MapLayer_animations = 8, 53 MapLayer_windows = 9, 54 MapLayer_timers = 10 55 }; 56 static constexpr auto kMapLayerTags = lcf::makeEnumTags<MapLayer>( 57 "none", 58 "parallax", 59 "tilemap_below", 60 "events_below", 61 "events_same_as_player", 62 "tilemap_above", 63 "events_above", 64 "weather", 65 "animations", 66 "windows", 67 "timers" 68 ); 69 enum BattleLayer { 70 BattleLayer_none = 0, 71 BattleLayer_background = 1, 72 BattleLayer_battlers_and_animations = 2, 73 BattleLayer_weather = 3, 74 BattleLayer_windows_and_status = 4, 75 BattleLayer_timers = 5 76 }; 77 static constexpr auto kBattleLayerTags = lcf::makeEnumTags<BattleLayer>( 78 "none", 79 "background", 80 "battlers_and_animations", 81 "weather", 82 "windows_and_status", 83 "timers" 84 ); 85 enum EasyRpgFlip { 86 EasyRpgFlip_none = 0, 87 EasyRpgFlip_x = 1, 88 EasyRpgFlip_y = 2, 89 EasyRpgFlip_both = 3 90 }; 91 static constexpr auto kEasyRpgFlipTags = lcf::makeEnumTags<EasyRpgFlip>( 92 "none", 93 "x", 94 "y", 95 "both" 96 ); 97 98 int ID = 0; 99 std::string name; 100 double start_x = 0.0; 101 double start_y = 0.0; 102 double current_x = 0.0; 103 double current_y = 0.0; 104 bool fixed_to_map = false; 105 double current_magnify = 100.0; 106 double current_top_trans = 0.0; 107 bool use_transparent_color = false; 108 double current_red = 100.0; 109 double current_green = 100.0; 110 double current_blue = 100.0; 111 double current_sat = 100.0; 112 int32_t effect_mode = 0; 113 double current_effect_power = 0.0; 114 double current_bot_trans = 0.0; 115 int32_t spritesheet_cols = 1; 116 int32_t spritesheet_rows = 1; 117 int32_t spritesheet_frame = 0; 118 int32_t spritesheet_speed = 0; 119 int32_t frames = 0; 120 bool spritesheet_play_once = false; 121 int32_t map_layer = 7; 122 int32_t battle_layer = 0; 123 struct Flags { 124 union { 125 struct { 126 bool erase_on_map_change; 127 bool erase_on_battle_end; 128 bool unused_bit; 129 bool unused_bit2; 130 bool affected_by_tint; 131 bool affected_by_flash; 132 bool affected_by_shake; 133 }; 134 std::array<bool, 7> flags; 135 }; 136 //TODO: Should try to switch to member initializers when we upgrade to VS2017. FlagsFlags137 Flags() noexcept: erase_on_map_change(true), erase_on_battle_end(false), unused_bit(false), unused_bit2(false), affected_by_tint(false), affected_by_flash(true), affected_by_shake(true) 138 {} 139 } flags; 140 double finish_x = 0.0; 141 double finish_y = 0.0; 142 int32_t finish_magnify = 100; 143 int32_t finish_top_trans = 0; 144 int32_t finish_bot_trans = 0; 145 int32_t finish_red = 100; 146 int32_t finish_green = 100; 147 int32_t finish_blue = 100; 148 int32_t finish_sat = 100; 149 int32_t finish_effect_power = 0; 150 int32_t time_left = 0; 151 double current_rotation = 0.0; 152 int32_t current_waver = 0; 153 int32_t easyrpg_flip = 0; 154 int32_t easyrpg_blend_mode = 0; 155 }; 156 inline std::ostream& operator<<(std::ostream& os, SavePicture::Effect code) { 157 os << static_cast<std::underlying_type_t<decltype(code)>>(code); 158 return os; 159 } 160 inline std::ostream& operator<<(std::ostream& os, SavePicture::MapLayer code) { 161 os << static_cast<std::underlying_type_t<decltype(code)>>(code); 162 return os; 163 } 164 inline std::ostream& operator<<(std::ostream& os, SavePicture::BattleLayer code) { 165 os << static_cast<std::underlying_type_t<decltype(code)>>(code); 166 return os; 167 } 168 inline std::ostream& operator<<(std::ostream& os, SavePicture::EasyRpgFlip code) { 169 os << static_cast<std::underlying_type_t<decltype(code)>>(code); 170 return os; 171 } 172 173 inline bool operator==(const SavePicture::Flags& l, const SavePicture::Flags& r) { 174 return l.flags == r.flags; 175 } 176 177 inline bool operator!=(const SavePicture::Flags& l, const SavePicture::Flags& r) { 178 return !(l == r); 179 } 180 181 std::ostream& operator<<(std::ostream& os, const SavePicture::Flags& obj); 182 183 inline bool operator==(const SavePicture& l, const SavePicture& r) { 184 return l.name == r.name 185 && l.start_x == r.start_x 186 && l.start_y == r.start_y 187 && l.current_x == r.current_x 188 && l.current_y == r.current_y 189 && l.fixed_to_map == r.fixed_to_map 190 && l.current_magnify == r.current_magnify 191 && l.current_top_trans == r.current_top_trans 192 && l.use_transparent_color == r.use_transparent_color 193 && l.current_red == r.current_red 194 && l.current_green == r.current_green 195 && l.current_blue == r.current_blue 196 && l.current_sat == r.current_sat 197 && l.effect_mode == r.effect_mode 198 && l.current_effect_power == r.current_effect_power 199 && l.current_bot_trans == r.current_bot_trans 200 && l.spritesheet_cols == r.spritesheet_cols 201 && l.spritesheet_rows == r.spritesheet_rows 202 && l.spritesheet_frame == r.spritesheet_frame 203 && l.spritesheet_speed == r.spritesheet_speed 204 && l.frames == r.frames 205 && l.spritesheet_play_once == r.spritesheet_play_once 206 && l.map_layer == r.map_layer 207 && l.battle_layer == r.battle_layer 208 && l.flags == r.flags 209 && l.finish_x == r.finish_x 210 && l.finish_y == r.finish_y 211 && l.finish_magnify == r.finish_magnify 212 && l.finish_top_trans == r.finish_top_trans 213 && l.finish_bot_trans == r.finish_bot_trans 214 && l.finish_red == r.finish_red 215 && l.finish_green == r.finish_green 216 && l.finish_blue == r.finish_blue 217 && l.finish_sat == r.finish_sat 218 && l.finish_effect_power == r.finish_effect_power 219 && l.time_left == r.time_left 220 && l.current_rotation == r.current_rotation 221 && l.current_waver == r.current_waver 222 && l.easyrpg_flip == r.easyrpg_flip 223 && l.easyrpg_blend_mode == r.easyrpg_blend_mode; 224 } 225 226 inline bool operator!=(const SavePicture& l, const SavePicture& r) { 227 return !(l == r); 228 } 229 230 std::ostream& operator<<(std::ostream& os, const SavePicture& obj); 231 232 template <typename F, typename ParentCtx = Context<void,void>> 233 void ForEachString(SavePicture& obj, const F& f, const ParentCtx* parent_ctx = nullptr) { 234 (void)obj; 235 (void)f; 236 (void)parent_ctx; 237 } 238 239 } // namespace rpg 240 } // namespace lcf 241 242 #endif 243