ee184391fb
LM3 uses an updated format of LM2 Darkmoon. Currently this can now load textures. Most of them should load fine, however ASTC_6x6 textures keep giving me issues so those may or may not error out. Models for LM3 is currently not supported due to the various changes but is planned.
44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Toolbox.Library.Rendering;
|
|
using GL_EditorFramework.GL_Core;
|
|
using GL_EditorFramework.Interfaces;
|
|
using OpenTK;
|
|
using OpenTK.Graphics.OpenGL;
|
|
using Toolbox.Library;
|
|
|
|
namespace FirstPlugin.LuigisMansion3
|
|
{
|
|
public class LM3_Renderer : GenericModelRenderer
|
|
{
|
|
public List<TexturePOWE> TextureList = new List<TexturePOWE>();
|
|
|
|
public override void OnRender(GLControl control)
|
|
{
|
|
|
|
}
|
|
|
|
public override int BindTexture(STGenericMatTexture tex, ShaderProgram shader)
|
|
{
|
|
GL.ActiveTexture(TextureUnit.Texture0 + tex.textureUnit + 1);
|
|
GL.BindTexture(TextureTarget.Texture2D, RenderTools.defaultTex.RenderableTex.TexID);
|
|
|
|
string activeTex = tex.Name;
|
|
|
|
foreach (var texture in TextureList)
|
|
{
|
|
if (texture.ID2.ToString("x") == tex.Name)
|
|
{
|
|
BindGLTexture(tex, shader, texture);
|
|
return tex.textureUnit + 1;
|
|
}
|
|
}
|
|
|
|
return tex.textureUnit + 1;
|
|
}
|
|
}
|
|
}
|