当前位置: 首页>>代码示例>>C++>>正文


C++ VM_Free函数代码示例

本文整理汇总了C++中VM_Free函数的典型用法代码示例。如果您正苦于以下问题:C++ VM_Free函数的具体用法?C++ VM_Free怎么用?C++ VM_Free使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了VM_Free函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: VM_Clear

/*
==============
VM_Clear
==============
*/
void VM_Clear(void) {
	int i;

	for (i=0;i<MAX_VM; i++) {
		VM_Free(&vmTable[i]);
	}
}
开发者ID:DerSaidin,项目名称:OpenWolf,代码行数:12,代码来源:vm.cpp

示例2: sizeof

vm_t *VM_Create( vmSlots_t vmSlot ) {
	vm_t *vm = NULL;

	// see if we already have the VM
	if ( vmTable[vmSlot] )
		return vmTable[vmSlot];

	// find a free vm
	vmTable[vmSlot] = (vm_t *)Z_Malloc( sizeof( *vm ), TAG_VM, qtrue );
	vm = vmTable[vmSlot];

	// initialise it
	vm->slot = vmSlot;
	Q_strncpyz( vm->name, vmNames[vmSlot], sizeof( vm->name ) );

	// find the module api
	FS_FindPureDLL( vm->name );
	Com_Printf( "VM_Create: %s"ARCH_STRING DLL_EXT, vm->name );
	vm->dllHandle = Sys_LoadGameDll( vm->name, &vm->GetModuleAPI );

	if ( vm->dllHandle ) {
		if ( com_developer->integer )	Com_Printf( " succeeded [0x%X+0x%X]\n", vm->dllHandle, (intptr_t)vm->GetModuleAPI - (intptr_t)vm->dllHandle );
		else							Com_Printf( " succeeded\n" );
		return vm;
	}

	VM_Free( vm );
	Com_Printf( " failed!\n" );
	return NULL;
}
开发者ID:Razish,项目名称:CompJA,代码行数:30,代码来源:vm.cpp

示例3: CL_InitUI

/*
====================
CL_InitUI
====================
*/
void CL_InitUI( void )
{
	int v;

	uivm = VM_Create( "ui", CL_UISystemCalls, VMI_NATIVE );

	if ( !uivm )
	{
		Com_Error( ERR_FATAL, "VM_Create on UI failed" );
	}

	// sanity check
	v = VM_Call( uivm, UI_GETAPIVERSION );

	if ( v != UI_API_VERSION )
	{
		// Free uivm now, so UI_SHUTDOWN doesn't get called later.
		VM_Free( uivm );
		uivm = NULL;

		Com_Error( ERR_FATAL, "User Interface is version %d, expected %d", v, UI_API_VERSION );
	}

	// init for this gamestate
	VM_Call( uivm, UI_INIT, ( cls.state >= CA_CONNECTING && cls.state < CA_ACTIVE ) );
}
开发者ID:ghostmod,项目名称:Unvanquished,代码行数:31,代码来源:cl_ui.c

示例4: VM_Clear

void VM_Clear( void ) {
	for ( int i=0; i<MAX_VM; i++ )
		VM_Free( vmTable[i] );

	currentVM = NULL;
	lastVM = NULL;
}
开发者ID:Razish,项目名称:CompJA,代码行数:7,代码来源:vm.cpp

示例5: memcpy

/*
=================
VM_Restart

Reload the data, but leave everything else in place
This allows a server to do a map_restart without changing memory allocation
=================
*/
vm_t *VM_Restart( vm_t *vm ) {
	vm_t saved;

	memcpy( &saved, vm, sizeof( saved ) );

	VM_Free( vm );

	return VM_Create( saved.slot );
}
开发者ID:Razish,项目名称:CompJA,代码行数:17,代码来源:vm.cpp

示例6: CLT3_ShutdownCGame

void CLT3_ShutdownCGame() {
	in_keyCatchers &= ~KEYCATCH_CGAME;
	cls.q3_cgameStarted = false;
	if ( !cgvm ) {
		return;
	}
	VM_Call( cgvm, CG_SHUTDOWN );
	VM_Free( cgvm );
	cgvm = NULL;
}
开发者ID:janisl,项目名称:jlquake,代码行数:10,代码来源:cgame.cpp

示例7: CL_ShutdownCGame

/*
====================
CL_ShutdonwCGame

====================
*/
void CL_ShutdownCGame( void ) {
	cls.keyCatchers &= ~KEYCATCH_CGAME;
	cls.cgameStarted = qfalse;
	if ( !cgvm ) {
		return;
	}
	VM_Call( cgvm, CG_SHUTDOWN );
	VM_Free( cgvm );
	cgvm = NULL;
}
开发者ID:wtfbbqhax,项目名称:thz,代码行数:16,代码来源:cl_cgame.c

示例8: CL_ShutdownUI

/*
====================
CL_ShutdownUI
====================
*/
void CL_ShutdownUI( void ) {
	Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_UI );
	cls.uiStarted = qfalse;
	if ( !uivm ) {
		return;
	}
	VM_Call( uivm, UI_SHUTDOWN );
	VM_Free( uivm );
	uivm = NULL;
}
开发者ID:BruceJohnJennerLawso,项目名称:quake3,代码行数:15,代码来源:cl_ui.c

示例9: CL_ShutdownUI

/*
====================
CL_ShutdownUI
====================
*/
void CL_ShutdownUI( void ) {
	cls.keyCatchers &= ~KEYCATCH_UI;
	cls.uiStarted = qfalse;
	if ( !uivm ) {
		return;
	}
	VM_Call( uivm, UI_SHUTDOWN );
	VM_Free( uivm );
	uivm = NULL;
}
开发者ID:he110world,项目名称:quake3-ios,代码行数:15,代码来源:cl_ui.c

示例10: CL_ShutdownCGame

/*
====================
CL_ShutdonwCGame

====================
*/
void CL_ShutdownCGame( void ) {
	Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_CGAME );
	cls.cgameStarted = qfalse;
	if ( !cgvm ) {
		return;
	}
	VM_Call( cgvm, CG_SHUTDOWN );
	VM_Free( cgvm );
	cgvm = NULL;
}
开发者ID:BruceJohnJennerLawso,项目名称:quake3,代码行数:16,代码来源:cl_cgame.c

示例11: VM_Free

// Reload the data, but leave everything else in place
// This allows a server to do a map_restart without changing memory allocation
vm_t *VM_Restart( vm_t *vm ) {
	const vm_t saved = *vm;

	VM_Free( vm );

	if ( saved.isLegacy )
		return VM_CreateLegacy( saved.slot, saved.legacy.syscall );
	else
		return VM_Create( saved.slot );
}
开发者ID:BruceJohnJennerLawso,项目名称:OpenJK,代码行数:12,代码来源:vm.cpp

示例12: memcpy

/*
=================
VM_Restart

Reload the data, but leave everything else in place
This allows a server to do a map_restart without changing memory allocation
=================
*/
vm_t *VM_Restart( vm_t *vm ) {
	vm_t saved;

	memcpy( &saved, vm, sizeof( saved ) );

	VM_Free( vm );

	if ( saved.isLegacy )
		return VM_CreateLegacy( saved.slot, saved.legacy.syscall );
	else
		return VM_Create( saved.slot );
}
开发者ID:Almightygir,项目名称:OpenJK,代码行数:20,代码来源:vm.cpp

示例13: SV_ShutdownGameProgs

/*
===============
SV_ShutdownGameProgs

Called every time a map changes
===============
*/
void SV_ShutdownGameProgs(void) {
	if(!gvm) {
		return;
	}

	VM_Call(gvm, GAME_SHUTDOWN, false);
	VM_Free(gvm);
	gvm = NULL;
	if ( sv_newGameShlib->string[0] ) {
		FS_Rename( sv_newGameShlib->string, "game" DLL_EXT);
		Cvar_Set( "sv_newGameShlib", "" );
	}
}
开发者ID:TheDushan,项目名称:OpenWolf,代码行数:20,代码来源:sv_game.cpp

示例14: CL_ShutdownUI

/*
====================
CL_ShutdownUI
====================
*/
void CL_ShutdownUI( void ) {
	Key_SetCatcher( Key_GetCatcher( ) & ~KEYCATCH_UI );
	cls.uiStarted = qfalse;
	if ( !uivm ) {
		return;
	}
	VM_Call( uivm, UI_SHUTDOWN );
	VM_Free( uivm );
	uivm = NULL;

#if EMSCRIPTEN
	cls.uiGlConfig = NULL;
	cls.numUiPatches = 0;
#endif
}
开发者ID:CarterTsai,项目名称:ioq3,代码行数:20,代码来源:cl_ui.c

示例15: intptr_t

/*
=================
VM_Restart

Reload the data, but leave everything else in place
This allows a server to do a map_restart without changing memory allocation
=================
*/
vm_t *VM_Restart( vm_t *vm ) {
	// DLL's can't be restarted in place
	char            name[MAX_QPATH];
	vmInterpret_t	interpret;

	intptr_t(*systemCall) (intptr_t * parms);

	systemCall = vm->systemCall;
	Q_strncpyz(name, vm->name, sizeof(name));
	interpret = vm->interpret;

	VM_Free(vm);

	vm = VM_Create(name, systemCall, interpret);
	return vm;
}
开发者ID:DerSaidin,项目名称:OpenWolf,代码行数:24,代码来源:vm.cpp


注:本文中的VM_Free函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。