Skip to content

Commit

Permalink
update to newest sfml
Browse files Browse the repository at this point in the history
  • Loading branch information
vittorioromeo committed Jun 9, 2024
1 parent 6cf66cf commit 13ff8ee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ set(SFML_ENABLE_PCH true)
CPMAddPackage(
NAME SFML
GITHUB_REPOSITORY vittorioromeo/SFML
GIT_TAG 17879283be7a95fd66ce76e61410ebee299819ba
GIT_TAG 4c7cbd9390baf2af479e610529bf3597b18ed4ec
)

set_target_properties(sfml-system PROPERTIES UNITY_BUILD OFF)
Expand Down
9 changes: 3 additions & 6 deletions src/SSVOpenHexagon/Core/Audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,9 @@ class Audio::AudioImpl
return false;
}

if (!_music.has_value())
{
_music.emplace();
}

if (_lastLoadedMusicPath != *path)
{
if (!_music->openFromFile(*path))
if (!(_music = sf::Music::openFromFile(*path)))
{
ssvu::lo("hg::AudioImpl::playMusic")
<< "Failed loading music file '" << path << "'\n";
Expand All @@ -198,6 +193,8 @@ class Audio::AudioImpl
_lastLoadedMusicPath = *path;
}

SSVOH_ASSERT(_music.has_value());

_music->setLoop(true);
setMusicPlayingOffsetSeconds(playingOffsetSeconds);
resumeMusic();
Expand Down
4 changes: 1 addition & 3 deletions src/SSVOpenHexagon/Global/Assets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,7 @@ HGAssets::HGAssetsImpl::~HGAssetsImpl()
return *ptr;
}

std::cerr << "Fatal error: missing sound file '" << mId << '\''
<< std::endl;

std::cerr << "Fatal error: missing font file '" << mId << '\'' << std::endl;
std::terminate();
}

Expand Down

0 comments on commit 13ff8ee

Please sign in to comment.