summaryrefslogtreecommitdiff
path: root/NW4RTools/Models/OpenGL/GLModel.cs
diff options
context:
space:
mode:
Diffstat (limited to 'NW4RTools/Models/OpenGL/GLModel.cs')
-rw-r--r--NW4RTools/Models/OpenGL/GLModel.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/NW4RTools/Models/OpenGL/GLModel.cs b/NW4RTools/Models/OpenGL/GLModel.cs
index 072ea00..18e5f6f 100644
--- a/NW4RTools/Models/OpenGL/GLModel.cs
+++ b/NW4RTools/Models/OpenGL/GLModel.cs
@@ -199,14 +199,14 @@ namespace NW4RTools.Models.OpenGL {
displayList.Begin();
if (m.TextureInfos.Count > 0) {
- GL.Enable(EnableCap.Texture2D);
-
TextureInfo[] texInfoArray = new TextureInfo[8];
foreach (var texInfo in m.TextureInfos) {
texInfoArray[texInfo.TexMapID] = texInfo;
}
+ GL.Enable(EnableCap.Texture2D);
+
for (int i = 0; i < 8; i++) {
GL.ActiveTexture(TextureUnits[i]);
GL.TexEnv(TextureEnvTarget.TextureEnv, TextureEnvParameter.TextureEnvMode, (int)TextureEnvMode.Modulate);
@@ -215,6 +215,7 @@ namespace NW4RTools.Models.OpenGL {
GL.BindTexture(TextureTarget.Texture2D, 0);
} else {
BindTextureInfo(texInfoArray[i]);
+ GL.Enable(EnableCap.Texture2D);
}
}
@@ -302,8 +303,9 @@ namespace NW4RTools.Models.OpenGL {
GL.MultiTexCoord2(TextureUnits[j], shape.TexCoordData[j].Data[vtxs[i].TexCoords[j]]);
}
}
-
- // TODO: normals
+
+ if (vs.NormalDesc != VertexSettings.DescType.None)
+ GL.Normal3(shape.NrmData.Data[vtxs[i].Normal]);
GL.Vertex3(shape.PosData.Data[vtxs[i].Position]);
}