mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-05-30 16:41:38 +00:00
- Simplify D3DDevice
This commit is contained in:
parent
90b5c41517
commit
1be047d316
22 changed files with 596 additions and 1440 deletions
|
@ -475,21 +475,17 @@ namespace CodeImp.DoomBuilder.Data
|
|||
memstream.Seek(0, SeekOrigin.Begin);
|
||||
if(dynamictexture)
|
||||
{
|
||||
texture = Texture.FromStream(General.Map.Graphics.Device, memstream, (int)memstream.Length,
|
||||
img.Size.Width, img.Size.Height, mipmaplevels, Usage.Dynamic, Format.A8R8G8B8,
|
||||
Pool.Default, General.Map.Graphics.PostFilter, General.Map.Graphics.MipGenerateFilter, 0);
|
||||
texture = Texture.FromStream(memstream, (int)memstream.Length, img.Size.Width, img.Size.Height, mipmaplevels, Usage.Dynamic, Format.A8R8G8B8, Pool.Default);
|
||||
}
|
||||
else
|
||||
{
|
||||
texture = Texture.FromStream(General.Map.Graphics.Device, memstream, (int)memstream.Length,
|
||||
img.Size.Width, img.Size.Height, mipmaplevels, Usage.None, Format.Unknown,
|
||||
Pool.Managed, General.Map.Graphics.PostFilter, General.Map.Graphics.MipGenerateFilter, 0);
|
||||
texture = Texture.FromStream(memstream, (int)memstream.Length, img.Size.Width, img.Size.Height, mipmaplevels, Usage.None, Format.Unknown, Pool.Managed);
|
||||
}
|
||||
memstream.Dispose();
|
||||
|
||||
if(dynamictexture)
|
||||
{
|
||||
if((width != texture.GetLevelDescription(0).Width) || (height != texture.GetLevelDescription(0).Height))
|
||||
if((width != texture.Width) || (height != texture.Height))
|
||||
throw new Exception("Could not create a texture with the same size as the image.");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue