src/sgp/VObject.cc
void SGPVObject::DestroyPalettes()
{
	FOR_EACH(UINT16*, i, pShades)
	{
		if (flags_ & SHADETABLE_SHARED) continue;
		UINT16* const p = *i;
		if (!p)                         continue;
		if (palette16_ == p) palette16_ = 0;
		*i = 0;
		delete[] p;
	}

	if (UINT16* const p = palette16_)
	{
		palette16_ = 0;
		delete[] p;
	}

	current_shade_ = 0;
}
/* Destroys the palette tables of a video object. All memory is deallocated, and
 * the pointers set to NULL. Be careful not to try and blit this object until
 * new tables are calculated, or things WILL go boom. */
Destroys the palette tables of a video object. All memory is deallocated, and
the pointers set to NULL. Be careful not to try and blit this object until
new tables are calculated, or things WILL go boom.
Destroys the palette tables of a video object . All memory is deallocated and the pointers set to NULL . Be careful not to try and blit this object until new tables are calculated or things WILL go boom .
void SGPVObject::DestroyPalettes()
{
	FOR_EACH(UINT16*, i, pShades)
	{
		if (flags_ & SHADETABLE_SHARED) continue;
		UINT16* const p = *i;
		if (!p)                         continue;
		if (palette16_ == p) palette16_ = 0;
		*i = 0;
		delete[] p;
	}
	if (UINT16* const p = palette16_)
	{
		palette16_ = 0;
		delete[] p;
	}
	current_shade_ = 0;
}
void SGPVObject :: DestroyPalettes ( ) { FOR_EACH ( UINT16 * , i , pShades ) { if ( flags_ & SHADETABLE_SHARED ) continue ; UINT16 * const p = * i ; if ( ! p ) continue ; if ( palette16_ == p ) palette16_ = 0 ; * i = 0 ; delete [ ] p ; } if ( UINT16 * const p = palette16_ ) { palette16_ = 0 ; delete [ ] p ; } current_shade_ = 0 ; }
Destroys the palette tables of a video object.
Destroys the palette tables of a video object .