Example #1
0
/* Load the Research stats */
static bool bufferRESCHLoad(const char *fileName, void **ppData)
{
	//calcDataHash((uint8_t *)pBuffer, size, DATA_RESCH); 

	//check to see if already loaded
	if (!asResearch.empty())
	{
		//release previous data before loading in the new
		dataRESCHRelease(NULL);
	}

	if(!loadResearch(QString(fileName)))
	{
		return false;
	}

	return true;
}
Example #2
0
/* Load the Research stats */
static bool bufferRESCHLoad(const char *fileName, void **ppData)
{
	//check to see if already loaded
	if (!asResearch.empty())
	{
		//release previous data before loading in the new
		dataRESCHRelease(nullptr);
	}

	WzConfig ini(fileName, WzConfig::ReadOnlyAndRequired);
	calcDataHash(ini, DATA_RESCH);

	if (!loadResearch(ini))
	{
		return false;
	}

	return true;
}
Example #3
0
/* Load the Research stats */
static bool bufferRESCHLoad(const char *pBuffer, UDWORD size, void **ppData)
{
	calcDataHash((uint8_t *)pBuffer, size, DATA_RESCH);

	//check to see if already loaded
	if (numResearch > 0)
	{
		//release previous data before loading in the new
		dataRESCHRelease(NULL);
	}

	if (!loadResearch(pBuffer, size))
	{
		return false;
	}


	/* set a dummy value so the release function gets called - the Release
	 * function is now called when load up the next set
	// *ppData = (void *)1;
	 * pass back NULL so that can load the same name file for the next campaign*/
	*ppData = NULL;
	return true;
}