summaryrefslogtreecommitdiff
path: root/NW4RTools
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-05-07 03:48:22 +0200
committerTreeki <treeki@gmail.com>2011-05-07 03:48:22 +0200
commit30a400a14b2cda40bd87234b284d692dbe540736 (patch)
tree918601edde55e0ed819f5e3bd8af7d2a8981613a /NW4RTools
parent668bdd2d473f3bc60cee64e374a425de0d1b68b2 (diff)
downloadnw4rtools-30a400a14b2cda40bd87234b284d692dbe540736.tar.gz
nw4rtools-30a400a14b2cda40bd87234b284d692dbe540736.zip
a bit of fixing to the obj importer
Diffstat (limited to 'NW4RTools')
-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;