예제 #1
0
BOOL APIENTRY DllMain		(HANDLE module_handle, DWORD call_reason, LPVOID reserved)
{
	switch (call_reason) {
		case DLL_PROCESS_ATTACH: {
//			g_temporary_stuff			= &trivial_encryptor::decode;

			xrDebug::Initialize(false);
 			Core._initialize			("xrSE_Factory",NULL,TRUE,"fsfactory.ltx");
			string_path					SYSTEM_LTX;
			FS.update_path				(SYSTEM_LTX,"$game_config$","system.ltx");
			pSettings					= new CInifile(SYSTEM_LTX);

			setup_luabind_allocator		();

			CCharacterInfo::InitInternal					();
			CSpecificCharacter::InitInternal				();

			break;
		}
		case DLL_PROCESS_DETACH: {
			CCharacterInfo::DeleteSharedData				();
			CCharacterInfo::DeleteIdToIndexData				();
			CSpecificCharacter::DeleteSharedData			();
			CSpecificCharacter::DeleteIdToIndexData			();


			xr_delete					(g_object_factory);
			xr_delete					(pSettings);
			xr_delete					(g_property_list_helper);
			xr_delete					(g_ai_space);
			xr_delete					(g_object_factory);
			if (prop_helper_module)
				FreeLibrary				(prop_helper_module);
			Core._destroy				();
			break;
		}
	}
    return				(TRUE);
}
예제 #2
0
BOOL APIENTRY DllMain(HANDLE hModule, u32 ul_reason_for_call, LPVOID lpReserved)
{
	switch (ul_reason_for_call) {
		case DLL_PROCESS_ATTACH: {
			// register console commands
			CCC_RegisterCommands();
			// keyboard binding
			CCC_RegisterInput	();

			setup_luabind_allocator	();
#ifdef DEBUG
			g_profiler			= xr_new<CProfiler>();
#endif
			break;
		}

		case DLL_PROCESS_DETACH: {
			break;
		}
	}
    return								(TRUE);
}