Skip to content

Commit 63e58e6

Browse files
committed
CI: gcc-14, fix bug in initialization order
1 parent 290e60e commit 63e58e6

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

src/game/tetrion.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ Tetrion::Tetrion(
2323
bool is_top_level
2424
)
2525
: ui::Widget{ layout , ui::WidgetType::Component ,is_top_level},
26-
m_next_gravity_simulation_step_index{ get_gravity_delay_frames() },
2726
m_lock_delay_step_index{ lock_delay },
2827
m_service_provider{ service_provider },
2928
m_recording_writer{ std::move(recording_writer) },
3029
m_random{ random_seed },
3130
m_level{ starting_level },
3231
m_tetrion_index{ tetrion_index },
32+
m_next_gravity_simulation_step_index{ get_gravity_delay_frames() },
3333
main_layout{
3434
utils::size_t_identity<2>(),
3535
0,
@@ -494,7 +494,7 @@ void Tetrion::refresh_previews() {
494494
auto bag_index = usize{ 0 };
495495
for (std::remove_cvref_t<decltype(num_preview_tetrominos)> i = 0; i < num_preview_tetrominos; ++i) {
496496
m_preview_tetrominos.at(static_cast<usize>(i)) = Tetromino{
497-
grid::preview_tetromino_position + shapes::UPoint{0, static_cast<u32>(grid::preview_padding * i)},
497+
grid::preview_tetromino_position + shapes::UPoint{ 0, static_cast<u32>(grid::preview_padding * i) },
498498
m_sequence_bags.at(bag_index)[sequence_index]
499499
};
500500
++sequence_index;

src/game/tetrion.hpp

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ struct Tetrion final : public ui::Widget {
5757
bool m_down_key_pressed = false;
5858
bool m_allowed_to_hold = true;
5959
bool m_is_in_lock_delay = false;
60+
6061
u32 m_num_executed_lock_delays = 0;
61-
u64 m_next_gravity_simulation_step_index;
6262
u64 m_lock_delay_step_index;
6363
ServiceProvider* const m_service_provider;
6464
helper::optional<std::shared_ptr<recorder::RecordingWriter>> m_recording_writer;
6565
MinoStack m_mino_stack;
6666
Random m_random;
67-
u32 m_level = 0;
67+
u32 m_level;
6868
u32 m_lines_cleared = 0;
6969
GameState m_game_state = GameState::Playing;
7070
int m_sequence_index = 0;
@@ -75,6 +75,7 @@ struct Tetrion final : public ui::Widget {
7575
helper::optional<Tetromino> m_tetromino_on_hold;
7676
std::array<helper::optional<Tetromino>, num_preview_tetrominos> m_preview_tetrominos{};
7777
u8 m_tetrion_index;
78+
u64 m_next_gravity_simulation_step_index;
7879
ui::TileLayout main_layout;
7980

8081

@@ -149,63 +150,63 @@ struct Tetrion final : public ui::Widget {
149150
static u8 rotation_to_index(Rotation from, Rotation to);
150151

151152
static constexpr auto wall_kick_data_jltsz = WallKickTable{
152-
// North -> East
153+
// North -> East
153154
std::array{
154155
WallKickPoint{ 0, 0 },
155156
WallKickPoint{ -1, 0 },
156157
WallKickPoint{ -1, -1 },
157158
WallKickPoint{ 0, 2 },
158159
WallKickPoint{ -1, 2 },
159160
},
160-
// East -> North
161+
// East -> North
161162
std::array{
162163
WallKickPoint{ 0, 0 },
163164
WallKickPoint{ 1, 0 },
164165
WallKickPoint{ 1, 1 },
165166
WallKickPoint{ 0, -2 },
166167
WallKickPoint{ 1, -2 },
167168
},
168-
// East -> South
169+
// East -> South
169170
std::array{
170171
WallKickPoint{ 0, 0 },
171172
WallKickPoint{ 1, 0 },
172173
WallKickPoint{ 1, 1 },
173174
WallKickPoint{ 0, -2 },
174175
WallKickPoint{ 1, -2 },
175176
},
176-
// South -> East
177+
// South -> East
177178
std::array{
178179
WallKickPoint{ 0, 0 },
179180
WallKickPoint{ -1, 0 },
180181
WallKickPoint{ -1, -1 },
181182
WallKickPoint{ 0, 2 },
182183
WallKickPoint{ -1, 2 },
183184
},
184-
// South -> West
185+
// South -> West
185186
std::array{
186187
WallKickPoint{ 0, 0 },
187188
WallKickPoint{ 1, 0 },
188189
WallKickPoint{ 1, -1 },
189190
WallKickPoint{ 0, 2 },
190191
WallKickPoint{ 1, 2 },
191192
},
192-
// West -> South
193+
// West -> South
193194
std::array{
194195
WallKickPoint{ 0, 0 },
195196
WallKickPoint{ -1, 0 },
196197
WallKickPoint{ -1, 1 },
197198
WallKickPoint{ 0, -2 },
198199
WallKickPoint{ -1, -2 },
199200
},
200-
// West -> North
201+
// West -> North
201202
std::array{
202203
WallKickPoint{ 0, 0 },
203204
WallKickPoint{ -1, 0 },
204205
WallKickPoint{ -1, 1 },
205206
WallKickPoint{ 0, -2 },
206207
WallKickPoint{ -1, -2 },
207208
},
208-
// North -> West
209+
// North -> West
209210
std::array{
210211
WallKickPoint{ 0, 0 },
211212
WallKickPoint{ 1, 0 },
@@ -216,63 +217,63 @@ struct Tetrion final : public ui::Widget {
216217
};
217218

218219
static constexpr auto wall_kick_data_i = WallKickTable{
219-
// North -> East
220+
// North -> East
220221
std::array{
221222
WallKickPoint{ 0, 0 },
222223
WallKickPoint{ -2, 0 },
223224
WallKickPoint{ 1, 0 },
224225
WallKickPoint{ -2, 1 },
225226
WallKickPoint{ 1, -2 },
226227
},
227-
// East -> North
228+
// East -> North
228229
std::array{
229230
WallKickPoint{ 0, 0 },
230231
WallKickPoint{ 2, 0 },
231232
WallKickPoint{ -1, 0 },
232233
WallKickPoint{ 2, -1 },
233234
WallKickPoint{ -1, 2 },
234235
},
235-
// East -> South
236+
// East -> South
236237
std::array{
237238
WallKickPoint{ 0, 0 },
238239
WallKickPoint{ -1, 0 },
239240
WallKickPoint{ 2, 0 },
240241
WallKickPoint{ -1, -2 },
241242
WallKickPoint{ 2, 1 },
242243
},
243-
// South -> East
244+
// South -> East
244245
std::array{
245246
WallKickPoint{ 0, 0 },
246247
WallKickPoint{ 1, 0 },
247248
WallKickPoint{ -2, 0 },
248249
WallKickPoint{ 1, 2 },
249250
WallKickPoint{ -2, -1 },
250251
},
251-
// South -> West
252+
// South -> West
252253
std::array{
253254
WallKickPoint{ 0, 0 },
254255
WallKickPoint{ 2, 0 },
255256
WallKickPoint{ -1, 0 },
256257
WallKickPoint{ 2, -1 },
257258
WallKickPoint{ -1, 2 },
258259
},
259-
// West -> South
260+
// West -> South
260261
std::array{
261262
WallKickPoint{ 0, 0 },
262263
WallKickPoint{ -2, 0 },
263264
WallKickPoint{ 1, 0 },
264265
WallKickPoint{ -2, 1 },
265266
WallKickPoint{ 1, -2 },
266267
},
267-
// West -> North
268+
// West -> North
268269
std::array{
269270
WallKickPoint{ 0, 0 },
270271
WallKickPoint{ 1, 0 },
271272
WallKickPoint{ -2, 0 },
272273
WallKickPoint{ 1, 2 },
273274
WallKickPoint{ -2, -1 },
274275
},
275-
// North -> West
276+
// North -> West
276277
std::array{
277278
WallKickPoint{ 0, 0 },
278279
WallKickPoint{ -1, 0 },

0 commit comments

Comments
 (0)