implemented custom max(), because std::vector::size() returns different types on msvc vs. gcc
This commit is contained in:
parent
d7dcb2425e
commit
daa6f236be
|
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
namespace Math
|
||||||
|
{
|
||||||
|
template<typename T, typename U, typename V>
|
||||||
|
inline T max(U first, V second)
|
||||||
|
{
|
||||||
|
return static_cast<T>(first >= second ? first : second);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,3 +3,4 @@
|
||||||
#include <Physics.h>
|
#include <Physics.h>
|
||||||
#include <Random.h>
|
#include <Random.h>
|
||||||
#include <Color.h>
|
#include <Color.h>
|
||||||
|
#include <Math.h>
|
||||||
|
|
@ -607,7 +607,7 @@ void Game::soundSystem()
|
||||||
|
|
||||||
void Game::scoreSystem()
|
void Game::scoreSystem()
|
||||||
{
|
{
|
||||||
player.mult = (int)std::max(balls.size(), 1ull);
|
player.mult = Math::max<int>(balls.size(), 1);
|
||||||
for (auto& brick : bricks)
|
for (auto& brick : bricks)
|
||||||
{
|
{
|
||||||
if (!brick.alive)
|
if (!brick.alive)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue