summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xNW4RTools/ObjImporter.cs31
1 files changed, 17 insertions, 14 deletions
diff --git a/NW4RTools/ObjImporter.cs b/NW4RTools/ObjImporter.cs
index 93666b1..1e36983 100755
--- a/NW4RTools/ObjImporter.cs
+++ b/NW4RTools/ObjImporter.cs
@@ -438,7 +438,7 @@ namespace NW4RTools {
else if (Lightmap == ObjImporter.LightmapType.MapObj)
tevColorDL.LoadBPReg(0xE6800000);
tevColorDL.LoadBPReg(0xE7800000);
- tevColorDL.AddPadding(24);
+ tevColorDL.PadToSize(0x80);
tevColorDL.End();
currentMaterial.TevColorDL = tevColorDL.GetBuffer();
@@ -446,7 +446,7 @@ namespace NW4RTools {
var indMtxAndScaleDL = new DisplayListWriter();
indMtxAndScaleDL.LoadBPReg(0x25000000);
indMtxAndScaleDL.LoadBPReg(0x26000000);
- indMtxAndScaleDL.AddPadding(54);
+ indMtxAndScaleDL.PadToSize(0x40);
indMtxAndScaleDL.End();
currentMaterial.IndMtxAndScaleDL = indMtxAndScaleDL.GetBuffer();
@@ -494,22 +494,24 @@ namespace NW4RTools {
currentMaterial.TextureInfos.Add(texInfo);
// Now add the lightmaps
- var lm01 = new TextureInfo();
- lm01.TextureName = LightmapName1;
- lm01.TexMapID = 1;
- lm01.TlutID = 1;
+ if (Lightmap != ObjImporter.LightmapType.None) {
+ var lm01 = new TextureInfo();
+ lm01.TextureName = LightmapName1;
+ lm01.TexMapID = 1;
+ lm01.TlutID = 1;
- lm01.MinFilt = lm01.MagFilt = 1;
+ lm01.MinFilt = lm01.MagFilt = 1;
- var lm02 = new TextureInfo();
- lm02.TextureName = LightmapName2;
- lm02.TexMapID = 2;
- lm02.TlutID = 2;
+ var lm02 = new TextureInfo();
+ lm02.TextureName = LightmapName2;
+ lm02.TexMapID = 2;
+ lm02.TlutID = 2;
- lm02.MinFilt = lm02.MagFilt = 1;
+ lm02.MinFilt = lm02.MagFilt = 1;
- currentMaterial.TextureInfos.Add(lm01);
- currentMaterial.TextureInfos.Add(lm02);
+ currentMaterial.TextureInfos.Add(lm01);
+ currentMaterial.TextureInfos.Add(lm02);
+ }
break;
@@ -846,6 +848,7 @@ namespace NW4RTools {
// a Quick Hack
if (tcDataArray.Length == 0) {
tcDataArray = new float[][] { new float[] { 0, 0 } };
+ texCoordIndexes[0] = 0;
}
tcData.ComponentCount = VertexSettings.CompCount.TexCoord2;