mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-12-11 21:01:22 +00:00
6b765f5a27
Open Map in Current WAD: resources are now reloaded when current and target map's resources don't match. Added some boilerplate to UniversalParser and PK3FileImage. Internal: ImageSelectorControl now has "UsePreviews" property. Internal: added ConfigurablePictureBox. Updated ZDoom_DECORATE.cfg.
70 lines
1.5 KiB
C#
70 lines
1.5 KiB
C#
|
|
#region ================== Copyright (c) 2007 Pascal vd Heiden
|
|
|
|
/*
|
|
* Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com
|
|
* This program is released under GNU General Public License
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
*/
|
|
|
|
#endregion
|
|
|
|
#region ================== Namespaces
|
|
|
|
using System.Drawing;
|
|
using CodeImp.DoomBuilder.Rendering;
|
|
|
|
#endregion
|
|
|
|
namespace CodeImp.DoomBuilder.Data
|
|
{
|
|
public class DynamicBitmapImage : BitmapImage, ID3DResource
|
|
{
|
|
#region ================== Variables
|
|
|
|
#endregion
|
|
|
|
#region ================== Constructor / Disposer
|
|
|
|
// Constructor
|
|
public DynamicBitmapImage(Bitmap img, string name) : base(img, name)
|
|
{
|
|
// Initialize
|
|
this.UseColorCorrection = false;
|
|
this.dynamictexture = true;
|
|
|
|
// This resource is volatile
|
|
General.Map.Graphics.RegisterResource(this);
|
|
}
|
|
|
|
// Disposer
|
|
public override void Dispose()
|
|
{
|
|
General.Map.Graphics.UnregisterResource(this);
|
|
base.Dispose();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ================== Methods
|
|
|
|
// Unload the resource because Direct3D says so
|
|
public void UnloadResource()
|
|
{
|
|
ReleaseTexture();
|
|
}
|
|
|
|
// Reload the resource
|
|
public void ReloadResource()
|
|
{
|
|
CreateTexture();
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|