This commit is contained in:
ikpil 2023-04-29 19:04:29 +09:00
parent 5ed9e602fb
commit 7daeb96382
4 changed files with 21 additions and 26 deletions

View File

@ -39,15 +39,13 @@ namespace DotRecast.Detour.TileCache.Io
header.tx = data.getInt();
header.ty = data.getInt();
header.tlayer = data.getInt();
for (int j = 0; j < 3; j++)
{
header.bmin[j] = data.getFloat();
}
for (int j = 0; j < 3; j++)
{
header.bmax[j] = data.getFloat();
}
header.bmin.x = data.getFloat();
header.bmin.y = data.getFloat();
header.bmin.z = data.getFloat();
header.bmax.x = data.getFloat();
header.bmax.y = data.getFloat();
header.bmax.z = data.getFloat();
header.hmin = data.getShort() & 0xFFFF;
header.hmax = data.getShort() & 0xFFFF;

View File

@ -33,15 +33,13 @@ namespace DotRecast.Detour.TileCache.Io
write(stream, header.tx, order);
write(stream, header.ty, order);
write(stream, header.tlayer, order);
for (int j = 0; j < 3; j++)
{
write(stream, header.bmin[j], order);
}
for (int j = 0; j < 3; j++)
{
write(stream, header.bmax[j], order);
}
write(stream, header.bmin.x, order);
write(stream, header.bmin.y, order);
write(stream, header.bmin.z, order);
write(stream, header.bmax.x, order);
write(stream, header.bmax.y, order);
write(stream, header.bmax.z, order);
write(stream, (short)header.hmin, order);
write(stream, (short)header.hmax, order);

View File

@ -91,10 +91,10 @@ namespace DotRecast.Detour.TileCache.Io
private TileCacheParams readCacheParams(ByteBuffer bb, bool cCompatibility)
{
TileCacheParams option = new TileCacheParams();
for (int i = 0; i < 3; i++)
{
option.orig[i] = bb.getFloat();
}
option.orig.x = bb.getFloat();
option.orig.y = bb.getFloat();
option.orig.z = bb.getFloat();
option.cs = bb.getFloat();
option.ch = bb.getFloat();

View File

@ -63,10 +63,9 @@ namespace DotRecast.Detour.TileCache.Io
private void writeCacheParams(BinaryWriter stream, TileCacheParams option, ByteOrder order)
{
for (int i = 0; i < 3; i++)
{
write(stream, option.orig[i], order);
}
write(stream, option.orig.x, order);
write(stream, option.orig.y, order);
write(stream, option.orig.z, order);
write(stream, option.cs, order);
write(stream, option.ch, order);