Exemplo n.º 1
0
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void
	MLR_I_C_DT_PMesh::Save(MemoryStream *stream)
{
	Check_Object(this);
	Check_Object(stream);

	MLR_I_DT_PMesh::Save(stream);

#if COLOR_AS_DWORD
	MemoryStreamIO_Write(stream, &colors);
#else
	Stuff::DynamicArrayOf<DWORD> smallColors;
	int i, len = colors.GetLength();

	const Stuff::RGBAColor *data = colors.GetData();

	smallColors.SetLength(len);

	for(i=0;i<len;i++)
	{
		smallColors[i] = GOSCopyColor(data+i);
	}

	MemoryStreamIO_Write(stream, &smallColors);
#endif
}
Exemplo n.º 2
0
	inline
		GOSVertexPool::GOSVertexPool() 
	{ 
		Verify(gos_GetCurrentHeap() == Heap);
		lastUsed = 0;
		lastUsed2uv = 0;
		lastUsedIndex = 0;
		
		gos_PushCurrentHeap(StaticHeap);
		vertices.SetLength(Limits::Max_Number_Vertices_Per_Frame+4*Limits::Max_Number_ScreenQuads_Per_Frame+1);
		vertices2uv.SetLength(Limits::Max_Number_Vertices_Per_Frame+4*Limits::Max_Number_ScreenQuads_Per_Frame+1);
		indices.SetLength(Limits::Max_Number_Vertices_Per_Frame+16);

		verticesDB.SetLength(2*Limits::Max_Number_Vertices_Per_Mesh);
		vertices2uvDB.SetLength(2*Limits::Max_Number_Vertices_Per_Mesh);
		indicesDB.SetLength(2*Limits::Max_Number_Vertices_Per_Mesh);

		gos_PopCurrentHeap();

		vertexAlignment=32-( (int)vertices.GetData() & 31 );
		vertexAlignment2uv=32-( (int)vertices2uv.GetData() & 31 );
		indicesAlignment=32-( (int)indices.GetData() & 31 );
	}