Exemplo n.º 1
0
//----------------------------------------------------------------//
bool MOAIDataBuffer::Load ( cc8* filename ) {

	ZLFileStream in;
	if ( !in.OpenRead ( filename )) return false;

	this->mMutex.Lock ();

	u32 size = in.GetLength ();
	this->mBytes.Init ( size );
	in.ReadBytes ( this->mBytes , size );

	this->mMutex.Unlock ();

	return true;
}
Exemplo n.º 2
0
//----------------------------------------------------------------//
int main ( int argc, char** argv ) {

	if ( argc < 3 ) return 0;
	
	cc8* infile = argv [ 1 ];
	cc8* outfile = argv [ 2 ];
	
	ZLFileStream file;
	file.OpenRead ( infile );
	
	size_t size = file.GetLength ();
	void* data = malloc ( size );
	file.ReadBytes ( data, size );
	
	_dumpAsCPPHeader ( outfile, data, size, 16 );
	
	free ( data );
	return 0;
}