2012-04-17 19:13:47 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
using SlimDX;
|
|
|
|
|
using SlimDX.Direct3D9;
|
|
|
|
|
|
2012-05-21 23:51:32 +00:00
|
|
|
|
using CodeImp.DoomBuilder.GZBuilder.MD3;
|
2012-04-17 19:13:47 +00:00
|
|
|
|
|
|
|
|
|
namespace CodeImp.DoomBuilder.GZBuilder.Data
|
|
|
|
|
{
|
2012-07-12 22:34:12 +00:00
|
|
|
|
internal sealed class ModeldefEntry
|
2012-04-17 19:13:47 +00:00
|
|
|
|
{
|
2012-07-12 22:34:12 +00:00
|
|
|
|
internal string ClassName;
|
|
|
|
|
internal string Path; //this holds Path parameter of MODELDEF entry
|
|
|
|
|
internal List<string> ModelNames;
|
|
|
|
|
internal List<string> TextureNames;
|
|
|
|
|
internal string Location; //this holds location of resource, from which modeldef was loaded
|
2012-04-17 19:13:47 +00:00
|
|
|
|
|
2012-07-12 22:34:12 +00:00
|
|
|
|
internal GZModel Model;
|
2012-04-17 19:13:47 +00:00
|
|
|
|
|
2012-07-12 22:34:12 +00:00
|
|
|
|
internal Vector3 Scale;
|
|
|
|
|
internal float zOffset;
|
2012-04-17 19:13:47 +00:00
|
|
|
|
|
2012-07-12 22:34:12 +00:00
|
|
|
|
internal ModeldefEntry() {
|
2012-04-17 19:13:47 +00:00
|
|
|
|
ModelNames = new List<string>();
|
|
|
|
|
TextureNames = new List<string>();
|
|
|
|
|
}
|
2012-05-21 23:51:32 +00:00
|
|
|
|
|
2012-07-12 22:34:12 +00:00
|
|
|
|
internal void Dispose() {
|
2012-05-21 23:51:32 +00:00
|
|
|
|
if (Model != null) {
|
|
|
|
|
foreach (IndexBuffer ib in Model.Indeces2D)
|
|
|
|
|
ib.Dispose();
|
|
|
|
|
|
|
|
|
|
foreach (Mesh mesh in Model.Meshes)
|
|
|
|
|
mesh.Dispose();
|
|
|
|
|
|
|
|
|
|
foreach (Texture t in Model.Textures)
|
|
|
|
|
t.Dispose();
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-04-17 19:13:47 +00:00
|
|
|
|
}
|
|
|
|
|
}
|