Porytiles
Loading...
Searching...
No Matches
anim_params.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <string>
5#include <vector>
6
9
10namespace porytiles {
11
12namespace anim {
13
14inline constexpr std::size_t default_frame_factor = 16;
15inline constexpr std::size_t default_frame_offset = 0;
16inline constexpr std::size_t default_counter_max = 256;
17
18} // namespace anim
19
37 public:
38 AnimParams() = default;
39
54 [[nodiscard]] const DynamicCasedName &cased_name() const
55 {
56 return cased_name_;
57 }
58
60 {
61 cased_name_ = std::move(value);
62 }
63
73 [[nodiscard]] std::size_t frame_factor() const
74 {
75 return frame_factor_;
76 }
77
78 void frame_factor(std::size_t value)
79 {
80 frame_factor_ = value;
81 }
82
92 [[nodiscard]] std::size_t frame_offset() const
93 {
94 return frame_offset_;
95 }
96
97 void frame_offset(std::size_t value)
98 {
99 frame_offset_ = value;
100 }
101
115 [[nodiscard]] const std::vector<DynamicCasedName> &frame_names() const
116 {
117 return frame_names_;
118 }
119
120 void frame_names(std::vector<DynamicCasedName> value)
121 {
122 frame_names_ = std::move(value);
123 }
124
138 [[nodiscard]] const std::vector<DynamicCasedName> &frame_order() const
139 {
140 return frame_order_;
141 }
142
143 void frame_order(std::vector<DynamicCasedName> value)
144 {
145 frame_order_ = std::move(value);
146 }
147
157 [[nodiscard]] std::size_t tile_offset() const
158 {
159 return tile_offset_;
160 }
161
162 void tile_offset(std::size_t value)
163 {
164 tile_offset_ = value;
165 }
166
176 [[nodiscard]] std::size_t tile_count() const
177 {
178 return tile_count_;
179 }
180
181 void tile_count(std::size_t value)
182 {
183 tile_count_ = value;
184 }
185
196 [[nodiscard]] std::size_t width_tiles() const
197 {
198 return width_tiles_;
199 }
200
201 void width_tiles(std::size_t value)
202 {
203 width_tiles_ = value;
204 }
205
216 [[nodiscard]] std::size_t height_tiles() const
217 {
218 return height_tiles_;
219 }
220
221 void height_tiles(std::size_t value)
222 {
223 height_tiles_ = value;
224 }
225
235 [[nodiscard]] std::size_t counter_max() const
236 {
237 return counter_max_;
238 }
239
240 void counter_max(std::size_t value)
241 {
242 counter_max_ = value;
243 }
244
254 [[nodiscard]] const std::vector<AnimOverrideEntry> &overrides() const
255 {
256 return overrides_;
257 }
258
259 void overrides(std::vector<AnimOverrideEntry> value)
260 {
261 overrides_ = std::move(value);
262 }
263
264 private:
265 DynamicCasedName cased_name_;
266 std::size_t frame_factor_{anim::default_frame_factor};
267 std::size_t frame_offset_{anim::default_frame_offset};
268 std::vector<DynamicCasedName> frame_names_{DynamicCasedName{"0"}};
269 std::vector<DynamicCasedName> frame_order_{DynamicCasedName{"0"}};
270 std::size_t tile_offset_{0};
271 std::size_t tile_count_{0};
272 std::size_t width_tiles_{0};
273 std::size_t height_tiles_{0};
274 std::size_t counter_max_{anim::default_counter_max};
275 std::vector<AnimOverrideEntry> overrides_;
276};
277
278} // namespace porytiles
Configuration parameters for a single tileset animation.
void height_tiles(std::size_t value)
void width_tiles(std::size_t value)
const DynamicCasedName & cased_name() const
Returns the structured name for this animation, preserving case format information.
const std::vector< AnimOverrideEntry > & overrides() const
Returns the manual override entries for this animation.
void frame_factor(std::size_t value)
const std::vector< DynamicCasedName > & frame_order() const
Returns the playback sequence.
std::size_t frame_offset() const
Returns the frame offset (remainder value for timer modulo check).
void cased_name(DynamicCasedName value)
std::size_t height_tiles() const
Returns the height of animation frames in tiles.
void frame_offset(std::size_t value)
std::size_t width_tiles() const
Returns the width of animation frames in tiles.
void tile_offset(std::size_t value)
void frame_names(std::vector< DynamicCasedName > value)
void frame_order(std::vector< DynamicCasedName > value)
void tile_count(std::size_t value)
std::size_t tile_offset() const
Returns the VRAM tile offset for this animation.
const std::vector< DynamicCasedName > & frame_names() const
Returns the unique frame definitions.
std::size_t frame_factor() const
Returns the frame factor (modulus divisor for timer).
std::size_t counter_max() const
Returns the animation counter maximum value.
void overrides(std::vector< AnimOverrideEntry > value)
void counter_max(std::size_t value)
std::size_t tile_count() const
Returns the number of tiles per animation frame.
A smart string wrapper that preserves word structure for lossless case format conversion.
constexpr std::size_t default_counter_max
constexpr std::size_t default_frame_offset
constexpr std::size_t default_frame_factor