Ejemplo n.º 1
0
/*
========================
idSWFBitStream::ReadColorRGB
========================
*/
void idSWFBitStream::ReadColorRGB( swfColorRGB_t& color )
{
	ResetBits();
	color.r = *readp++;
	color.g = *readp++;
	color.b = *readp++;
}
Ejemplo n.º 2
0
/*
========================
idSWFBitStream::Free
========================
*/
void idSWFBitStream::Free()
{
	if( free )
	{
		Mem_Free( ( void* )startp );
	}
	free = false;
	startp = NULL;
	endp = NULL;
	readp = NULL;
	ResetBits();
}
Ejemplo n.º 3
0
/*
========================
idSWFBitStream::ReadData
========================
*/
const byte* idSWFBitStream::ReadData( int size )
{
	assert( readp >= startp && readp <= endp );
	ResetBits();
	if( readp + size > endp )
	{
		// buffer overrun
		assert( false );
		readp = endp;
		return startp;
	}
	const byte* buffer = readp;
	readp += size;
	assert( readp >= startp && readp <= endp );
	return buffer;
}
Ejemplo n.º 4
0
/*
========================
idSWFBitStream::Load
========================
*/
void idSWFBitStream::Load( const byte* data, uint32 len, bool copy )
{
	Free();
	
	if( copy )
	{
		free = true;
		startp = ( const byte* )Mem_Alloc( len, TAG_SWF );
		memcpy( ( byte* )startp, data, len );
	}
	else
	{
		free = false;
		startp = data;
	}
	endp = startp + len;
	readp = startp;
	
	ResetBits();
}
Ejemplo n.º 5
0
void GPIO::SetValue(U32 pin, U32 value, U32 mask)
{
	SetBits((value<<pin) & mask);
	ResetBits((~value<<pin) & mask);
}