Skip to content

Commit

Permalink
[REMOVE LATER] Add artificial delays to object and scenario repos
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronVanGeffen committed May 6, 2024
1 parent e3e9829 commit 80bd69a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/openrct2/object/ObjectRepository.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@

using namespace OpenRCT2;

// TODO: remove after we've finished testing preloader
#include <chrono>
#include <thread>
using namespace std::this_thread;
using namespace std::chrono_literals;
using std::chrono::system_clock;

struct ObjectEntryHash
{
size_t operator()(const RCTObjectEntry& entry) const
Expand Down Expand Up @@ -396,6 +403,9 @@ class ObjectRepository final : public IObjectRepository
{
GetContext()->SetProgress(i + 1, items.size());

// TODO: remove after we've finished testing preloader
sleep_until(system_clock::now() + 1ms);

const auto& item = items[i];
if (!AddItem(item))
{
Expand Down
10 changes: 10 additions & 0 deletions src/openrct2/scenario/ScenarioRepository.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@

using namespace OpenRCT2;

// TODO: remove after we've finished testing preloader
#include <chrono>
#include <thread>
using namespace std::this_thread;
using namespace std::chrono_literals;
using std::chrono::system_clock;

static int32_t ScenarioCategoryCompare(int32_t categoryA, int32_t categoryB)
{
if (categoryA == categoryB)
Expand Down Expand Up @@ -368,6 +375,9 @@ class ScenarioRepository final : public IScenarioRepository
{
GetContext()->SetProgress(i + 1, scenarios.size());

// TODO: remove after we've finished testing preloader
sleep_until(system_clock::now() + 1ms);

const auto& scenario = scenarios[i];
AddScenario(scenario);
}
Expand Down

0 comments on commit 80bd69a

Please sign in to comment.