Skip to content

Commit

Permalink
Define math vars
Browse files Browse the repository at this point in the history
  • Loading branch information
AXDOOMER authored Aug 4, 2023
1 parent 46ddc76 commit 926f803
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
5 changes: 4 additions & 1 deletion Project/bot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
#include "player.h"
#include "level.h"

#define _USE_MATH_DEFINES
#include <cmath>

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

using namespace std;

Player* findTarget(Player* const bot, const Level* const lvl)
Expand Down
5 changes: 4 additions & 1 deletion Project/physics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@
#include "physics.h"
#include "line.h"

#define _USE_MATH_DEFINES
#include <cmath> /* round, isnan, fmod, nanf */
#include <limits> /* numeric_limits */
#include <vector>
#include <utility> /* pair */
#include <algorithm> /* find, sort */
#include <stdexcept>

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

using namespace std;

// Cap a value between a min and a max
Expand Down
5 changes: 4 additions & 1 deletion Project/plane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@
#include "vecmath.h"
#include "plane.h"

#define _USE_MATH_DEFINES
#include <cmath>
#include <limits>

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

using namespace std;

// Process a plane
Expand Down
5 changes: 4 additions & 1 deletion Project/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@
#include "actor.h"
#include "ticcmd.h"

#define _USE_MATH_DEFINES
#include <cmath>
#include <limits> /* numeric_limits */
#include <string> /* to_string() */
#include <cstring> /* memcpy */

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

using namespace std;

Player::Player()
Expand Down
10 changes: 9 additions & 1 deletion Project/viewdraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,18 @@

#include <iostream> // cerr, endl
#include <string>
#define _USE_MATH_DEFINES
#include <cmath>
#include <algorithm> // sort()
#include <regex> // regex_replace()

#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif

#ifndef M_PI_2
#define M_PI_2 3.14159265358979323846/2
#endif

using namespace std;

GameWindow view;
Expand Down

0 comments on commit 926f803

Please sign in to comment.