UltimateZoneBuilder/Source/Core/GZBuilder/Data/ModelData.cs
MaxED 25b3bf2287 Added, Texture Browser: added "Show textures in subdirectories" checkbox (enabled by default). When enabled, textures from current PK3/PK7/Directory resource directory and it's subdirectories will be shown. Otherwise, only textures from current directory will be shown.
Removed, Texture Browser: removed "Show image sizes" checkbox. "Show texture and flat sizes in browsers" preferences setting is now used instead.
Fixed, Things mode: event line between pre-last and the last PatrolPoint was not drawn.
Fixed, Things mode: highlight range for sizeless things (things with "fixedsize" game configuration property) was calculated incorrectly.
Fixed: fixed a crash when opening Script Editor after using "Open map in current wad" command to switch to UDMF map with SCRIPTS lump when current script configuration was not saved in the wad's .dbs file.
Fixed: map closing events were not triggered when using "Open map in current wad" command, which could potentially result in plugin crashes/incorrect behavior.
Fixed: Sector Drawing overrides panel could trigger an exception when closing the map during resource loading.
Internal: added "Debug + Profiler" solution configuration, added 2 profiling methods to DebugConsole.
Internal: rewrote MainForm.DisplayStatus() / StatusInfo to handle selection info in a more structured way.
Fixed, internal: some destructors could potentially be executed more than once potentially leading to exceptions. Other destructors were not called at all.
Updated ZDoom_DECORATE.cfg.
2015-09-16 12:10:43 +00:00

83 lines
2 KiB
C#

#region ================== Namespaces
using System.Collections.Generic;
using CodeImp.DoomBuilder.GZBuilder.MD3;
using CodeImp.DoomBuilder.Rendering;
using SlimDX;
using SlimDX.Direct3D9;
#endregion
namespace CodeImp.DoomBuilder.GZBuilder.Data
{
internal sealed class ModelData
{
#region ================== Variables
private ModelLoadState loadstate;
private Vector3 scale;
private Matrix transform;
private Matrix transformstretched;
#endregion
#region ================== Properties
internal List<string> ModelNames;
internal List<string> TextureNames;
internal GZModel Model;
internal Vector3 Scale { get { return scale; } }
internal Matrix Transform { get { return (General.Settings.GZStretchView ? transformstretched : transform); } }
internal bool OverridePalette; //used for voxel models only
internal bool InheritActorPitch;
internal bool InheritActorRoll;
internal bool IsVoxel;
// Disposing
private bool isdisposed;
public ModelLoadState LoadState { get { return loadstate; } internal set { loadstate = value; } }
#endregion
#region ================== Constructor / Disposer
internal ModelData()
{
ModelNames = new List<string>();
TextureNames = new List<string>();
transform = Matrix.Identity;
transformstretched = Matrix.Identity;
}
internal void Dispose()
{
// Not already disposed?
if(!isdisposed)
{
// Clean up
if(Model != null)
{
foreach (Mesh mesh in Model.Meshes) mesh.Dispose();
foreach (Texture t in Model.Textures) t.Dispose();
loadstate = ModelLoadState.None;
}
// Done
isdisposed = true;
}
}
internal void SetTransform(Matrix rotation, Matrix offset, Vector3 scale)
{
this.scale = scale;
this.transform = rotation * Matrix.Scaling(scale) * offset;
this.transformstretched = rotation * Matrix.Scaling(scale.X, scale.Y, scale.Z * Renderer3D.GZDOOM_INVERTED_VERTICAL_VIEW_STRETCH) * offset;
}
#endregion
}
}