Ejemplo n.º 1
0
// ----------------------------------------------------------------------- //
//
//	ROUTINE:	CTronPlayerObj::Save
//
//	PURPOSE:	Load the object
//
// ----------------------------------------------------------------------- //
void CTronPlayerObj::Save(ILTMessage_Write *pMsg, uint32 dwSaveFlags)
{
	if(!pMsg)
		return;

	for(int i=0;i<NUM_RATINGS;i++)
	{
		SAVE_BYTE(m_iPerformanceRatings[i]);
	}
	SAVE_BYTE(m_byPSets);
	SAVE_BYTE(m_byOldPSets);
	SAVE_BYTE(m_nArmorPercentage);
	SAVE_WORD(m_nBuildPoints);
	SAVE_WORD(m_nOldBuildPoints);

	CPlayerObj::Save(pMsg, dwSaveFlags);
}
Ejemplo n.º 2
0
static WORD SaveItemChunks(HANDLE hData, GLOBALHANDLE hChunk, WORD wSize,
                           WORD FAR *wNumChunk)
{
#ifdef BINSAVE

    GLOBALHANDLE hChunk1;
    FIXCHUNKHDR lpChunk;

    /* Store the chunks */
    for ( ; hChunk && (hChunk1 = hChunk);
            hChunk = lpChunk->hNext, GLOBALUNLOCK(hChunk1)) {
        DWORD wAccessSize;
        WORD wBuf;

        lpChunk = (FIXCHUNKHDR) GLOBALLOCK(hChunk);

        if (!lpChunk)
            return ERROR;
        
        wAccessSize = lpChunk->hTable ? GLOBALSIZE(lpChunk->hTable) : 0L;
        if (SAVE_LONG(hData, wAccessSize) != SIZE_LONG)
            return ERROR;
        
        if (wAccessSize)
        {
            wBuf = lpChunk->bSorted;
            if (SAVE_WORD(hData, wBuf) != SIZE_WORD)
                return ERROR;
        }

        if (!(*wNumChunk)++)
        {
            /* Store the relative and absolute counters */
            
            wBuf = lpChunk->wRelCounter;
            if (SAVE_WORD(hData, wBuf) != SIZE_WORD)
                return ERROR;
            
            wBuf = lpChunk->wAbsCounter;
            if (SAVE_WORD(hData, wBuf) != SIZE_WORD)
                return ERROR;
        }

        /* Copy buffer contents */
        if (SAVE_BUF(hData, lpChunk, wSize) != wSize)
            return ERROR;
        
        if (wAccessSize)
        {
            DWORD FAR *lpTable = (DWORD FAR *) GLOBALLOCK(lpChunk->hTable);
            
            if (SAVE_BUF(hData, lpTable, wAccessSize) != wAccessSize)
                return ERROR;
            
            GLOBALUNLOCK(lpChunk->hTable);
        }
    }

#endif

    return TRUE;
}