git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1169 993157c7-ee19-0410-b2c4-bb4e9862e678

This commit is contained in:
chrisf
2007-07-11 11:09:26 +00:00
parent 492c76262b
commit 04e21ec2da
4 changed files with 66 additions and 46 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Text;
using BluntDirectX.Direct3D;
using OpenRa.FileFormats;
using System.Drawing;
namespace OpenRa.Game
{
@@ -47,21 +48,8 @@ namespace OpenRa.Game
foreach (SheetRectangle<Sheet> image in a.currentImages)
{
int offset = vertices.Count;
vertices.Add(new Vertex(a.location.X, a.location.Y, 0, U(image, 0), V(image, 0)));
vertices.Add(new Vertex(a.location.X + image.size.Width, a.location.Y, 0, U(image, 1), V(image, 0)));
vertices.Add(new Vertex(a.location.X, a.location.Y + image.size.Height, 0, U(image, 0), V(image, 1)));
vertices.Add(new Vertex(a.location.X + image.size.Width, a.location.Y + image.size.Height, 0, U(image, 1), V(image, 1)));
indices.Add((ushort)offset);
indices.Add((ushort)(offset + 1));
indices.Add((ushort)(offset + 2));
indices.Add((ushort)(offset + 1));
indices.Add((ushort)(offset + 3));
indices.Add((ushort)(offset + 2));
sheet = image.sheet;
Util.CreateQuad(vertices, indices, a.location, image);
if (++sprites >= spritesPerBatch)
{