1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-20 22:25:24 +00:00

Forgot to commit the rest of the files..

This commit is contained in:
Tim Sarbin 2018-11-27 01:04:27 -05:00
parent dbb1a2316a
commit 3b543131a5
4 changed files with 56 additions and 0 deletions

View File

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OpenDiablo2.Common.Interfaces
{
// This allows external systems to store their texture data in other services for later use
public interface ITexture
{
}
}

View File

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenDiablo2.Common.Interfaces;
namespace OpenDiablo2.Common.Models
{
// Represents a single cell on a map
public sealed class MapCellInfo
{
public Guid TileId;
public int OffX;
public int OffY;
public int FrameWidth;
public int FrameHeight;
public Rectangle Rect;
public ITexture Texture;
}
}

View File

@ -0,0 +1,11 @@
using System.Drawing;
using SDL2;
namespace OpenDiablo2.SDL2_
{
public static class SDL2Extensions
{
public static SDL.SDL_Rect ToSDL2Rect(this Rectangle src) => new SDL.SDL_Rect { x = src.X, y = src.Y, w = src.Width, h = src.Height };
public static Rectangle ToRectangle(this SDL.SDL_Rect src) => new Rectangle { X = src.x, Y = src.y, Width = src.w, Height = src.h };
}
}

View File

@ -0,0 +1,10 @@
using System;
using OpenDiablo2.Common.Interfaces;
namespace OpenDiablo2.SDL2_
{
public sealed class SDL2Texture : ITexture
{
public IntPtr Pointer { get; set; }
}
}