Exemplo n.º 1
0
void EnumerateFields(field_t *pFields, byte *pbData, unsigned long ulChid, int iLen)
{
	assert(strList.empty());

	// enumerate all the fields...
	//
	if (pFields)
	{
		for (field_t *pField = pFields; pField->psName; pField++)
		{
			assert(pField->iOffset < iLen);
			EnumerateField(pField, pbData);
		}
	}
	
	// save out raw data...
	//
	gi.AppendToSaveGame(ulChid, pbData, iLen);

	// save out any associated strings..
	//
	list<sstring_t>::iterator it = strList.begin();
	for (unsigned int i=0; i<strList.size(); i++, ++it)
	{
		gi.AppendToSaveGame('STRG', (void *)(*it).c_str(), (*it).length() + 1);
	}
	
	strList.clear();	// make sure everything is cleaned up nicely
}
Exemplo n.º 2
0
static void EnumerateFields(const save_field_t *pFields, const byte *pbData, unsigned int ulChid, int iLen)
{
	strList = new list<sstring_t>;

	// enumerate all the fields...
	//
	if (pFields)
	{
		for (const save_field_t *pField = pFields; pField->psName; pField++)
		{
			assert(pField->iOffset < iLen);
			EnumerateField(pField, pbData);
		}
	}
	
	// save out raw data...
	//
	gi.AppendToSaveGame(ulChid, pbData, iLen);

	// save out any associated strings..
	//
	list<sstring_t>::iterator it = strList->begin();
	for (unsigned int i=0; i<strList->size(); i++, ++it)
	{
		gi.AppendToSaveGame('STRG', (void *)(*it).c_str(), (*it).length() + 1);
	}
	
	delete strList;
	strList = NULL;
}
Exemplo n.º 3
0
static void EnumerateFields(const field_t *pFields, byte *pbData, unsigned int ulChid, size_t iLen)
{
	strList = new list<sstring_t>;

	// enumerate all the fields...
	//
	if (pFields)
	{
		for (const field_t *pField = pFields; pField->psName; pField++)
		{
			assert(pField->iOffset < iLen);
			EnumerateField(pField, pbData);
		}
	}

	// save out raw data...
	//
	gi.AppendToSaveGame(ulChid, pbData, iLen);

	// save out any associated strings..
	//
	for (list<sstring_t>::iterator it = strList->begin(); it != strList->end(); ++it)
	{
		gi.AppendToSaveGame(INT_ID('S','T','R','G'), (void*)it->c_str(), it->length()+1);
	}

	delete strList;
	strList = NULL;
}