Skip to content

Commit

Permalink
Improve C++ checking.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alberth289346 committed Oct 1, 2023
1 parent 22f932e commit 732e15d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CorsixTH/Src/th_gfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1451,8 +1451,9 @@ void animation::depersist(lua_persist_reader* pReader) {
// 3 should be the morph set, but the actual morph target is
// missing, so settle for a graphical bug rather than a segfault
// by reverting to the normal function set.
[[fallthrough]];
case 1:
break;
[[fallthrough]]; // Should be "return;" but not allowed.
case 2:
break;
case 4:
Expand Down
12 changes: 6 additions & 6 deletions CorsixTH/Src/th_gfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -581,9 +581,9 @@ class animation : public animation_base {
void set_morph_target(animation* pMorphTarget, int iDurationFactor = 1);
void set_frame(size_t iFrame);

virtual void draw_fn(render_target* pCanvas, int iDestX, int iDestY);
virtual bool hit_test_fn(int iDestX, int iDestY, int iTestX, int iTestY);
virtual bool is_multiple_frame_animation_fn();
void draw_fn(render_target* pCanvas, int iDestX, int iDestY) override;
bool hit_test_fn(int iDestX, int iDestY, int iTestX, int iTestY) override;
bool is_multiple_frame_animation_fn() override;
void set_function_set(int value);

void set_speed(int iX, int iY) { speed.dx = iX, speed.dy = iY; }
Expand Down Expand Up @@ -636,9 +636,9 @@ class sprite_render_list : public animation_base {
void persist(lua_persist_writer* pWriter) const;
void depersist(lua_persist_reader* pReader);

virtual void draw_fn(render_target* pCanvas, int iDestX, int iDestY);
virtual bool hit_test_fn(int iDestX, int iDestY, int iTestX, int iTestY);
virtual bool is_multiple_frame_animation_fn();
void draw_fn(render_target* pCanvas, int iDestX, int iDestY) override;
bool hit_test_fn(int iDestX, int iDestY, int iTestX, int iTestY) override;
bool is_multiple_frame_animation_fn() override;

private:
struct sprite {
Expand Down

0 comments on commit 732e15d

Please sign in to comment.