|
12 | 12 | #include "Controller.h"
|
13 | 13 | #include "AtomGroup.h"
|
14 | 14 | #include "Actor.h"
|
15 |
| -#include "HeldDevice.h" |
16 | 15 | #include "ADoor.h"
|
17 | 16 | #include "Atom.h"
|
18 | 17 | #include "Scene.h"
|
@@ -1314,6 +1313,9 @@ void MovableMan::Update() {
|
1314 | 1313 | g_SceneMan.GetScene()->BlockUntilAllPathingRequestsComplete();
|
1315 | 1314 | }
|
1316 | 1315 |
|
| 1316 | + // Finish our Seeing rays from last frame |
| 1317 | + m_ActorsSeeFuture.wait(); |
| 1318 | + |
1317 | 1319 | // Prior to controller/AI update, execute lua callbacks
|
1318 | 1320 | g_LuaMan.ExecuteLuaScriptCallbacks();
|
1319 | 1321 |
|
@@ -1395,18 +1397,6 @@ void MovableMan::Update() {
|
1395 | 1397 | g_PerformanceMan.StopPerformanceMeasurement(PerformanceMan::ScriptsUpdate);
|
1396 | 1398 |
|
1397 | 1399 | {
|
1398 |
| - auto actorsSeeFuture = g_ThreadMan.GetPriorityThreadPool().parallelize_loop(m_Actors.size(), |
1399 |
| - [&](int start, int end) { |
1400 |
| - ZoneScopedN("Actors See"); |
1401 |
| - for (int i = start; i < end; ++i) { |
1402 |
| - m_Actors[i]->CastSeeRays(); |
1403 |
| - } |
1404 |
| - }); |
1405 |
| - |
1406 |
| - // TODO- right now RemoveActor just removes to actor directly (instead of setting it disabled and delaying the actual remoal), meaning that actorsSeeFuture must be finished immediately |
1407 |
| - // This isn't ideal, as we'd prefer to be able to run the actor/items/particle update in parallel |
1408 |
| - actorsSeeFuture.wait(); |
1409 |
| - |
1410 | 1400 | {
|
1411 | 1401 | ZoneScopedN("Actors Update");
|
1412 | 1402 |
|
@@ -1478,9 +1468,6 @@ void MovableMan::Update() {
|
1478 | 1468 | particle->PostUpdate();
|
1479 | 1469 | }
|
1480 | 1470 | }
|
1481 |
| - |
1482 |
| - // See above TODO - this is only commented out because of how RemoveActor currently works |
1483 |
| - //actorsSeeFuture.wait(); |
1484 | 1471 | } // namespace RTE
|
1485 | 1472 |
|
1486 | 1473 | //////////////////////////////////////////////////////////////////////
|
@@ -1680,6 +1667,15 @@ void MovableMan::Update() {
|
1680 | 1667 | }
|
1681 | 1668 | }
|
1682 | 1669 |
|
| 1670 | + // Run seeing rays for all actors |
| 1671 | + m_ActorsSeeFuture = g_ThreadMan.GetPriorityThreadPool().parallelize_loop(m_Actors.size(), |
| 1672 | + [&](int start, int end) { |
| 1673 | + ZoneScopedN("Actors See"); |
| 1674 | + for (int i = start; i < end; ++i) { |
| 1675 | + m_Actors[i]->CastSeeRays(); |
| 1676 | + } |
| 1677 | + }); |
| 1678 | + |
1683 | 1679 | // We've finished stuff that can interact with lua script, so it's the ideal time to start a gc run
|
1684 | 1680 | g_LuaMan.StartAsyncGarbageCollection();
|
1685 | 1681 |
|
|
0 commit comments