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


C++ UserHeapPtr类代码示例

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


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

示例1: readRAW

//---------------------------------------------------------------------------
long File::readRAW (unsigned long * &buffer, UserHeapPtr heap)
{
	long result = 0;
	
	if (fastFile && heap && fastFile->isLZCompressed())
	{
		long lzSizeNeeded = fastFile->lzSizeFast(fastFileHandle);
		buffer = (unsigned long *)heap->Malloc(lzSizeNeeded);

		result = fastFile->readFastRAW(fastFileHandle,buffer,lzSizeNeeded);
		logicalPosition += result;
	}
	
	return result;
}
开发者ID:wolfman-x,项目名称:mechcommander2,代码行数:16,代码来源:file.cpp

示例2: destroy

void SensorSystemManager::destroy (void) {

	if (sensorPool)
	{
		for (long i = 0; i < MAX_SENSORS; i++) 
		{
			delete sensorPool[i];
			sensorPool[i] = NULL;
		}
		
		missionHeap->Free(sensorPool);
		sensorPool = NULL;
	}

	freeSensors = 0;
	freeList = NULL;

	for (long i = 0; i < Team::numTeams; i++) 
	{
		delete teamSensors[i];
		teamSensors[i] = NULL;
	}

	if (SensorSystem::sortList)
	{
		delete SensorSystem::sortList;
		SensorSystem::sortList = NULL;
	}
}
开发者ID:Ariemeth,项目名称:MechCommander2HD,代码行数:29,代码来源:Contact.cpp

示例3: TerminateGameEngine

void __stdcall TerminateGameEngine()
{
	if(pMechlopedia)
		delete pMechlopedia;
	if(userInput)
		delete userInput;
	if(soundSystem)
		delete soundSystem;
	if(pLogData)
		delete pLogData;
	//------------------------------------------------
	// shutdown the MC Texture Manager.
	if(mcTextureManager)
	{
		mcTextureManager->destroy();
		delete mcTextureManager;
		mcTextureManager = nullptr;
	}
	//--------------------------------------------------------------
	// End the SystemHeap and globalHeapList
	if(systemHeap)
	{
		systemHeap->destroy();
		delete systemHeap;
		systemHeap = nullptr;
	}
	if(globalHeapList)
	{
		globalHeapList->destroy();
		delete globalHeapList;
		globalHeapList = nullptr;
	}
	//----------------------------------------------------
	// Shutdown the MLR and associated stuff libraries
	//----------------------------------------------------
	gos_PushCurrentHeap(gosFX::Heap);
	delete effectStream;
	delete gosFX::LightManager::Instance;
	gos_PopCurrentHeap();
	//
	//-------------------
	// Turn off libraries
	//-------------------
	//
	gosFX::TerminateClasses();
	MidLevelRenderer::TerminateClasses();
	Stuff::TerminateClasses();
	//Redundant. Something else is shutting this down.
	//GOS sure does think its bad to delete something multiple times though.
	//Even though it simply never is!
	//gos_DeleteFont(gosFontHandle);
	gos_CloseResourceDLL(gosResourceHandle);
	//
	//--------------------------
	// Turn off the fast Files
	//--------------------------
	//
	FastFileFini();
}
开发者ID:BobrDobr69,项目名称:mechcommander2,代码行数:59,代码来源:view.cpp

示例4: destroy

void GoalManager::destroy (void) {

	if (goalObjectPool) {
		missionHeap->Free(goalObjectPool);
		goalObjectPool = NULL;
	}
	numGoalObjects = 0;
	goalObjectPoolSize = 0;
}
开发者ID:Jacic,项目名称:MechCommander2,代码行数:9,代码来源:goal.cpp

示例5: setup

void GoalManager::setup (long poolSize) {

	goalObjectPoolSize = poolSize;
	if (goalObjectPoolSize  < 10)
		Fatal(0, " GoalManager.setup: goalObjectPoolSize must be greater than 10 ");

	goalObjectPool = (GoalObjectPtr)missionHeap->Malloc(sizeof(GoalObject) * goalObjectPoolSize);
	clear();
}
开发者ID:Jacic,项目名称:MechCommander2,代码行数:9,代码来源:goal.cpp

示例6: init

long SensorSystemManager::init (bool debug) {

	if (MAX_SENSORS < 2)
		Fatal(0, " Way too few sensors in Sensor System Manager! ");

	sensorPool = (SensorSystemPtr*)missionHeap->Malloc(MAX_SENSORS * sizeof(SensorSystemPtr));
	gosASSERT(sensorPool!=NULL);

	for (long i = 0; i < MAX_SENSORS; i++)
		sensorPool[i] = new SensorSystem;

	//-----------------------------------------------------
	// This assumes we have at least 2 sensors in the pool
	// when initializing the pool...
	sensorPool[0]->id = 0;
	sensorPool[0]->prev = NULL;
	sensorPool[0]->next = sensorPool[1];

	for (i = 1; i < (MAX_SENSORS - 1); i++) {
		sensorPool[i]->id = i;
		sensorPool[i]->prev = sensorPool[i - 1];
		sensorPool[i]->next = sensorPool[i + 1];
	}

	sensorPool[MAX_SENSORS - 1]->id = MAX_SENSORS - 1;
	sensorPool[MAX_SENSORS - 1]->prev = sensorPool[MAX_SENSORS - 2];
	sensorPool[MAX_SENSORS - 1]->next = NULL;

	//------------------------------
	// All start on the free list...
	freeList = sensorPool[0];
	freeSensors = MAX_SENSORS;

	for (i = 0; i < MAX_TEAMS; i++)
		teamSensors[i] = NULL;

	Assert (!debug || (Team::numTeams > 0), 0, " SensorSystemManager.init: 0 teams ");

	for (i = 0; i < Team::numTeams; i++) {
		teamSensors[i] = new TeamSensorSystem;
		teamSensors[i]->teamId = i;
	}

	SensorSystem::numSensors = 0;

	return(NO_ERR);
}
开发者ID:Ariemeth,项目名称:MechCommander2HD,代码行数:47,代码来源:Contact.cpp

示例7: addLink

void GoalObject::addLink (GoalObjectPtr gobject, GoalLinkType type) {

	GoalLinkPtr newLink = (GoalLink*)missionHeap->Malloc(sizeof(GoalLink));
	
}
开发者ID:Jacic,项目名称:MechCommander2,代码行数:5,代码来源:goal.cpp

示例8: delete

void GoalObject::operator delete (void* us) {

	missionHeap->Free(us);
}
开发者ID:Jacic,项目名称:MechCommander2,代码行数:4,代码来源:goal.cpp

示例9: new

void* GoalObject::operator new (size_t ourSize) {

	void *result = missionHeap->Malloc(ourSize);
	return(result);
}
开发者ID:Jacic,项目名称:MechCommander2,代码行数:5,代码来源:goal.cpp

示例10: delete

void WorldChunk::operator delete(PVOID us)
{
	systemHeap->Free(us);
}
开发者ID:BobrDobr69,项目名称:mechcommander2,代码行数:4,代码来源:multplyr.cpp

示例11: delete

void GameDebugWindow::operator delete(PVOID us)
{
    systemHeap->Free(us);
}
开发者ID:BobrDobr69,项目名称:mechcommander2,代码行数:4,代码来源:debugging.cpp

示例12: delete

void SensorSystem::operator delete (void* us) {

	missionHeap->Free(us);
}
开发者ID:Ariemeth,项目名称:MechCommander2HD,代码行数:4,代码来源:Contact.cpp

示例13: new

PVOID MultiPlayer::operator new(size_t ourSize)
{
	PVOID result = systemHeap->Malloc(ourSize);
	return(result);
}
开发者ID:BobrDobr69,项目名称:mechcommander2,代码行数:5,代码来源:multplyr.cpp

示例14: InitializeGameEngine

//---------------------------------------------------------------------------
void __stdcall InitializeGameEngine()
{
	gosResourceHandle = gos_OpenResourceDLL("mc2res.dll");
	char temp[256];
	cLoadString(IDS_FLOAT_HELP_FONT, temp, 255);
	PSTR pStr = strstr(temp, ",");
	if(pStr)
	{
		gosFontScale = atoi(pStr + 2);
		*pStr = 0;
	}
	char path [256];
	strcpy(path, "assets\\graphics\\");
	strcat(path, temp);
	gosFontHandle = gos_LoadFont(path);
	//-------------------------------------------------------------
	// Find the CDPath in the registry and save it off so I can
	// look in CD Install Path for files.
	//Changed for the shared source release, just set to current directory
	//uint32_t maxPathLength = 1023;
	//gos_LoadDataFromRegistry("CDPath", CDInstallPath, &maxPathLength);
	//if (!maxPathLength)
	// strcpy(CDInstallPath,"..\\");
	strcpy(CDInstallPath, ".\\");
	cLoadString(IDS_MC2_FILEMISSING, FileMissingString, 511);
	cLoadString(IDS_MC2_CDMISSING, CDMissingString, 1023);
	cLoadString(IDS_MC2_MISSING_TITLE, MissingTitleString, 255);
	//--------------------------------------------------------------
	// Start the SystemHeap and globalHeapList
	globalHeapList = new HeapList;
	gosASSERT(globalHeapList != nullptr);
	globalHeapList->init();
	globalHeapList->update(); //Run Instrumentation into GOS Debugger Screen
	systemHeap = new UserHeap;
	gosASSERT(systemHeap != nullptr);
	systemHeap->init(systemHeapSize, "SYSTEM");
	float doubleClickThreshold = 0.2f;
	int32_t dragThreshold = .016667;
	//--------------------------------------------------------------
	// Read in System.CFG
	FitIniFile systemFile;
#ifdef _DEBUG
	int32_t systemOpenResult =
#endif
		systemFile.open("system.cfg");
#ifdef _DEBUG
	if(systemOpenResult != NO_ERROR)
	{
		char Buffer[256];
		gos_GetCurrentPath(Buffer, 256);
		STOP(("Cannot find \"system.cfg\" file in %s", Buffer));
	}
#endif
	{
#ifdef _DEBUG
		int32_t systemBlockResult =
#endif
			systemFile.seekBlock("systemHeap");
		gosASSERT(systemBlockResult == NO_ERROR);
		{
			int32_t result = systemFile.readIdULong("systemHeapSize", systemHeapSize);
			result;
			gosASSERT(result == NO_ERROR);
		}
#ifdef _DEBUG
		int32_t systemPathResult =
#endif
			systemFile.seekBlock("systemPaths");
		gosASSERT(systemPathResult == NO_ERROR);
		{
			int32_t result = systemFile.readIdString("terrainPath", terrainPath, 79);
			gosASSERT(result == NO_ERROR);
			result = systemFile.readIdString("artPath", artPath, 79);
			gosASSERT(result == NO_ERROR);
			result = systemFile.readIdString("fontPath", fontPath, 79);
			gosASSERT(result == NO_ERROR);
			result = systemFile.readIdString("savePath", savePath, 79);
			gosASSERT(result == NO_ERROR);
			result = systemFile.readIdString("spritePath", spritePath, 79);
			gosASSERT(result == NO_ERROR);
			result = systemFile.readIdString("shapesPath", shapesPath, 79);
			gosASSERT(result == NO_ERROR);
			result = systemFile.readIdString("soundPath", soundPath, 79);
			gosASSERT(result == NO_ERROR);
			result = systemFile.readIdString("objectPath", objectPath, 79);
			gosASSERT(result == NO_ERROR);
			result = systemFile.readIdString("cameraPath", cameraPath, 79);
			gosASSERT(result == NO_ERROR);
			result = systemFile.readIdString("tilePath", tilePath, 79);
			gosASSERT(result == NO_ERROR);
			result = systemFile.readIdString("missionPath", missionPath, 79);
			gosASSERT(result == NO_ERROR);
			result = systemFile.readIdString("warriorPath", warriorPath, 79);
			gosASSERT(result == NO_ERROR);
			result = systemFile.readIdString("profilePath", profilePath, 79);
			gosASSERT(result == NO_ERROR);
			result = systemFile.readIdString("interfacepath", interfacePath, 79);
			gosASSERT(result == NO_ERROR);
			result = systemFile.readIdString("moviepath", moviePath, 79);
//.........这里部分代码省略.........
开发者ID:BobrDobr69,项目名称:mechcommander2,代码行数:101,代码来源:view.cpp

示例15: delete

void TeamSensorSystem::operator delete(PVOID us)
{
	missionHeap->Free(us);
}
开发者ID:BobrDobr69,项目名称:mechcommander2,代码行数:4,代码来源:contact.cpp


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