git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1230 993157c7-ee19-0410-b2c4-bb4e9862e678
This commit is contained in:
28
OpenRa.Game/Region.cs
Normal file
28
OpenRa.Game/Region.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
|
||||
namespace OpenRa.Game
|
||||
{
|
||||
class Region
|
||||
{
|
||||
PointF location;
|
||||
Size size;
|
||||
Renderable drawFunction;
|
||||
|
||||
public Region(PointF location, Size size, Renderable drawFunction)
|
||||
{
|
||||
this.location = location;
|
||||
this.size = size;
|
||||
this.drawFunction = drawFunction;
|
||||
}
|
||||
|
||||
public void Draw(Renderer renderer, Viewport viewport)
|
||||
{
|
||||
renderer.Device.EnableScissor(location.X, location.Y, size.Width, size.Height);
|
||||
drawFunction(renderer, viewport);
|
||||
renderer.Device.DisableScissor();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user