Skip to content
Snippets Groups Projects
Commit 42dbec72 authored by MaxED's avatar MaxED
Browse files

Fixed: we don't need to reload ResourceImages, because they can't be unloaded...

Fixed: we don't need to reload ResourceImages, because they can't be unloaded and reloading them can cause problems when trying to display them in PictureBoxes.
Removed Sector Brightness Mode keyboard binding from the default program configuration file.
parent 8257c686
No related branches found
No related tags found
No related merge requests found
...@@ -53,7 +53,6 @@ shortcuts ...@@ -53,7 +53,6 @@ shortcuts
buildermodes_fliplinedefs = 70; buildermodes_fliplinedefs = 70;
buildermodes_joinsectors = 74; buildermodes_joinsectors = 74;
buildermodes_removepoint = 8; buildermodes_removepoint = 8;
buildermodes_brightnessmode = 65602;
buildermodes_mergesectors = 65610; buildermodes_mergesectors = 65610;
buildermodes_splitlinedefs = 0; buildermodes_splitlinedefs = 0;
buildermodes_visualmode = 87; buildermodes_visualmode = 87;
......
...@@ -30,8 +30,8 @@ namespace CodeImp.DoomBuilder.Data ...@@ -30,8 +30,8 @@ namespace CodeImp.DoomBuilder.Data
#region ================== Variables #region ================== Variables
// Image source // Image source
private Assembly assembly; private readonly Assembly assembly;
private string resourcename; private readonly string resourcename;
#endregion #endregion
...@@ -71,15 +71,15 @@ namespace CodeImp.DoomBuilder.Data ...@@ -71,15 +71,15 @@ namespace CodeImp.DoomBuilder.Data
// This loads the image // This loads the image
protected override void LocalLoadImage() protected override void LocalLoadImage()
{ {
Stream bitmapdata; if(IsImageLoaded) return; //mxd. ResourceImages can't be unloaded, so no need to reload them.
lock(this) lock(this)
{ {
// No failure checking here. If anything fails here, it is not the user's fault, // No failure checking here. If anything fails here, it is not the user's fault,
// because the resources this loads are in the assembly. // because the resources this loads are in the assembly.
// Get resource from memory // Get resource from memory
bitmapdata = assembly.GetManifestResourceStream(resourcename); Stream bitmapdata = assembly.GetManifestResourceStream(resourcename);
if(bitmap != null) bitmap.Dispose(); if(bitmap != null) bitmap.Dispose();
bitmap = (Bitmap)Image.FromStream(bitmapdata); bitmap = (Bitmap)Image.FromStream(bitmapdata);
bitmapdata.Dispose(); bitmapdata.Dispose();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment