Bazaar developer reference

CvDllGameContext::InitializeSingleton()

Defined in
CvDllContext.cpp, line 133
Class
CvDllGameContext
Hook name
CivHooks::CvDllGameContext_InitializeSingleton

Hooks

static bool BeforeCvDllGameContext_InitializeSingleton();static void AfterCvDllGameContext_InitializeSingleton();static void ReplaceCvDllGameContext_InitializeSingleton(void (*original)());CivRegisterBefore<CivHooks::CvDllGameContext_InitializeSingleton>(host, &BeforeCvDllGameContext_InitializeSingleton);CivRegisterAfter<CivHooks::CvDllGameContext_InitializeSingleton>(host, &AfterCvDllGameContext_InitializeSingleton);CivRegisterReplace<CivHooks::CvDllGameContext_InitializeSingleton>(host, &ReplaceCvDllGameContext_InitializeSingleton);

Code

133void CvDllGameContext::InitializeSingleton()134{135	if(s_pSingleton == NULL)136	{137		FAssert(s_hHeap == INVALID_HANDLE_VALUE);138		s_hHeap = HeapCreate(0, 0, 0);139140		//141		// Enable the low-fragmentation heap (LFH). Starting with Windows Vista,142		// the LFH is enabled by default but this call does not cause an error.143		//144		ULONG HeapInformation = 2;	//Low Fragmentation Heap145		HeapSetInformation(s_hHeap,146		                   HeapCompatibilityInformation,147		                   &HeapInformation,148		                   sizeof(HeapInformation));149150	}151	s_pSingleton = FNEW(CvDllGameContext(), c_eCiv5GameplayDLL, 0);152153#if defined(CUSTOM_MODS_H)154	CUSTOMLOG("%s - Startup (Version %u%s - Build %s %s%s)", MOD_DLL_NAME, MOD_DLL_VERSION_NUMBER, MOD_DLL_VERSION_STATUS, __DATE__, __TIME__, MOD_DLL_CUSTOM_BUILD_NAME);155#if defined(MOD_GLOBAL_MAX_MAJOR_CIVS)156	CUSTOMLOG(" - supporting %i major civilizations", MAX_MAJOR_CIVS);157#endif158#endif159}

Calls

Called by