fixed build warnings in msvc

This commit is contained in:
Joseph Aquino 2025-09-24 22:04:00 -04:00
parent 16416eb3f2
commit ef7fffb159
2 changed files with 6 additions and 6 deletions

View File

@ -74,10 +74,10 @@ void Game::setupLevel()
{
const int specialBrickInterval = totalBricks / totalSpecialBricks;
constexpr float xSpacing = 20.f;
constexpr float ySpacing = 20.f;
const float xOffset = brickSize.x + xSpacing;
const float yOffset = brickSize.y + ySpacing;
constexpr int xSpacing = 20;
constexpr int ySpacing = 20;
const int xOffset = (int)brickSize.x + xSpacing;
const int yOffset = (int)brickSize.y + ySpacing;
const int numRows = window.getSize().x / xOffset;
const int numColumns = (window.getSize().y - 300)/ yOffset;
int row{};
@ -600,7 +600,7 @@ void Game::soundSystem()
void Game::scoreSystem()
{
player.mult = std::max(balls.size(), 1ul);
player.mult = (int)std::max(balls.size(), 1ull);
for (auto& brick : bricks)
{
if (!brick.alive)

View File

@ -22,7 +22,7 @@ sf::Vector2f velocityInRandomDir(const float speed_in)
// get angle within certain ranges so that the ball does not
// 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)
{
angle += sf::degrees(1);