Changeset View
Changeset View
Standalone View
Standalone View
source/ps/GameSetup/GameSetup.cpp
Show First 20 Lines • Show All 355 Lines • ▼ Show 20 Lines | if (hasRenderer) | ||||
TIMER_BEGIN(L"shutdown Renderer"); | TIMER_BEGIN(L"shutdown Renderer"); | ||||
g_Renderer.~CRenderer(); | g_Renderer.~CRenderer(); | ||||
g_VBMan.Shutdown(); | g_VBMan.Shutdown(); | ||||
TIMER_END(L"shutdown Renderer"); | TIMER_END(L"shutdown Renderer"); | ||||
} | } | ||||
g_RenderingOptions.ClearHooks(); | g_RenderingOptions.ClearHooks(); | ||||
g_Profiler2.ShutdownGPU(); | g_Profiler2->ShutdownGPU(); | ||||
TIMER_BEGIN(L"shutdown SDL"); | TIMER_BEGIN(L"shutdown SDL"); | ||||
ShutdownSDL(); | ShutdownSDL(); | ||||
TIMER_END(L"shutdown SDL"); | TIMER_END(L"shutdown SDL"); | ||||
if (hasRenderer) | if (hasRenderer) | ||||
g_VideoMode.Shutdown(); | g_VideoMode.Shutdown(); | ||||
▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
#else | #else | ||||
static void FixLocales() | static void FixLocales() | ||||
{ | { | ||||
// Do nothing on Windows | // Do nothing on Windows | ||||
} | } | ||||
#endif | #endif | ||||
void EarlyInit() | void EarliestInit() | ||||
{ | { | ||||
// If you ever want to catch a particular allocation: | // If you ever want to catch a particular allocation: | ||||
//_CrtSetBreakAlloc(232647); | //_CrtSetBreakAlloc(232647); | ||||
Threading::SetMainThread(); | Threading::SetMainThread(); | ||||
debug_SetThreadName("main"); | debug_SetThreadName("main"); | ||||
// add all debug_printf "tags" that we are interested in: | // add all debug_printf "tags" that we are interested in: | ||||
debug_filter_add("TIMER"); | debug_filter_add("TIMER"); | ||||
debug_filter_add("FILES"); | debug_filter_add("FILES"); | ||||
timer_Init(); | timer_Init(); | ||||
} | |||||
// initialise profiler early so it can profile startup, | void EarlyInit() | ||||
// but only after LatchStartTime | { | ||||
g_Profiler2.Initialise(); | |||||
FixLocales(); | FixLocales(); | ||||
// Because we do GL calls from a secondary thread, Xlib needs to | // Because we do GL calls from a secondary thread, Xlib needs to | ||||
// be told to support multiple threads safely. | // be told to support multiple threads safely. | ||||
// This is needed for Atlas, but we have to call it before any other | // This is needed for Atlas, but we have to call it before any other | ||||
// Xlib functions (e.g. the ones used when drawing the main menu | // Xlib functions (e.g. the ones used when drawing the main menu | ||||
// before launching Atlas) | // before launching Atlas) | ||||
#if MUST_INIT_X11 | #if MUST_INIT_X11 | ||||
▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | #endif | ||||
new L10n; | new L10n; | ||||
// Optionally start profiler HTTP output automatically | // Optionally start profiler HTTP output automatically | ||||
// (By default it's only enabled by a hotkey, for security/performance) | // (By default it's only enabled by a hotkey, for security/performance) | ||||
bool profilerHTTPEnable = false; | bool profilerHTTPEnable = false; | ||||
CFG_GET_VAL("profiler2.autoenable", profilerHTTPEnable); | CFG_GET_VAL("profiler2.autoenable", profilerHTTPEnable); | ||||
if (profilerHTTPEnable) | if (profilerHTTPEnable) | ||||
g_Profiler2.EnableHTTP(); | g_Profiler2->EnableHTTP(); | ||||
// Initialise everything except Win32 sockets (because our networking | // Initialise everything except Win32 sockets (because our networking | ||||
// system already inits those) | // system already inits those) | ||||
curl_global_init(CURL_GLOBAL_ALL & ~CURL_GLOBAL_WIN32); | curl_global_init(CURL_GLOBAL_ALL & ~CURL_GLOBAL_WIN32); | ||||
if (!g_Quickstart) | if (!g_Quickstart) | ||||
g_UserReporter.Initialize(); // after config | g_UserReporter.Initialize(); // after config | ||||
Show All 15 Lines | void InitGraphics(const CmdLineArgs& args, int flags, const std::vector<CStr>& installedMods) | ||||
RunHardwareDetection(); | RunHardwareDetection(); | ||||
// Optionally start profiler GPU timings automatically | // Optionally start profiler GPU timings automatically | ||||
// (By default it's only enabled by a hotkey, for performance/compatibility) | // (By default it's only enabled by a hotkey, for performance/compatibility) | ||||
bool profilerGPUEnable = false; | bool profilerGPUEnable = false; | ||||
CFG_GET_VAL("profiler2.autoenable", profilerGPUEnable); | CFG_GET_VAL("profiler2.autoenable", profilerGPUEnable); | ||||
if (profilerGPUEnable) | if (profilerGPUEnable) | ||||
g_Profiler2.EnableGPU(); | g_Profiler2->EnableGPU(); | ||||
if(!g_Quickstart) | if(!g_Quickstart) | ||||
{ | { | ||||
WriteSystemInfo(); | WriteSystemInfo(); | ||||
// note: no longer vfs_display here. it's dog-slow due to unbuffered | // note: no longer vfs_display here. it's dog-slow due to unbuffered | ||||
// file output and very rarely needed. | // file output and very rarely needed. | ||||
} | } | ||||
▲ Show 20 Lines • Show All 492 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator