Skip to content

Commit 8a2f774

Browse files
committed
update to latest xygine version
1 parent a0a28a1 commit 8a2f774

File tree

13 files changed

+24
-24
lines changed

13 files changed

+24
-24
lines changed

bubble_pop/src/GameDirector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ void GameDirector::queueBubble()
441441
}
442442
else if (activeColours.size() > 1)
443443
{
444-
id = activeColours[xy::Util::Random::value(0, activeColours.size() - 1)];
444+
id = activeColours[xy::Util::Random::value(0u, activeColours.size() - 1)];
445445
}
446446

447447
//place bubble at spawn point

bubble_pop/src/GameOverState.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ bool GameOverState::handleEvent(const sf::Event& evt)
9595

9696
if (m_playerName.empty())
9797
{
98-
m_playerName = names[xy::Util::Random::value(0, names.size() - 1)];
98+
m_playerName = names[xy::Util::Random::value(0u, names.size() - 1)];
9999
}
100100

101101
if (m_sharedData.score > m_sharedData.highScores.back().second)
@@ -232,4 +232,4 @@ void GameOverState::updatePlayerString()
232232
e.getComponent<xy::Transform>().setOrigin(bounds.width / 2.f, bounds.height / 2.f);
233233
};
234234
m_scene.getSystem<xy::CommandSystem>().sendCommand(cmd);
235-
}
235+
}

did/src/FlappySailSystem.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void FlappySailSystem::process(float dt)
8282
void FlappySailSystem::onEntityAdded(xy::Entity entity)
8383
{
8484
auto& sail = entity.getComponent<FlappySail>();
85-
sail.indexA = xy::Util::Random::value(0, m_waveTable.size() - 1);
85+
sail.indexA = xy::Util::Random::value(0u, m_waveTable.size() - 1);
8686
sail.indexB = (sail.indexA + xy::Util::Random::value(12, 32)) % m_waveTable.size();
8787

8888
entity.getComponent<xy::Drawable>().getVertices().resize(8);
@@ -92,4 +92,4 @@ void FlappySailSystem::onEntityAdded(xy::Entity entity)
9292
void FlappySailSystem::setWindStrength(float strength)
9393
{
9494
m_targetWindStrength = std::min(strength, MaxWind);
95-
}
95+
}

did/src/FoliageGenerator.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ void FoliageGenerator::generate(const MapData& data, xy::Scene& scene)
108108
{
109109
while (!passComplete)
110110
{
111-
std::size_t spriteIndex = xy::Util::Random::value(0, sprites.size() - 1);
111+
std::size_t spriteIndex = xy::Util::Random::value(0u, sprites.size() - 1);
112112
auto sprite = sprites[spriteIndex];
113113

114114
sf::FloatRect spriteRect = sprite.getLocalBounds();
@@ -170,7 +170,7 @@ void FoliageGenerator::generate(const MapData& data, xy::Scene& scene)
170170
auto count = (f.width > (Global::TileSize * 2.5f)) ? xy::Util::Random::value(1, 2) : 1;
171171
for (auto j = 0; j < count; ++j)
172172
{
173-
auto& sprite = m_midSprites[xy::Util::Random::value(0, m_midSprites.size() - 1)];
173+
auto& sprite = m_midSprites[xy::Util::Random::value(0u, m_midSprites.size() - 1)];
174174
sf::FloatRect spriteRect = sprite.getLocalBounds();
175175
sf::Vector2f position(xPos, static_cast<float>(FoliageHeight));
176176
sprite.setPosition(position);
@@ -246,4 +246,4 @@ void FoliageGenerator::generate(const MapData& data, xy::Scene& scene)
246246
m_textures.resize(m_textures.size() + 10);
247247
}
248248
}
249-
}
249+
}

did/src/LoadingScreen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void LoadingScreen::draw(sf::RenderTarget& rt, sf::RenderStates) const
105105

106106
void LoadingScreen::updateMessage()
107107
{
108-
m_text.setString(randomMessages[xy::Util::Random::value(0, randomMessages.size() - 1)]);
108+
m_text.setString(randomMessages[xy::Util::Random::value(0u, randomMessages.size() - 1)]);
109109
m_text.setOrigin(m_text.getLocalBounds().width / 2.f, m_text.getLocalBounds().height / 2.f);
110110
m_text.setPosition(xy::DefaultSceneSize.x / 2.f, 980.f);
111-
}
111+
}

did/src/MenuHatFunctions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ void MenuState::buildNameEntry(sf::Font& largeFont)
456456

457457
if (m_sharedData.clientName.isEmpty())
458458
{
459-
m_sharedData.clientName = names[xy::Util::Random::value(0, names.size() - 1)];
459+
m_sharedData.clientName = names[xy::Util::Random::value(0u, names.size() - 1)];
460460
}
461461
}
462462
});
@@ -632,7 +632,7 @@ void MenuState::buildJoinEntry(sf::Font& largeFont)
632632

633633
if (m_sharedData.clientName.isEmpty())
634634
{
635-
m_sharedData.clientName = names[xy::Util::Random::value(0, names.size() - 1)];
635+
m_sharedData.clientName = names[xy::Util::Random::value(0u, names.size() - 1)];
636636
}
637637

638638
if (m_sharedData.remoteIP.isEmpty())

did/src/MenuLobbyFunctions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ void MenuState::randomiseSeed()
197197
for (auto i = 0; i < passes; ++i)
198198
{
199199
//add a random char
200-
string[xy::Util::Random::value(0, string.size() - 1)] = static_cast<char>(xy::Util::Random::value(32, 126));
200+
string[xy::Util::Random::value(0u, string.size() - 1)] = static_cast<char>(xy::Util::Random::value(32, 126));
201201
}
202202
std::shuffle(string.begin(), string.end(), xy::Util::Random::rndEngine);
203203
*m_activeString = string;
@@ -304,4 +304,4 @@ void MenuState::updateChatOutput(xy::Entity e, float)
304304
e.getComponent<xy::Transform>().setOrigin(0.f, bounds.height);
305305
e.getComponent<xy::Drawable>().setCroppingArea(crop);
306306
e.getComponent<xy::AudioEmitter>().play();
307-
}
307+
}

did/src/MenuState.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ void MenuState::loadSettings()
10491049
//if settings not found set some default values
10501050
if (!xy::FileSystem::fileExists(settingsPath + NameFile))
10511051
{
1052-
m_sharedData.clientName = names[xy::Util::Random::value(0, names.size() - 1)];
1052+
m_sharedData.clientName = names[xy::Util::Random::value(0u, names.size() - 1)];
10531053
}
10541054
else
10551055
{

did/src/Server.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ GameServer::GameServer()
5454
{
5555
m_sharedStateData.gameServer = this;
5656

57-
const char* defaultSeed = RandomSeeds[xy::Util::Random::value(0, RandomSeeds.size() - 1)];
57+
const char* defaultSeed = RandomSeeds[xy::Util::Random::value(0u, RandomSeeds.size() - 1)];
5858
std::strcpy(m_sharedStateData.seedData.str, defaultSeed);
5959

6060
std::hash<std::string> hash;
@@ -301,4 +301,4 @@ void GameServer::run()
301301
}
302302

303303
m_host.stop();
304-
}
304+
}

platformer/include/BobAnimationSystem.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ class BobAnimationSystem final : public xy::System
6767

6868
void onEntityAdded(xy::Entity entity) override
6969
{
70-
entity.getComponent<BobAnimation>().index = xy::Util::Random::value(0, m_waveTable.size() - 1);
70+
entity.getComponent<BobAnimation>().index = xy::Util::Random::value(0u, m_waveTable.size() - 1);
7171
}
72-
};
72+
};

0 commit comments

Comments
 (0)