Skip to content

Commit 3590a4e

Browse files
authored
Merge pull request #69 from marmichalski/gcc
Fix compilation with gcc
2 parents f1b05fa + d32903e commit 3590a4e

2 files changed

Lines changed: 29 additions & 26 deletions

File tree

.github/workflows/build-cmake.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ on:
2121
jobs:
2222
build-with-cmake:
2323
runs-on: ubuntu-latest
24+
25+
strategy:
26+
matrix:
27+
compiler:
28+
- [cc: gcc, cxx: g++]
29+
- [cc: clang, cxx: clang++]
30+
2431
steps:
2532
- uses: actions/checkout@v2
2633
with:
@@ -36,8 +43,8 @@ jobs:
3643
uses: ashutoshvarma/action-cmake-build@master
3744
with:
3845
build-dir: ${{ github.workspace }}/build
39-
cc: clang
40-
cxx: clang++
46+
cc: ${{ matrix.compiler.cc }}
47+
cxx: ${{ matrix.compiler.cxx }}
4148
build-type: Release
4249
configure-options: -DWITH_BOX2D=Yes
4350
parallel: 2

src/GameDefs.h

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ struct TextureRegion
364364
{
365365
debug_assert(textureSize.x > 0);
366366
debug_assert(textureSize.y > 0);
367-
float tcx = (1.0f / textureSize.x);
367+
float tcx = (1.0f / textureSize.x);
368368
float tcy = (1.0f / textureSize.y);
369369
// compute texture region coordinates
370370
mRectangle = srcRectangle;
@@ -883,26 +883,22 @@ struct PedestrianCtlState
883883
}
884884
public:
885885
// on foot control actions
886-
struct
887-
{
888-
bool mTurnLeft = false;
889-
bool mTurnRight = false;
890-
bool mWalkForward = false;
891-
bool mWalkBackward = false;
892-
bool mRun = false;
893-
bool mShoot = false;
894-
bool mJump = false;
895-
bool mSpecial = false;
896-
897-
// overrides mTurnLeft/mTurnRight
898-
bool mRotateToDesiredAngle = false;
899-
cxx::angle_t mDesiredRotationAngle;
900-
};
901-
struct // in car control actions
902-
{
903-
float mAcceleration = 0.0f; // 0 means no acceleration, < 0 move reverse, > 0 full acceleration
904-
float mSteerDirection = 0.0f; // 0 means no steer, < 0 steer left, > 0 steer right
905-
bool mHandBrake = false;
906-
bool mHorn = false;
907-
};
908-
};
886+
bool mTurnLeft = false;
887+
bool mTurnRight = false;
888+
bool mWalkForward = false;
889+
bool mWalkBackward = false;
890+
bool mRun = false;
891+
bool mShoot = false;
892+
bool mJump = false;
893+
bool mSpecial = false;
894+
895+
// overrides mTurnLeft/mTurnRight
896+
bool mRotateToDesiredAngle = false;
897+
cxx::angle_t mDesiredRotationAngle;
898+
899+
// in car control actions
900+
float mAcceleration = 0.0f; // 0 means no acceleration, < 0 move reverse, > 0 full acceleration
901+
float mSteerDirection = 0.0f; // 0 means no steer, < 0 steer left, > 0 steer right
902+
bool mHandBrake = false;
903+
bool mHorn = false;
904+
};

0 commit comments

Comments
 (0)