Sfoglia il codice sorgente

Fix some deprecated C++ language features.

Michael Ragazzon 5 anni fa
parent
commit
59ab6b464d

+ 1 - 1
Samples/invaders/src/Invader.cpp

@@ -87,7 +87,7 @@ Invader::Invader(Game* _game, InvaderType _type, int _index) : position(0,0)
 	invader_index = _index;
 
 	bomb_probability = GameDetails::GetDifficulty() == GameDetails::EASY ? BOMB_PROBABILITY_EASY : BOMB_PROBABILITY_HARD;
-	bomb_probability *= type;
+	bomb_probability *= float(type);
 }
 
 Invader::~Invader()

+ 1 - 1
Samples/luainvaders/src/Invader.cpp

@@ -87,7 +87,7 @@ Invader::Invader(Game* _game, InvaderType _type, int _index) : position(0,0)
 	invader_index = _index;
 
 	bomb_probability = GameDetails::GetDifficulty() == GameDetails::EASY ? BOMB_PROBABILITY_EASY : BOMB_PROBABILITY_HARD;
-	bomb_probability *= type;
+	bomb_probability *= float(type);
 }
 
 Invader::~Invader()

+ 1 - 1
Source/Core/Box.cpp

@@ -113,7 +113,7 @@ float Box::GetSizeAcross(Direction direction, Area area, Area area_end) const
 		size = (direction == HORIZONTAL ? content.x : content.y);
 	
 	for (int i = area; i <= area_end && i < CONTENT; i++)
-		size += (area_edges[i][TOP + direction] + area_edges[i][BOTTOM + direction]);
+		size += (area_edges[i][TOP + (int)direction] + area_edges[i][BOTTOM + (int)direction]);
 
 	return size;
 }