diff --git a/CHANGELOG.md b/CHANGELOG.md index ee814a444a..6650f99d02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -254,6 +254,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Fixed a minor inconsistency where `ACDropShip`s were frequently referred to as `ACDropship`s in Lua, the lower case 's' invalidating keywords where the typo occured. +- Fixed an issue where the buy menu GUI could ignore mouse hover events until you clicked to reset the focus. +
Removed diff --git a/Source/Managers/MovableMan.cpp b/Source/Managers/MovableMan.cpp index a1722d28e6..e68d56cf0d 100644 --- a/Source/Managers/MovableMan.cpp +++ b/Source/Managers/MovableMan.cpp @@ -12,7 +12,6 @@ #include "Controller.h" #include "AtomGroup.h" #include "Actor.h" -#include "HeldDevice.h" #include "ADoor.h" #include "Atom.h" #include "Scene.h" @@ -1314,6 +1313,9 @@ void MovableMan::Update() { g_SceneMan.GetScene()->BlockUntilAllPathingRequestsComplete(); } + // Finish our Seeing rays from last frame + m_ActorsSeeFuture.wait(); + // Prior to controller/AI update, execute lua callbacks g_LuaMan.ExecuteLuaScriptCallbacks(); @@ -1395,18 +1397,6 @@ void MovableMan::Update() { g_PerformanceMan.StopPerformanceMeasurement(PerformanceMan::ScriptsUpdate); { - auto actorsSeeFuture = g_ThreadMan.GetPriorityThreadPool().parallelize_loop(m_Actors.size(), - [&](int start, int end) { - ZoneScopedN("Actors See"); - for (int i = start; i < end; ++i) { - // TODO - this null check really shouldn't be required. There's almost definitely an issue where the actor update can somehow fuck with this mid-update - // this is VERY bad, and needs investigation! - if (m_Actors[i]) { - m_Actors[i]->CastSeeRays(); - } - } - }); - { ZoneScopedN("Actors Update"); @@ -1478,8 +1468,6 @@ void MovableMan::Update() { particle->PostUpdate(); } } - - actorsSeeFuture.wait(); } // namespace RTE ////////////////////////////////////////////////////////////////////// @@ -1679,6 +1667,15 @@ void MovableMan::Update() { } } + // Run seeing rays for all actors + m_ActorsSeeFuture = g_ThreadMan.GetPriorityThreadPool().parallelize_loop(m_Actors.size(), + [&](int start, int end) { + ZoneScopedN("Actors See"); + for (int i = start; i < end; ++i) { + m_Actors[i]->CastSeeRays(); + } + }); + // We've finished stuff that can interact with lua script, so it's the ideal time to start a gc run g_LuaMan.StartAsyncGarbageCollection(); diff --git a/Source/Managers/MovableMan.h b/Source/Managers/MovableMan.h index 00e2ba6141..3a4183a5ce 100644 --- a/Source/Managers/MovableMan.h +++ b/Source/Managers/MovableMan.h @@ -9,6 +9,8 @@ #include "Singleton.h" #include "Activity.h" +#include "BS_thread_pool.hpp" + #include #include #include @@ -596,6 +598,9 @@ namespace RTE { // Async to draw MOIDs while rendering std::future m_DrawMOIDsTask; + // Async to have actors see in parallel + BS::multi_future m_ActorsSeeFuture; + // Roster of each team's actors, sorted by their X positions in the scene. Actors not owned here std::list m_ActorRoster[Activity::MaxTeamCount]; // Whether to draw HUD lines between the actors of a specific team diff --git a/Source/Menus/BuyMenuGUI.cpp b/Source/Menus/BuyMenuGUI.cpp index ae00f1cd35..7705401a15 100644 --- a/Source/Menus/BuyMenuGUI.cpp +++ b/Source/Menus/BuyMenuGUI.cpp @@ -744,6 +744,9 @@ void BuyMenuGUI::Update() { // Animate the menu into and out of view if enabled or disabled if (m_MenuEnabled == ENABLING) { + // Make sure that nobody can hoard focus away from us + m_pGUIController->GetManager()->ReleaseMouse(); + m_pParentBox->SetEnabled(true); m_pParentBox->SetVisible(true); diff --git a/Source/System/RTETools.cpp b/Source/System/RTETools.cpp index a0b3a9c090..9e3e1572d5 100644 --- a/Source/System/RTETools.cpp +++ b/Source/System/RTETools.cpp @@ -50,19 +50,6 @@ namespace RTE { float angleDelta = std::fmod(endRot.GetRadAngle() - startRot.GetRadAngle(), fullTurn); float angleDistance = std::fmod(angleDelta * 2.0F, fullTurn) - angleDelta; return Matrix(startRot.GetRadAngle() + (angleDistance * Lerp(scaleStart, scaleEnd, 0.0F, 1.0F, progressScalar))); - - float startRad = startRot.GetRadAngle(); - float endRad = endRot.GetRadAngle(); - float diff = startRad - endRad; - if (diff > c_PI) { - std::swap(startRad, endRad); - diff -= c_PI; - } else if (diff < -c_PI) { - std::swap(startRad, endRad); - diff += c_PI; - } - - return Matrix(startRad + (diff * Lerp(scaleStart, scaleEnd, 0.0F, 1.0F, progressScalar))); } float EaseIn(float start, float end, float progressScalar) {