예제 #1
0
void CL_RenderBatch3D::draw_sprite(CL_GraphicContext &gc, const CL_Surface_DrawParams1 *params, const CL_Texture &texture)
{
	int texindex = set_batcher_active(gc, texture);

	to_sprite_vertex(params, 0, vertices[position++], texindex);
	to_sprite_vertex(params, 1, vertices[position++], texindex);
	to_sprite_vertex(params, 2, vertices[position++], texindex);
	to_sprite_vertex(params, 1, vertices[position++], texindex);
	to_sprite_vertex(params, 3, vertices[position++], texindex);
	to_sprite_vertex(params, 2, vertices[position++], texindex);
}
예제 #2
0
void RenderBatchTriangle::draw_sprite(Canvas &canvas, const Pointf texture_position[4], const Pointf dest_position[4], const Texture2D &texture, const Colorf &color)
{
	int texindex = set_batcher_active(canvas, texture);

	to_sprite_vertex(texture_position[0], dest_position[0], vertices[position++], texindex, color);
	to_sprite_vertex(texture_position[1], dest_position[1], vertices[position++], texindex, color);
	to_sprite_vertex(texture_position[2], dest_position[2], vertices[position++], texindex, color);
	to_sprite_vertex(texture_position[1], dest_position[1], vertices[position++], texindex, color);
	to_sprite_vertex(texture_position[3], dest_position[3], vertices[position++], texindex, color);
	to_sprite_vertex(texture_position[2], dest_position[2], vertices[position++], texindex, color);
}