-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can not read the correct data #9
Comments
The tile reference appears to be 64-bit. However, in this code, it seems to be reading and writing as 32-bit. This might be causing the tile reference value to be displayed incorrectly. To resolve this issue, the code needs to be modified to correctly read and write the data as 64-bit. |
public void Test()
{
const long tileRef = 281474976710656L;
const int dataSize = 344;
byte[] actual;
{
using MemoryStream ms = new MemoryStream();
using BinaryWriter bw = new BinaryWriter(ms);
RcIO.Write(bw, tileRef, RcByteOrder.LITTLE_ENDIAN);
RcIO.Write(bw, dataSize, RcByteOrder.LITTLE_ENDIAN);
bw.Flush();
actual= ms.ToArray();
}
{
using MemoryStream ms = new MemoryStream(actual);
using BinaryReader br = new BinaryReader(ms);
var byteBuffer = RcIO.ToByteBuffer(br);
byteBuffer.Order(RcByteOrder.LITTLE_ENDIAN);
Assert.That(byteBuffer.GetLong(), Is.EqualTo(tileRef));
Assert.That(byteBuffer.GetInt(), Is.EqualTo(dataSize));
}
} |
still can not run |
Is there a way for me to check? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use this method to read the data
self.navMesh = reader.Read32Bit(br, 6);
DtMeshSetWriter.WriteTiles : tileHeader.tileRef(281474976710656) : tileHeader.dataSize(344)
DtMeshSetReader.ReadTiles : is32Bit(True) : header.numTiles(121) : tileHeader.tileRef(0) : tileHeader.dataSize(65536)
The text was updated successfully, but these errors were encountered: