diff --git a/crogine.sln b/crogine.sln index 7dcd9eab7..5c3362dfb 100644 --- a/crogine.sln +++ b/crogine.sln @@ -669,8 +669,8 @@ Global {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|Any CPU.ActiveCfg = Debug|Win32 {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|ARM.ActiveCfg = Debug|Win32 {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|ARM64.ActiveCfg = Debug|Win32 - {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|x64.ActiveCfg = Debug|x64 - {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|x64.Build.0 = Debug|x64 + {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|x64.ActiveCfg = DebugGNS|x64 + {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|x64.Build.0 = DebugGNS|x64 {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|x86.ActiveCfg = Debug|Win32 {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Debug|x86.Build.0 = Debug|Win32 {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.DebugASan|Any CPU.ActiveCfg = DebugASan|Win32 @@ -703,8 +703,8 @@ Global {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release|Any CPU.ActiveCfg = Release|Win32 {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release|ARM.ActiveCfg = Release|Win32 {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release|ARM64.ActiveCfg = Release|Win32 - {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release|x64.ActiveCfg = Release|x64 - {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release|x64.Build.0 = Release|x64 + {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release|x64.ActiveCfg = ReleaseGNS|x64 + {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release|x64.Build.0 = ReleaseGNS|x64 {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release|x86.ActiveCfg = Release|Win32 {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release|x86.Build.0 = Release|Win32 {B1559428-CDF8-4797-8766-0EA62BDD6D1B}.Release-asan|Any CPU.ActiveCfg = Release-asan|Win32 diff --git a/crogine/src/audio/OpenALImpl.cpp b/crogine/src/audio/OpenALImpl.cpp index 7f887954e..76a7404bd 100644 --- a/crogine/src/audio/OpenALImpl.cpp +++ b/crogine/src/audio/OpenALImpl.cpp @@ -907,7 +907,11 @@ void OpenALImpl::refreshDeviceList() next += (len + 2); } } - m_devices.push_back("Default"); + + if (m_devices.empty()) + { + m_devices.push_back("Default"); + } } else { diff --git a/samples/golf/buildnumber.h b/samples/golf/buildnumber.h index b90cd9df5..f386a8723 100644 --- a/samples/golf/buildnumber.h +++ b/samples/golf/buildnumber.h @@ -3,7 +3,7 @@ #ifndef BUILD_NUMBER_H_ #define BUILD_NUMBER_H_ -#define BUILDNUMBER 7176 -#define BUILDNUMBER_STR "7176" +#define BUILDNUMBER 7181 +#define BUILDNUMBER_STR "7181" #endif /* BUILD_NUMBER_H_ */ diff --git a/samples/golf/src/GolfGame.cpp b/samples/golf/src/GolfGame.cpp index 277b48956..e05a174d0 100644 --- a/samples/golf/src/GolfGame.cpp +++ b/samples/golf/src/GolfGame.cpp @@ -831,6 +831,13 @@ bool GolfGame::initialise() } }); + registerCommand("scrub", + [&](const std::string&) + { + m_stateStack.clearStates(); + m_stateStack.pushState(StateID::ScrubBackground); + }); + getWindow().setLoadingScreen(m_sharedData); getWindow().setTitle("Super Video Golf - " + StringVer); getWindow().setIcon(icon); @@ -973,6 +980,7 @@ bool GolfGame::initialise() //m_stateStack.pushState(StateID::Workshop); #else m_stateStack.pushState(StateID::SplashScreen); + //m_stateStack.pushState(StateID::ScrubBackground); #endif applyImGuiStyle(m_sharedData); diff --git a/samples/golf/src/scrub/ScrubAttractState.cpp b/samples/golf/src/scrub/ScrubAttractState.cpp index a6c713f58..69b3bbcdb 100644 --- a/samples/golf/src/scrub/ScrubAttractState.cpp +++ b/samples/golf/src/scrub/ScrubAttractState.cpp @@ -239,9 +239,13 @@ bool ScrubAttractState::handleEvent(const cro::Event& evt) || evt.caxis.value > cro::GameController::LeftThumbDeadZone) { m_controllerIndex = cro::GameController::controllerID(evt.caxis.which); + cro::App::getWindow().setMouseCaptured(true); } } - + else if (evt.type == SDL_MOUSEMOTION) + { + cro::App::getWindow().setMouseCaptured(false); + } m_gameScene.forwardEvent(evt); m_uiScene.forwardEvent(evt); @@ -398,6 +402,7 @@ void ScrubAttractState::buildScene() //title background - remember sprites are added to the spriteNode of the current tab for correct scaling... auto& bgTex = m_resources.textures.get("assets/arcade/scrub/images/attract_bg.png"); + bgTex.setSmooth(true); entity = m_uiScene.createEntity(); entity.addComponent() = as.getEmitter("menu_show"); entity.addComponent().setPosition(glm::vec3(size / 2.f, sc::UIBackgroundDepth)); @@ -506,6 +511,7 @@ void ScrubAttractState::buildScene() //help background auto& helpTex = m_resources.textures.get("assets/arcade/scrub/images/rules_bg.png"); + helpTex.setSmooth(true); entity = m_uiScene.createEntity(); entity.addComponent().setPosition(glm::vec3(size / 2.f, sc::UIBackgroundDepth)); entity.addComponent(); @@ -597,6 +603,7 @@ void ScrubAttractState::buildScene() //score background auto& scoreTex = m_resources.textures.get("assets/arcade/scrub/images/highscore_bg.png"); + scoreTex.setSmooth(true); entity = m_uiScene.createEntity(); entity.addComponent().setPosition(glm::vec3(size / 2.f, sc::UIBackgroundDepth)); entity.addComponent(); diff --git a/samples/golf/src/scrub/ScrubGameState.cpp b/samples/golf/src/scrub/ScrubGameState.cpp index 6265c2a6b..2d39eb838 100644 --- a/samples/golf/src/scrub/ScrubGameState.cpp +++ b/samples/golf/src/scrub/ScrubGameState.cpp @@ -116,7 +116,7 @@ ScrubGameState::ScrubGameState(cro::StateStack& stack, cro::State::Context conte m_sharedData (sd), m_sharedScrubData (sc), m_soundDirector (nullptr), - m_gameScene (context.appInstance.getMessageBus()), + m_gameScene (context.appInstance.getMessageBus(), 854), m_uiScene (context.appInstance.getMessageBus(), 512), m_pitchStage (0), m_soapAnimationActive (false), @@ -358,6 +358,7 @@ bool ScrubGameState::handleEvent(const cro::Event& evt) || evt.caxis.value > cro::GameController::LeftThumbDeadZone) { m_controllerIndex = cro::GameController::controllerID(evt.caxis.which); + cro::App::getWindow().setMouseCaptured(true); } } else if (evt.type == SDL_CONTROLLERDEVICEREMOVED) @@ -371,6 +372,10 @@ bool ScrubGameState::handleEvent(const cro::Event& evt) cro::GameController::applyDSTriggerEffect(i, cro::GameController::DSTriggerBoth, cro::GameController::DSEffect::createWeapon(0, 1, 2)); } } + else if (evt.type == SDL_MOUSEMOTION) + { + cro::App::getWindow().setMouseCaptured(false); + } else if (evt.type == SDL_KEYUP || evt.type == SDL_CONTROLLERBUTTONUP) @@ -446,8 +451,8 @@ bool ScrubGameState::simulate(float dt) auto oldTime = m_score.remainingTime; m_score.totalRunTime += dt; -#ifndef CRO_DEBUG_ m_score.remainingTime = std::max(m_score.remainingTime - dt, 0.f); +#ifndef CRO_DEBUG_ #endif switch (m_pitchStage) { @@ -1583,7 +1588,7 @@ void ScrubGameState::createCountIn() if (ct == 1) { g.getComponent().active = false; - m_uiScene.destroyEntity(e); + m_uiScene.destroyEntity(g); } }; @@ -1596,12 +1601,6 @@ void ScrubGameState::createCountIn() else { //go - if (t < 0) - { - e.getComponent().active = false; - m_uiScene.destroyEntity(e); - } - const glm::vec2 winSize(cro::App::getWindow().getSize()); const auto progress = 1.f - std::max(0.f, std::min(1.f, t / (GoTime / 2.f))); @@ -1613,6 +1612,12 @@ void ScrubGameState::createCountIn() static constexpr float Stretch = 1.52f; e.getComponent().setScale({ 1.f + (progress * Stretch), 1.f - (progress * Stretch) }); + + if (t < 0) + { + e.getComponent().active = false; + m_uiScene.destroyEntity(e); + } } }; diff --git a/samples/golf/src/scrub/ScrubPauseState.cpp b/samples/golf/src/scrub/ScrubPauseState.cpp index ffd942669..a96343c16 100644 --- a/samples/golf/src/scrub/ScrubPauseState.cpp +++ b/samples/golf/src/scrub/ScrubPauseState.cpp @@ -103,8 +103,13 @@ bool ScrubPauseState::handleEvent(const cro::Event& evt) || evt.caxis.value > cro::GameController::LeftThumbDeadZone) { m_controllerIndex = cro::GameController::controllerID(evt.caxis.which); + cro::App::getWindow().setMouseCaptured(true); } } + else if (evt.type == SDL_MOUSEMOTION) + { + cro::App::getWindow().setMouseCaptured(false); + } m_uiScene.forwardEvent(evt); return false;