fixed build warnings in msvc
This commit is contained in:
parent
16416eb3f2
commit
ef7fffb159
10
src/Game.cpp
10
src/Game.cpp
|
|
@ -74,10 +74,10 @@ void Game::setupLevel()
|
||||||
{
|
{
|
||||||
const int specialBrickInterval = totalBricks / totalSpecialBricks;
|
const int specialBrickInterval = totalBricks / totalSpecialBricks;
|
||||||
|
|
||||||
constexpr float xSpacing = 20.f;
|
constexpr int xSpacing = 20;
|
||||||
constexpr float ySpacing = 20.f;
|
constexpr int ySpacing = 20;
|
||||||
const float xOffset = brickSize.x + xSpacing;
|
const int xOffset = (int)brickSize.x + xSpacing;
|
||||||
const float yOffset = brickSize.y + ySpacing;
|
const int yOffset = (int)brickSize.y + ySpacing;
|
||||||
const int numRows = window.getSize().x / xOffset;
|
const int numRows = window.getSize().x / xOffset;
|
||||||
const int numColumns = (window.getSize().y - 300)/ yOffset;
|
const int numColumns = (window.getSize().y - 300)/ yOffset;
|
||||||
int row{};
|
int row{};
|
||||||
|
|
@ -600,7 +600,7 @@ void Game::soundSystem()
|
||||||
|
|
||||||
void Game::scoreSystem()
|
void Game::scoreSystem()
|
||||||
{
|
{
|
||||||
player.mult = std::max(balls.size(), 1ul);
|
player.mult = (int)std::max(balls.size(), 1ull);
|
||||||
for (auto& brick : bricks)
|
for (auto& brick : bricks)
|
||||||
{
|
{
|
||||||
if (!brick.alive)
|
if (!brick.alive)
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ sf::Vector2f velocityInRandomDir(const float speed_in)
|
||||||
|
|
||||||
// get angle within certain ranges so that the ball does not
|
// get angle within certain ranges so that the ball does not
|
||||||
// start moving straight side to side or up and down
|
// start moving straight side to side or up and down
|
||||||
sf::Angle angle = sf::degrees(upOrDown ? Random::get(225, 315) : Random::get(45, 135));
|
sf::Angle angle = sf::degrees(upOrDown ? (float)Random::get(225, 315) : (float)Random::get(45, 135));
|
||||||
if (angle.asDegrees() == 90.f || angle.asDegrees() == 270)
|
if (angle.asDegrees() == 90.f || angle.asDegrees() == 270)
|
||||||
{
|
{
|
||||||
angle += sf::degrees(1);
|
angle += sf::degrees(1);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue