Skip to content

Commit

Permalink
xrGame: fix Linux game running (disabled parallel task)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg committed Jun 22, 2020
1 parent 5e85db8 commit b1fc859
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/xrGame/GamePersistent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,19 @@ void CGamePersistent::OnAppStart()
Event materialsLoaded, globalsInitialized, menuCreated;

// init game globals
#ifndef XR_PLATFORM_WINDOWS
init_game_globals();
#else
TaskScheduler->AddTask("init_game_globals()", init_game_globals,
nullptr, nullptr, &globalsInitialized);

#endif
// load game materials
#ifndef XR_PLATFORM_WINDOWS
GMLib.Load();
#else
TaskScheduler->AddTask("GMLib.Load()", [&]()
{
GEnv.Render->MakeContextCurrent(IRender::HelperContext); // free to use, so let's use it
GMLib.Load();
GEnv.Render->MakeContextCurrent(IRender::NoContext); // release it for other users
}, nullptr, nullptr, &materialsLoaded);
#endif

SetupUIStyle();
GEnv.UI = xr_new<UICore>();
Expand All @@ -252,7 +251,10 @@ void CGamePersistent::OnAppStart()
ansel->Init();
#endif


#ifdef XR_PLATFORM_WINDOWS
Device.WaitEvent(globalsInitialized);
#endif
Device.WaitEvent(menuCreated);
Device.WaitEvent(materialsLoaded);
}
Expand Down

0 comments on commit b1fc859

Please sign in to comment.