Commit e4955686 authored by Human Gamer's avatar Human Gamer

Fixed v4 Import/Export

Now supports all known DIF file formats
Now exports game entities
Fixed collision errors on export due to flipped faces
parent c90f1f6a
Pipeline #1739843 skipped
......@@ -246,9 +246,9 @@ public class InteriorResource
dos.writeInt(0);
}
dos.writeInt(0);
dos.writeInt(2);
/*if (this.gameEntities.size() > 0)
if (this.gameEntities.size() > 0)
{
dos.writeInt(this.gameEntities.size());
for (int i = 0; i < this.gameEntities.size(); i++)
......@@ -256,7 +256,7 @@ public class InteriorResource
this.gameEntities.get(i).write(dos);
}
dos.writeInt(0);
}*/
}
if (targetVersion == -1)
dos.writeInt(0);
......
......@@ -4,6 +4,7 @@ import java.io.BufferedWriter;
import java.io.IOException;
import com.matt.difinspector.io.ReverseDataInputStream;
import com.matt.difinspector.io.ReverseDataOutputStream;
import com.matt.difinspector.structures.Point3F;
public class ItrGameEntity
......@@ -33,6 +34,18 @@ public class ItrGameEntity
return true;
}
public boolean write(ReverseDataOutputStream dos) throws IOException
{
dos.writeString(this.dataBlock);
dos.writeString(this.gameClass);
dos.writePoint3F(this.pos);
this.dictionary.write(dos);
return true;
}
public void dumpInfo(BufferedWriter bw) throws IOException
{
final String TAB = " ";
......
......@@ -150,7 +150,8 @@ public class InteriorRender extends SceneObject
}*/
Surface surface = interior.getSurfaces()[interior.getHullSurfaceIndices()[j]];
int planeIndex = surface.getPlaneIndex();
short planeIndex = surface.getPlaneIndex();
planeIndex &= ~0x8000;
//if (planeIndex >= interior.getPlanes().length || planeIndex < 0)
//planeIndex = 0;
//continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment