Skip to content

Commit

Permalink
Updated to SFML Version 2.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Mankarse committed Mar 29, 2017
1 parent 6c2a604 commit 18dda85
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 25 deletions.
2 changes: 1 addition & 1 deletion ext/ExternalDependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
HourglassII depends on the following libraries:

Boost version 1.59.0 -- http://www.boost.org/users/history/version_1_59_0.html
SFML version 2.3.2 -- http://www.sfml-dev.org/download.php
SFML version 2.4.2 -- http://www.sfml-dev.org/download.php
Threading Building Blocks version 2017 Update 5 -- http://threadingbuildingblocks.org

These libraries must be compiled and placed in the following directory structure within the ext/ directory.
Expand Down
15 changes: 10 additions & 5 deletions src/GameDisplayHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ void drawInventory(
timeJumpGlyph.setString(timeJump.str());
timeJumpGlyph.setPosition(500, 350);
timeJumpGlyph.setCharacterSize(10);
timeJumpGlyph.setColor(uiTextColor);
timeJumpGlyph.setFillColor(uiTextColor);
timeJumpGlyph.setOutlineColor(uiTextColor);
app.draw(timeJumpGlyph);
}
{
Expand All @@ -70,7 +71,8 @@ void drawInventory(
timeReversesGlyph.setString(timeReverses.str());
timeReversesGlyph.setPosition(500, 370);
timeReversesGlyph.setCharacterSize(10);
timeReversesGlyph.setColor(uiTextColor);
timeReversesGlyph.setFillColor(uiTextColor);
timeReversesGlyph.setOutlineColor(uiTextColor);
app.draw(timeReversesGlyph);
}
{
Expand All @@ -81,7 +83,8 @@ void drawInventory(
timeGunsGlyph.setString(timeGuns.str());
timeGunsGlyph.setPosition(500, 390);
timeGunsGlyph.setCharacterSize(10);
timeGunsGlyph.setColor(uiTextColor);
timeGunsGlyph.setFillColor(uiTextColor);
timeGunsGlyph.setOutlineColor(uiTextColor);
app.draw(timeGunsGlyph);
}
{
Expand All @@ -92,7 +95,8 @@ void drawInventory(
timePausesGlyph.setString(timeGuns.str());
timePausesGlyph.setPosition(500, 410);
timePausesGlyph.setCharacterSize(10);
timePausesGlyph.setColor(uiTextColor);
timePausesGlyph.setFillColor(uiTextColor);
timePausesGlyph.setOutlineColor(uiTextColor);
app.draw(timePausesGlyph);
}
}
Expand Down Expand Up @@ -293,7 +297,8 @@ void DrawTimeline(
cursorTimeGlyph.setString(cursorTime.str());
cursorTimeGlyph.setPosition(timeCursorHorizontalPosition-3.f, height + 20.f);
cursorTimeGlyph.setCharacterSize(10);
cursorTimeGlyph.setColor(timeCursorColor);
cursorTimeGlyph.setFillColor(timeCursorColor);
cursorTimeGlyph.setOutlineColor(timeCursorColor);
target.draw(cursorTimeGlyph);
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/LoadingLevelScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ static void drawLoadingScreen(hg::RenderWindow &window) {
sf::Text loadingGlyph;
loadingGlyph.setFont(*hg::defaultFont);
loadingGlyph.setString("Loading Level...");
loadingGlyph.setColor(sf::Color(255,255,255));
loadingGlyph.setFillColor(sf::Color(255,255,255));
loadingGlyph.setOutlineColor(sf::Color(255, 255, 255));
loadingGlyph.setPosition(520, 450);
loadingGlyph.setCharacterSize(12);
window.clear();
Expand Down
4 changes: 3 additions & 1 deletion src/MainMenuScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ static void drawMainMenu(hg::RenderWindow &window, std::vector<MenuItem> const &
sf::Text menuItemGlyph;
menuItemGlyph.setFont(*hg::defaultFont);
menuItemGlyph.setString(menuItem.text);
menuItemGlyph.setColor(i == currentItem ? sf::Color(0, 255, 255) : sf::Color(255,255,255));
auto const menuItemColour = i == currentItem ? sf::Color(0, 255, 255) : sf::Color(255, 255, 255);
menuItemGlyph.setFillColor(menuItemColour);
menuItemGlyph.setOutlineColor(menuItemColour);
menuItemGlyph.setPosition(200.f, ypos);
ypos += 50.f;
menuItemGlyph.setCharacterSize(32);
Expand Down
15 changes: 10 additions & 5 deletions src/PostLevelScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ void run_post_level_scene(
sf::Text replayGlyph;
replayGlyph.setFont(*hg::defaultFont);
replayGlyph.setString("You Won -- Replay");
replayGlyph.setColor(sf::Color(255,0,0));
replayGlyph.setFillColor(sf::Color(255,0,0));
replayGlyph.setOutlineColor(sf::Color(255, 0, 0));
replayGlyph.setPosition(480, 32);
replayGlyph.setCharacterSize(16);
window.draw(replayGlyph);
Expand All @@ -111,7 +112,8 @@ void run_post_level_scene(
sf::Text replayGlyph;
replayGlyph.setFont(*hg::defaultFont);
replayGlyph.setString(", . / keys control the displayed time");
replayGlyph.setColor(sf::Color(255,0,0));
replayGlyph.setFillColor(sf::Color(255,0,0));
replayGlyph.setOutlineColor(sf::Color(255, 0, 0));
replayGlyph.setPosition(380, 64);
replayGlyph.setCharacterSize(16);
window.draw(replayGlyph);
Expand Down Expand Up @@ -213,7 +215,8 @@ void runStep(
currentPlayerGlyph.setString(currentPlayerIndex.str());
currentPlayerGlyph.setPosition(580, 433);
currentPlayerGlyph.setCharacterSize(10);
currentPlayerGlyph.setColor(uiTextColor);
currentPlayerGlyph.setFillColor(uiTextColor);
currentPlayerGlyph.setOutlineColor(uiTextColor);
app.draw(currentPlayerGlyph);
}
{
Expand All @@ -224,7 +227,8 @@ void runStep(
frameNumberGlyph.setString(frameNumberString.str());
frameNumberGlyph.setPosition(580, 445);
frameNumberGlyph.setCharacterSize(8);
frameNumberGlyph.setColor(uiTextColor);
frameNumberGlyph.setFillColor(uiTextColor);
frameNumberGlyph.setOutlineColor(uiTextColor);
app.draw(frameNumberGlyph);
}
{
Expand All @@ -235,7 +239,8 @@ void runStep(
frameNumberGlyph.setString(timeString.str());
frameNumberGlyph.setPosition(580, 457);
frameNumberGlyph.setCharacterSize(8);
frameNumberGlyph.setColor(uiTextColor);
frameNumberGlyph.setFillColor(uiTextColor);
frameNumberGlyph.setOutlineColor(uiTextColor);
app.draw(frameNumberGlyph);
}
/*{
Expand Down
4 changes: 0 additions & 4 deletions src/RenderWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,6 @@ struct RenderWindow {
// return renderWindow.getSize();
//}

sf::Image capture() const {
return renderWindow.capture();
}

//====== sf::RenderTarget functions ======
void clear(const sf::Color &color = sf::Color(0, 0, 0, 255)) {
return renderWindow.clear(color);
Expand Down
18 changes: 12 additions & 6 deletions src/RunningGameScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ run_game_scene(hg::RenderWindow &window, LoadedLevel &&loadedLevel, std::vector<
sf::Text replayGlyph;
replayGlyph.setFont(*hg::defaultFont);
replayGlyph.setString("R");
replayGlyph.setColor(sf::Color(255, 25, 50));
replayGlyph.setFillColor(sf::Color(255, 25, 50));
replayGlyph.setOutlineColor(sf::Color(255, 25, 50));
replayGlyph.setPosition(580, 32);
replayGlyph.setCharacterSize(32);
window.draw(replayGlyph);
Expand Down Expand Up @@ -452,7 +453,8 @@ void runStep(
currentPlayerGlyph.setString(currentPlayerIndex.str());
currentPlayerGlyph.setPosition(580, 433);
currentPlayerGlyph.setCharacterSize(10);
currentPlayerGlyph.setColor(uiTextColor);
currentPlayerGlyph.setFillColor(uiTextColor);
currentPlayerGlyph.setOutlineColor(uiTextColor);
app.draw(currentPlayerGlyph);
}
{
Expand All @@ -463,7 +465,8 @@ void runStep(
frameNumberGlyph.setString(frameNumberString.str());
frameNumberGlyph.setPosition(580, 445);
frameNumberGlyph.setCharacterSize(8);
frameNumberGlyph.setColor(uiTextColor);
frameNumberGlyph.setFillColor(uiTextColor);
frameNumberGlyph.setOutlineColor(uiTextColor);
app.draw(frameNumberGlyph);
}
{
Expand All @@ -474,7 +477,8 @@ void runStep(
frameNumberGlyph.setString(timeString.str());
frameNumberGlyph.setPosition(580, 457);
frameNumberGlyph.setCharacterSize(8);
frameNumberGlyph.setColor(uiTextColor);
frameNumberGlyph.setFillColor(uiTextColor);
frameNumberGlyph.setOutlineColor(uiTextColor);
app.draw(frameNumberGlyph);
}
{
Expand All @@ -494,7 +498,8 @@ void runStep(
numberOfFramesExecutedGlyph.setString(numberOfFramesExecutedString.str());
numberOfFramesExecutedGlyph.setPosition(580, 469);
numberOfFramesExecutedGlyph.setCharacterSize(8);
numberOfFramesExecutedGlyph.setColor(uiTextColor);
numberOfFramesExecutedGlyph.setFillColor(uiTextColor);
numberOfFramesExecutedGlyph.setOutlineColor(uiTextColor);
app.draw(numberOfFramesExecutedGlyph);
}
{
Expand All @@ -507,7 +512,8 @@ void runStep(
fpsglyph.setString(fpsstring.str());
fpsglyph.setPosition(600, 415);
fpsglyph.setCharacterSize(8);
fpsglyph.setColor(uiTextColor);
fpsglyph.setFillColor(uiTextColor);
fpsglyph.setOutlineColor(uiTextColor);
app.draw(fpsglyph);
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/SelectionScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ namespace hg {
sf::Text levelNameGlyph;
levelNameGlyph.setFont(*hg::defaultFont);
levelNameGlyph.setString(selected);
levelNameGlyph.setColor(sf::Color(255, 255, 255));
levelNameGlyph.setFillColor(sf::Color(255, 255, 255));
levelNameGlyph.setOutlineColor(sf::Color(255, 255, 255));
levelNameGlyph.setPosition(150, 120);
levelNameGlyph.setCharacterSize(32);
window.draw(levelNameGlyph);
Expand Down
3 changes: 2 additions & 1 deletion src/sfRenderTargetCanvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ class sfRenderTargetCanvas : public Canvas
glyphs.setString(sf::String(text));
glyphs.setPosition(x, y);
glyphs.setCharacterSize(static_cast<unsigned>(size));
glyphs.setColor(interpretAsColour(colour));
glyphs.setFillColor(interpretAsColour(colour));
glyphs.setOutlineColor(interpretAsColour(colour));
target->draw(glyphs);
}
virtual void drawImage(std::string const &key, float const x, float const y, float const width, float const height) override
Expand Down

0 comments on commit 18dda85

Please sign in to comment.