Export to image: fixed a problem where exported textures were too bright when an increased texture and flat brightness was set in the preferences

This commit is contained in:
biwa 2020-08-01 12:28:23 +02:00
parent 8862bb7cf7
commit d0a0479579

View file

@ -30,6 +30,7 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CodeImp.DoomBuilder.Data;
using CodeImp.DoomBuilder.Geometry;
using CodeImp.DoomBuilder.Map;
using System.Diagnostics;
@ -156,7 +157,12 @@ namespace CodeImp.DoomBuilder.BuilderModes.IO
if (settings.Floor)
{
brushtexture = General.Map.Data.GetFlatImage(s.FloorTexture).ExportBitmap();
// The image might have a color correction applied, but we need it without. So we use LocalGetBitmap, because it reloads the image,
// but doesn't applie the color correction if we set UseColorCorrection to false first
ImageData imagedata = General.Map.Data.GetFlatImage(s.FloorTexture);
imagedata.UseColorCorrection = false;
brushtexture = imagedata.LocalGetBitmap();
imagedata.UseColorCorrection = true;
textureoffset.x = s.Fields.GetValue("xpanningfloor", 0.0);
textureoffset.y = s.Fields.GetValue("ypanningfloor", 0.0);
@ -167,7 +173,12 @@ namespace CodeImp.DoomBuilder.BuilderModes.IO
}
else
{
brushtexture = General.Map.Data.GetFlatImage(s.CeilTexture).ExportBitmap();
// The image might have a color correction applied, but we need it without. So we use LocalGetBitmap, because it reloads the image,
// but doesn't applie the color correction if we set UseColorCorrection to false first
ImageData imagedata = General.Map.Data.GetFlatImage(s.CeilTexture);
imagedata.UseColorCorrection = false;
brushtexture = imagedata.LocalGetBitmap();
imagedata.UseColorCorrection = true;
textureoffset.x = s.Fields.GetValue("xpanningceiling", 0.0);
textureoffset.y = s.Fields.GetValue("ypanningceiling", 0.0);