• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ UserHeapPtr类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: new

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


示例17: new

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

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


示例18: InitializeGameEngine

//---------------------------------------------------------------------------
void InitializeGameEngine()
{
	//---------------------------------------------------------------------
	float doubleClickThreshold = 0.2f;
	long dragThreshold = 10;

	Environment.Key_Exit=-1; // so escape doesn't kill your app

	//--------------------------------------------------------------
	// Read in System.CFG
	FitIniFilePtr systemFile = new FitIniFile;

#ifdef _DEBUG
	long systemOpenResult = 
#endif
		systemFile->open("system.cfg");
		   
#ifdef _DEBUG
	if( systemOpenResult != NO_ERR)
	{
		char Buffer[256];
		gos_GetCurrentPath( Buffer, 256 );
		STOP(( "Cannot find \"system.cfg\" file in %s",Buffer ));
	}
#endif

	{
#ifdef _DEBUG
		long systemBlockResult = 
#endif
			systemFile->seekBlock("systemHeap");
		gosASSERT(systemBlockResult == NO_ERR);
		{
			long result = systemFile->readIdULong("systemHeapSize",systemHeapSize);
			gosASSERT(result == NO_ERR);

			result = systemFile->readIdULong("guiHeapSize",guiHeapSize);
			gosASSERT(result == NO_ERR);

			result = systemFile->readIdULong("logisticsHeapSize",logisticsHeapSize);
			gosASSERT(result == NO_ERR);
		}

#ifdef _DEBUG
		long systemPathResult = 
#endif
			systemFile->seekBlock("systemPaths");
		gosASSERT(systemPathResult == NO_ERR);
		{
			long result = systemFile->readIdString("terrainPath",terrainPath,79);
			gosASSERT(result == NO_ERR);

			result = systemFile->readIdString("artPath",artPath,79);
			gosASSERT(result == NO_ERR);

			result = systemFile->readIdString("fontPath",fontPath,79);
			gosASSERT(result == NO_ERR);

			result = systemFile->readIdString("savePath",savePath,79);
			gosASSERT(result == NO_ERR);

			result = systemFile->readIdString("spritePath",spritePath,79);
			gosASSERT(result == NO_ERR);

			result = systemFile->readIdString("shapesPath",shapesPath,79);
			gosASSERT(result == NO_ERR);

			result = systemFile->readIdString("soundPath",soundPath,79);
			gosASSERT(result == NO_ERR);

			result = systemFile->readIdString("objectPath",objectPath,79);
			gosASSERT(result == NO_ERR);

			result = systemFile->readIdString("cameraPath",cameraPath,79);
			gosASSERT(result == NO_ERR);

			result = systemFile->readIdString("tilePath",tilePath,79);
			gosASSERT(result == NO_ERR);

			result = systemFile->readIdString("missionPath",missionPath,79);
			gosASSERT(result == NO_ERR);

			result = systemFile->readIdString("warriorPath",warriorPath,79);
			gosASSERT(result == NO_ERR);

			result = systemFile->readIdString("profilePath",profilePath,79);
			gosASSERT(result == NO_ERR);

			result = systemFile->readIdString("interfacepath",interfacePath,79);
			gosASSERT(result == NO_ERR);

			result = systemFile->readIdString("moviepath",moviePath,79);
			gosASSERT(result == NO_ERR);

			result = systemFile->readIdString("CDsoundPath",CDsoundPath,79);
			gosASSERT(result == NO_ERR);

			result = systemFile->readIdString("CDmoviepath",CDmoviePath,79);
			gosASSERT(result == NO_ERR);
//.........这里部分代码省略.........
开发者ID:Ariemeth,项目名称:MechCommander2HD,代码行数:101,代码来源:logmain.cpp


示例19: TerminateGameEngine

void TerminateGameEngine()
{
	gosScript_ShutdownProcessor();

	//---------------------------------------------------------
	// End the Mission, Operation and Logistics classes here
	if (logistics)
	{
		logistics->destroy();
		delete logistics;
		logistics = NULL;
	}

	//-------------------------------------------------------------
	// Shut down the soundSytem for a change!
	//if (soundSystem)
	//{
	//	soundSystem->destroy();
	//
	//	delete soundSystem;
	//	soundSystem = NULL;
	//}

	//------------------------------------------------
	// shutdown the MC Texture Manager.
	if (mcTextureManager)
	{
		mcTextureManager->destroy();

		delete mcTextureManager;
		mcTextureManager = NULL;
	}

	//--------------------------------------------------------------
	// End the SystemHeap and globalHeapList
	if (systemHeap)
	{
		systemHeap->destroy();

		delete systemHeap;
		systemHeap = NULL;
	}

	if (globalHeapList)
	{
		globalHeapList->destroy();

		delete globalHeapList;
		globalHeapList = NULL;
	}

	//----------------------------------------------------
	// Shutdown the MLR and associated stuff libraries
	//----------------------------------------------------

	//
	//-------------------
	// Turn off libraries
	//-------------------
	//
	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:Ariemeth,项目名称:MechCommander2HD,代码行数:76,代码来源:logmain.cpp


示例20: new

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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ UserInfo类代码示例发布时间:2022-05-31
下一篇:
C++ UserGenerator类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap