Browse Source

let's just use C++17 ok

opengl-renderer-broken
Martin Dørum 4 years ago
parent
commit
7f4dedb8f2
3 changed files with 5 additions and 10 deletions
  1. 1
    1
      CMakeLists.txt
  2. 0
    5
      core.mod/src/entities/EntPlayer.cc
  3. 4
    4
      core.mod/src/entities/EntPlayer.h

+ 1
- 1
CMakeLists.txt View File

@@ -3,7 +3,7 @@ project(swan)

find_package(SFML 2.5 COMPONENTS graphics system window REQUIRED)

add_compile_options(-Wall -Wextra -Wpedantic -Wno-unused-parameter -g -fsanitize=address)
add_compile_options(-std=c++17 -Wall -Wextra -Wpedantic -Wno-unused-parameter -g -fsanitize=address)
add_link_options(-fsanitize=address)
include_directories("${PROJECT_SOURCE_DIR}/libswan/include")


+ 0
- 5
core.mod/src/entities/EntPlayer.cc View File

@@ -1,10 +1,5 @@
#include "EntPlayer.h"

const float EntPlayer::FORCE = 600;
const float EntPlayer::FRICTION = 100;
const float EntPlayer::MASS = 80;
const Swan::Vec2 EntPlayer::SIZE = Swan::Vec2(1, 2);

void EntPlayer::draw(Swan::Win &win) {
body_.outline(win);
}

+ 4
- 4
core.mod/src/entities/EntPlayer.h View File

@@ -18,8 +18,8 @@ public:
void update(Swan::WorldPlane &plane, float dt) override;

private:
static const float FORCE;
static const float FRICTION;
static const float MASS;
static const Swan::Vec2 SIZE;
static constexpr float FORCE = 600;
static constexpr float FRICTION = 100;
static constexpr float MASS = 80;
static constexpr Swan::Vec2 SIZE = Swan::Vec2(1, 2);
};

Loading…
Cancel
Save