0
0
Fork 0
mirror of https://git.do.srb2.org/STJr/UltimateZoneBuilder.git synced 2025-02-27 22:31:23 +00:00

Fixed TGA texture loading

This commit is contained in:
ZZYZX 2019-12-24 21:33:16 +02:00
parent 99b1770004
commit 96f2b4e94e
5 changed files with 29 additions and 16 deletions
Source
Core
Plugins/BuilderModes/Properties

View file

@ -1655,7 +1655,6 @@ namespace CodeImp.DoomBuilder.GZBuilder.MD3
//create texture
FileImageReader fir = new FileImageReader();
Bitmap bitmap = fir.ReadAsBitmap(ms);
bitmap.RotateFlip(RotateFlipType.RotateNoneFlipY);
ms.Close();
if(bitmap != null)

View file

@ -79,6 +79,9 @@ namespace CodeImp.DoomBuilder.IO
{
#region ================== APIs
[DllImport("devil.dll")]
private static extern void ilEnable(int num);
[DllImport("devil.dll")]
private static extern void ilGenImages(int num, IntPtr images);
@ -88,6 +91,9 @@ namespace CodeImp.DoomBuilder.IO
[DllImport("devil.dll")]
private static extern void ilDeleteImages(int num, IntPtr images);
[DllImport("devil.dll")]
private static extern void ilOriginFunc(int func);
[DllImport("devil.dll")]
private static extern bool ilLoadL(uint type, IntPtr lump, uint size);
@ -103,6 +109,11 @@ namespace CodeImp.DoomBuilder.IO
[DllImport("devil.dll")]
private static extern uint ilCopyPixels(uint xoff, uint yoff, uint zoff, uint width, uint height, uint depth, uint format, uint type, IntPtr data);
//
private const int IL_ORIGIN_SET = 0x0600;
private const int IL_ORIGIN_LOWER_LEFT = 0x0601;
private const int IL_ORIGIN_UPPER_LEFT = 0x0602;
//mxd. Look's like we don't need many of those...
// Matches OpenGL's right now.
//! Data formats \link Formats Formats\endlink
@ -497,6 +508,9 @@ namespace CodeImp.DoomBuilder.IO
}
else bytes = imagebytes;
ilEnable(IL_ORIGIN_SET);
ilOriginFunc(IL_ORIGIN_UPPER_LEFT);
fixed (byte* bptr = bytes)
{
if(!ilLoadL(imagetype, new IntPtr(bptr), (uint)bytes.Length))

View file

@ -30,6 +30,6 @@ using CodeImp.DoomBuilder;
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.0.0.3247")]
[assembly: AssemblyVersion("3.0.0.3248")]
[assembly: NeutralResourcesLanguageAttribute("en")]
[assembly: AssemblyHash("e4aae17")]
[assembly: AssemblyHash("99b1770")]

BIN
Source/Core/Resources/Updater.ico Executable file

Binary file not shown.

After

(image error) Size: 24 KiB

View file

@ -29,5 +29,5 @@ using System.Resources;
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.0.0.3247")]
[assembly: AssemblyVersion("3.0.0.3248")]
[assembly: NeutralResourcesLanguageAttribute("en")]