Skip to content

Commit

Permalink
Fixed compilation with modern gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
MCMic committed Jul 23, 2016
1 parent b210d3b commit 659ab31
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 49 deletions.
6 changes: 3 additions & 3 deletions gui/battlefield.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class BattleField {
void draw();
void spawn(UNIT_ID name,PLAYER player,float x=0);

static const float CastleW=80;
static const float CastleH=180;
static const float BaseY=600-180+155;
static constexpr float CastleW=80;
static constexpr float CastleH=180;
static constexpr float BaseY=600-180+155;

int get_unit_count(PLAYER);
int get_nonplant_unit_count(PLAYER);
Expand Down
8 changes: 4 additions & 4 deletions units/dragon.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ class Dragon: public Unit {
virtual void handle_message(const Message &mess,MessageQueue *mess_queue);
virtual void draw();

static const float Life=200;
static const float PlayerDamage=6;
static const float Y=180;
static const float DX=1;
static constexpr float Life=200;
static constexpr float PlayerDamage=6;
static constexpr float Y=180;
static constexpr float DX=1;
private:
typedef enum {FLY,CADAVER} State;

Expand Down
6 changes: 3 additions & 3 deletions units/druid.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ class Druid: public Unit {
virtual void handle_message(const Message &mess,MessageQueue *mess_queue);
virtual void draw();

static const float X=2;
static const float Y=80;
static constexpr float X=2;
static constexpr float Y=80;
private:
typedef enum {INIT,WAIT,SHOOTED} State;
State state;

const Sprite *bit_druid;
};

Expand Down
8 changes: 4 additions & 4 deletions units/explosion.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ class Explosion: public Unit {
virtual void handle_message(const Message &mess,MessageQueue *mess_queue);
virtual void draw();

static const float Damage=3;
static const float W=100;
static const float H=40;
static const int SpriteNumber=6;
static constexpr float Damage=3;
static constexpr float W=100;
static constexpr float H=40;
static constexpr int SpriteNumber=6;
private:
bool init;
const Sprite *bit_explosion_a;
Expand Down
12 changes: 6 additions & 6 deletions units/golem.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ class Golem: public Unit {
virtual void handle_message(const Message &mess,MessageQueue *mess_queue);
virtual void draw();

static const int Life=300;
static const int Damage=7;
static const int PlayerDamage=5;
static const float W=74;
static const float H=70;
static const float DX=1;
static constexpr int Life=300;
static constexpr int Damage=7;
static constexpr int PlayerDamage=5;
static constexpr float W=74;
static constexpr float H=70;
static constexpr float DX=1;
private:
typedef enum {STOP,WALK,FIGHT,CADAVER} State;

Expand Down
12 changes: 6 additions & 6 deletions units/knight.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ class Knight: public Unit {
virtual void handle_message(const Message &mess,MessageQueue *mess_queue);
virtual void draw();

static const int Life=50;
static const int Damage=8;
static const int PlayerDamage=8;
static const float W=60;
static const float H=59;
static const float DX=4;
static constexpr int Life=50;
static constexpr int Damage=8;
static constexpr int PlayerDamage=8;
static constexpr float W=60;
static constexpr float H=59;
static constexpr float DX=4;
private:
typedef enum {FIGHT,WALK,CADAVER} State;

Expand Down
10 changes: 5 additions & 5 deletions units/plant.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class Plant: public Unit {
virtual void draw();
static void reset_hasplant();

static const int Life=100;
static const int Damage=12;
static const float W=69;
static const float H=64;
static const float X=90;
static constexpr int Life=100;
static constexpr int Damage=12;
static constexpr float W=69;
static constexpr float H=64;
static constexpr float X=90;
private:
typedef enum {NORMAL,FIGHT,CADAVER} State;

Expand Down
12 changes: 6 additions & 6 deletions units/ram.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ class Ram: public Unit {
virtual void handle_message(const Message &mess,MessageQueue *mess_queue);
virtual void draw();

static const int Life=30;
static const int Damage=5;
static const int PlayerDamage=16;
static const float W=80;
static const float H=30;
static const float DX=1;
static constexpr int Life=30;
static constexpr int Damage=5;
static constexpr int PlayerDamage=16;
static constexpr float W=80;
static constexpr float H=30;
static constexpr float DX=1;
private:
typedef enum {STOP,WALK,FIGHT,CADAVER} State;

Expand Down
12 changes: 6 additions & 6 deletions units/soldier.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ class Soldier: public Unit {
virtual void handle_message(const Message &mess,MessageQueue *mess_queue);
virtual void draw();

static const int Life=30;
static const int Damage=5;
static const int PlayerDamage=5;
static const float W=22;
static const float H=33;
static const float DX=2;
static constexpr int Life=30;
static constexpr int Damage=5;
static constexpr int PlayerDamage=5;
static constexpr float W=22;
static constexpr float H=33;
static constexpr float DX=2;
private:
typedef enum {STOP,WALK,FIGHT,CADAVER} State;

Expand Down
12 changes: 6 additions & 6 deletions units/veteran.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ class Veteran: public Unit {
virtual void handle_message(const Message &mess,MessageQueue *mess_queue);
virtual void draw();

static const int Life=60;
static const int Damage=8;
static const int PlayerDamage=16;
static const float W=63;
static const float H=62;
static const float DX=1;
static constexpr int Life=60;
static constexpr int Damage=8;
static constexpr int PlayerDamage=16;
static constexpr float W=63;
static constexpr float H=62;
static constexpr float DX=1;
private:
typedef enum {STOP,WALK,FIGHT,CADAVER} State;

Expand Down

0 comments on commit 659ab31

Please sign in to comment.