From b7a160b93aa6522b78183a860bb280ffffe3adad Mon Sep 17 00:00:00 2001 From: ikpil Date: Sat, 19 Aug 2023 15:45:05 +0900 Subject: [PATCH] typo --- .../Unity/Astar/ZipBinaryReader.cs | 4 ++-- .../DtTileCacheBuilder.cs | 6 ++--- src/DotRecast.Detour/Io/DtMeshSetWriter.cs | 12 +++++----- src/DotRecast.Detour/Io/IOUtils.cs | 6 ++--- .../Draw/ModernOpenGLDraw.cs | 14 ++++++------ .../DynamicNavMeshTest.cs | 4 ++-- .../Io/VoxelFileReaderTest.cs | 8 +++---- .../Io/VoxelFileReaderWriterTest.cs | 22 +++++++++---------- .../VoxelQueryTest.cs | 4 ++-- .../UnityAStarPathfindingImporterTest.cs | 4 ++-- .../Io/MeshDataReaderWriterTest.cs | 8 +++---- .../Io/MeshSetReaderTest.cs | 12 +++++----- .../Io/MeshSetReaderWriterTest.cs | 8 +++---- .../Io/TileCacheReaderTest.cs | 8 +++---- .../Io/TileCacheReaderWriterTest.cs | 12 +++++----- .../TileCacheFindPathTest.cs | 6 ++--- 16 files changed, 69 insertions(+), 69 deletions(-) diff --git a/src/DotRecast.Detour.Extras/Unity/Astar/ZipBinaryReader.cs b/src/DotRecast.Detour.Extras/Unity/Astar/ZipBinaryReader.cs index 8149235..9a34fe2 100644 --- a/src/DotRecast.Detour.Extras/Unity/Astar/ZipBinaryReader.cs +++ b/src/DotRecast.Detour.Extras/Unity/Astar/ZipBinaryReader.cs @@ -29,8 +29,8 @@ namespace DotRecast.Detour.Extras.Unity.Astar { ZipArchiveEntry graphReferences = file.GetEntry(filename); using var entryStream = graphReferences.Open(); - using var bis = new BinaryReader(entryStream); - RcByteBuffer buffer = IOUtils.ToByteBuffer(bis); + using var br = new BinaryReader(entryStream); + RcByteBuffer buffer = IOUtils.ToByteBuffer(br); buffer.Order(RcByteOrder.LITTLE_ENDIAN); return buffer; } diff --git a/src/DotRecast.Detour.TileCache/DtTileCacheBuilder.cs b/src/DotRecast.Detour.TileCache/DtTileCacheBuilder.cs index a5bfc06..697b5a4 100644 --- a/src/DotRecast.Detour.TileCache/DtTileCacheBuilder.cs +++ b/src/DotRecast.Detour.TileCache/DtTileCacheBuilder.cs @@ -1908,11 +1908,11 @@ namespace DotRecast.Detour.TileCache public byte[] CompressTileCacheLayer(IRcCompressor comp, DtTileCacheLayer layer, RcByteOrder order, bool cCompatibility) { using var ms = new MemoryStream(); - using var baos = new BinaryWriter(ms); + using var bw = new BinaryWriter(ms); DtTileCacheLayerHeaderWriter hw = new DtTileCacheLayerHeaderWriter(); try { - hw.Write(baos, layer.header, order, cCompatibility); + hw.Write(bw, layer.header, order, cCompatibility); int gridSize = layer.header.width * layer.header.height; byte[] buffer = new byte[gridSize * 3]; for (int i = 0; i < gridSize; i++) @@ -1923,7 +1923,7 @@ namespace DotRecast.Detour.TileCache } var compressed = comp.Compress(buffer); - baos.Write(compressed); + bw.Write(compressed); return ms.ToArray(); } catch (IOException e) diff --git a/src/DotRecast.Detour/Io/DtMeshSetWriter.cs b/src/DotRecast.Detour/Io/DtMeshSetWriter.cs index eff10c5..63357a4 100644 --- a/src/DotRecast.Detour/Io/DtMeshSetWriter.cs +++ b/src/DotRecast.Detour/Io/DtMeshSetWriter.cs @@ -68,13 +68,13 @@ namespace DotRecast.Detour.Io NavMeshTileHeader tileHeader = new NavMeshTileHeader(); tileHeader.tileRef = mesh.GetTileRef(tile); - using MemoryStream bb = new MemoryStream(); - using BinaryWriter baos = new BinaryWriter(bb); - writer.Write(baos, tile.data, order, cCompatibility); - baos.Flush(); - baos.Close(); + using MemoryStream msw = new MemoryStream(); + using BinaryWriter bw = new BinaryWriter(msw); + writer.Write(bw, tile.data, order, cCompatibility); + bw.Flush(); + bw.Close(); - byte[] ba = bb.ToArray(); + byte[] ba = msw.ToArray(); tileHeader.dataSize = ba.Length; Write(stream, tileHeader.tileRef, order); Write(stream, tileHeader.dataSize, order); diff --git a/src/DotRecast.Detour/Io/IOUtils.cs b/src/DotRecast.Detour/Io/IOUtils.cs index 6b90152..2c5f7d2 100644 --- a/src/DotRecast.Detour/Io/IOUtils.cs +++ b/src/DotRecast.Detour/Io/IOUtils.cs @@ -37,15 +37,15 @@ namespace DotRecast.Detour.Io public static byte[] ToByteArray(BinaryReader inputStream) { - using var baos = new MemoryStream(); + using var msw = new MemoryStream(); byte[] buffer = new byte[4096]; int l; while ((l = inputStream.Read(buffer)) > 0) { - baos.Write(buffer, 0, l); + msw.Write(buffer, 0, l); } - return baos.ToArray(); + return msw.ToArray(); } diff --git a/src/DotRecast.Recast.Demo/Draw/ModernOpenGLDraw.cs b/src/DotRecast.Recast.Demo/Draw/ModernOpenGLDraw.cs index ebc7536..5d4c835 100644 --- a/src/DotRecast.Recast.Demo/Draw/ModernOpenGLDraw.cs +++ b/src/DotRecast.Recast.Demo/Draw/ModernOpenGLDraw.cs @@ -212,15 +212,15 @@ public class ModernOpenGLDraw : IOpenGLDraw if (currentPrim == DebugDrawPrimitives.QUADS) { using var unmanagedElems = new UnmanagedMemoryStream(pElems, eboSize, eboSize, FileAccess.Write); - using var elems = new BinaryWriter(unmanagedElems); + using var bw = new BinaryWriter(unmanagedElems); for (int i = 0; i < vertices.Count; i += 4) { - elems.Write(i); - elems.Write(i + 1); - elems.Write(i + 2); - elems.Write(i); - elems.Write(i + 2); - elems.Write(i + 3); + bw.Write(i); + bw.Write(i + 1); + bw.Write(i + 2); + bw.Write(i); + bw.Write(i + 2); + bw.Write(i + 3); } } else diff --git a/test/DotRecast.Detour.Dynamic.Test/DynamicNavMeshTest.cs b/test/DotRecast.Detour.Dynamic.Test/DynamicNavMeshTest.cs index e99508a..6a7f7dd 100644 --- a/test/DotRecast.Detour.Dynamic.Test/DynamicNavMeshTest.cs +++ b/test/DotRecast.Detour.Dynamic.Test/DynamicNavMeshTest.cs @@ -23,11 +23,11 @@ public class DynamicNavMeshTest { byte[] bytes = Loader.ToBytes("test_tiles.voxels"); using var ms = new MemoryStream(bytes); - using var bis = new BinaryReader(ms); + using var br = new BinaryReader(ms); // load voxels from file VoxelFileReader reader = new VoxelFileReader(DtVoxelTileLZ4ForTestCompressor.Shared); - VoxelFile f = reader.Read(bis); + VoxelFile f = reader.Read(br); // create dynamic navmesh DynamicNavMesh mesh = new DynamicNavMesh(f); // build navmesh asynchronously using multiple threads diff --git a/test/DotRecast.Detour.Dynamic.Test/Io/VoxelFileReaderTest.cs b/test/DotRecast.Detour.Dynamic.Test/Io/VoxelFileReaderTest.cs index f3cf855..54bbbc2 100644 --- a/test/DotRecast.Detour.Dynamic.Test/Io/VoxelFileReaderTest.cs +++ b/test/DotRecast.Detour.Dynamic.Test/Io/VoxelFileReaderTest.cs @@ -31,10 +31,10 @@ public class VoxelFileReaderTest { byte[] bytes = Loader.ToBytes("test.voxels"); using var ms = new MemoryStream(bytes); - using var bis = new BinaryReader(ms); + using var br = new BinaryReader(ms); VoxelFileReader reader = new VoxelFileReader(DtVoxelTileLZ4ForTestCompressor.Shared); - VoxelFile f = reader.Read(bis); + VoxelFile f = reader.Read(br); Assert.That(f.useTiles, Is.False); Assert.That(f.bounds, Is.EqualTo(new float[] { -100.0f, 0f, -100f, 100f, 5f, 100f })); Assert.That(f.cellSize, Is.EqualTo(0.25f)); @@ -57,10 +57,10 @@ public class VoxelFileReaderTest { byte[] bytes = Loader.ToBytes("test_tiles.voxels"); using var ms = new MemoryStream(bytes); - using var bis = new BinaryReader(ms); + using var br = new BinaryReader(ms); VoxelFileReader reader = new VoxelFileReader(DtVoxelTileLZ4ForTestCompressor.Shared); - VoxelFile f = reader.Read(bis); + VoxelFile f = reader.Read(br); Assert.That(f.useTiles, Is.True); Assert.That(f.bounds, Is.EqualTo(new float[] { -100.0f, 0f, -100f, 100f, 5f, 100f })); diff --git a/test/DotRecast.Detour.Dynamic.Test/Io/VoxelFileReaderWriterTest.cs b/test/DotRecast.Detour.Dynamic.Test/Io/VoxelFileReaderWriterTest.cs index 48e3e5d..dad3baa 100644 --- a/test/DotRecast.Detour.Dynamic.Test/Io/VoxelFileReaderWriterTest.cs +++ b/test/DotRecast.Detour.Dynamic.Test/Io/VoxelFileReaderWriterTest.cs @@ -32,9 +32,9 @@ public class VoxelFileReaderWriterTest { byte[] bytes = Loader.ToBytes("test.voxels"); using var ms = new MemoryStream(bytes); - using var bis = new BinaryReader(ms); + using var br = new BinaryReader(ms); - VoxelFile f = ReadWriteRead(bis, compression); + VoxelFile f = ReadWriteRead(br, compression); Assert.That(f.useTiles, Is.False); Assert.That(f.bounds, Is.EqualTo(new[] { -100.0f, 0f, -100f, 100f, 5f, 100f })); Assert.That(f.cellSize, Is.EqualTo(0.25f)); @@ -60,9 +60,9 @@ public class VoxelFileReaderWriterTest { byte[] bytes = Loader.ToBytes("test_tiles.voxels"); using var ms = new MemoryStream(bytes); - using var bis = new BinaryReader(ms); + using var br = new BinaryReader(ms); - VoxelFile f = ReadWriteRead(bis, compression); + VoxelFile f = ReadWriteRead(br, compression); Assert.That(f.useTiles, Is.True); Assert.That(f.bounds, Is.EqualTo(new[] { -100.0f, 0f, -100f, 100f, 5f, 100f })); @@ -90,13 +90,13 @@ public class VoxelFileReaderWriterTest VoxelFileReader reader = new VoxelFileReader(DtVoxelTileLZ4ForTestCompressor.Shared); VoxelFile f = reader.Read(bis); - using var msOut = new MemoryStream(); - using var bwOut = new BinaryWriter(msOut); + using var msw = new MemoryStream(); + using var bw = new BinaryWriter(msw); VoxelFileWriter writer = new VoxelFileWriter(DtVoxelTileLZ4ForTestCompressor.Shared); - writer.Write(bwOut, f, compression); + writer.Write(bw, f, compression); - using var msIn = new MemoryStream(msOut.ToArray()); - using var brIn = new BinaryReader(msIn); - return reader.Read(brIn); + using var msr = new MemoryStream(msw.ToArray()); + using var br = new BinaryReader(msr); + return reader.Read(br); } -} +} \ No newline at end of file diff --git a/test/DotRecast.Detour.Dynamic.Test/VoxelQueryTest.cs b/test/DotRecast.Detour.Dynamic.Test/VoxelQueryTest.cs index 7f5dcbe..475644e 100644 --- a/test/DotRecast.Detour.Dynamic.Test/VoxelQueryTest.cs +++ b/test/DotRecast.Detour.Dynamic.Test/VoxelQueryTest.cs @@ -94,11 +94,11 @@ public class VoxelQueryTest { var bytes = Loader.ToBytes("test_tiles.voxels"); using var ms = new MemoryStream(bytes); - using var bis = new BinaryReader(ms); + using var br = new BinaryReader(ms); // load voxels from file VoxelFileReader reader = new VoxelFileReader(DtVoxelTileLZ4ForTestCompressor.Shared); - VoxelFile f = reader.Read(bis); + VoxelFile f = reader.Read(br); // create dynamic navmesh var mesh = new DynamicNavMesh(f); // build navmesh asynchronously using multiple threads diff --git a/test/DotRecast.Detour.Extras.Test/Unity/Astar/UnityAStarPathfindingImporterTest.cs b/test/DotRecast.Detour.Extras.Test/Unity/Astar/UnityAStarPathfindingImporterTest.cs index 1918130..4f1b5b9 100644 --- a/test/DotRecast.Detour.Extras.Test/Unity/Astar/UnityAStarPathfindingImporterTest.cs +++ b/test/DotRecast.Detour.Extras.Test/Unity/Astar/UnityAStarPathfindingImporterTest.cs @@ -137,7 +137,7 @@ public class UnityAStarPathfindingImporterTest string filename = $"all_tiles_navmesh_{filePostfix}.bin"; string filepath = Path.Combine("test-output", filename); using var fs = new FileStream(filename, FileMode.Create); - using var os = new BinaryWriter(fs); - writer.Write(os, mesh, RcByteOrder.LITTLE_ENDIAN, true); + using var bw = new BinaryWriter(fs); + writer.Write(bw, mesh, RcByteOrder.LITTLE_ENDIAN, true); } } \ No newline at end of file diff --git a/test/DotRecast.Detour.Test/Io/MeshDataReaderWriterTest.cs b/test/DotRecast.Detour.Test/Io/MeshDataReaderWriterTest.cs index 419787e..21a3c44 100644 --- a/test/DotRecast.Detour.Test/Io/MeshDataReaderWriterTest.cs +++ b/test/DotRecast.Detour.Test/Io/MeshDataReaderWriterTest.cs @@ -63,15 +63,15 @@ public class MeshDataReaderWriterTest public void Test(bool cCompatibility, RcByteOrder order) { using var ms = new MemoryStream(); - using var bwos = new BinaryWriter(ms); + using var bw = new BinaryWriter(ms); DtMeshDataWriter writer = new DtMeshDataWriter(); - writer.Write(bwos, meshData, order, cCompatibility); + writer.Write(bw, meshData, order, cCompatibility); ms.Seek(0, SeekOrigin.Begin); - using var bris = new BinaryReader(ms); + using var br = new BinaryReader(ms); DtMeshDataReader reader = new DtMeshDataReader(); - DtMeshData readData = reader.Read(bris, VERTS_PER_POLYGON); + DtMeshData readData = reader.Read(br, VERTS_PER_POLYGON); Assert.That(readData.header.vertCount, Is.EqualTo(meshData.header.vertCount)); Assert.That(readData.header.polyCount, Is.EqualTo(meshData.header.polyCount)); diff --git a/test/DotRecast.Detour.Test/Io/MeshSetReaderTest.cs b/test/DotRecast.Detour.Test/Io/MeshSetReaderTest.cs index 73d7178..942377d 100644 --- a/test/DotRecast.Detour.Test/Io/MeshSetReaderTest.cs +++ b/test/DotRecast.Detour.Test/Io/MeshSetReaderTest.cs @@ -34,8 +34,8 @@ public class MeshSetReaderTest { byte[] @is = Loader.ToBytes("all_tiles_navmesh.bin"); using var ms = new MemoryStream(@is); - using var bris = new BinaryReader(ms); - DtNavMesh mesh = reader.Read(bris, 6); + using var br = new BinaryReader(ms); + DtNavMesh mesh = reader.Read(br, 6); Assert.That(mesh.GetMaxTiles(), Is.EqualTo(128)); Assert.That(mesh.GetParams().maxPolys, Is.EqualTo(0x8000)); Assert.That(mesh.GetParams().tileWidth, Is.EqualTo(9.6f).Within(0.001f)); @@ -62,9 +62,9 @@ public class MeshSetReaderTest { byte[] @is = Loader.ToBytes("dungeon_all_tiles_navmesh.bin"); using var ms = new MemoryStream(@is); - using var bris = new BinaryReader(ms); + using var br = new BinaryReader(ms); - DtNavMesh mesh = reader.Read(bris, 6); + DtNavMesh mesh = reader.Read(br, 6); Assert.That(mesh.GetMaxTiles(), Is.EqualTo(128)); Assert.That(mesh.GetParams().maxPolys, Is.EqualTo(0x8000)); Assert.That(mesh.GetParams().tileWidth, Is.EqualTo(9.6f).Within(0.001f)); @@ -91,9 +91,9 @@ public class MeshSetReaderTest { byte[] @is = Loader.ToBytes("dungeon_all_tiles_navmesh_32bit.bin"); using var ms = new MemoryStream(@is); - using var bris = new BinaryReader(ms); + using var br = new BinaryReader(ms); - DtNavMesh mesh = reader.Read32Bit(bris, 6); + DtNavMesh mesh = reader.Read32Bit(br, 6); Assert.That(mesh.GetMaxTiles(), Is.EqualTo(128)); Assert.That(mesh.GetParams().maxPolys, Is.EqualTo(0x8000)); Assert.That(mesh.GetParams().tileWidth, Is.EqualTo(9.6f).Within(0.001f)); diff --git a/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs b/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs index 1bb40d6..22e381a 100644 --- a/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs +++ b/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs @@ -91,12 +91,12 @@ public class MeshSetReaderWriterTest } using var ms = new MemoryStream(); - using var os = new BinaryWriter(ms); - writer.Write(os, mesh, RcByteOrder.LITTLE_ENDIAN, true); + using var bw = new BinaryWriter(ms); + writer.Write(bw, mesh, RcByteOrder.LITTLE_ENDIAN, true); ms.Seek(0, SeekOrigin.Begin); - using var @is = new BinaryReader(ms); - mesh = reader.Read(@is, 6); + using var br = new BinaryReader(ms); + mesh = reader.Read(br, 6); Assert.That(mesh.GetMaxTiles(), Is.EqualTo(128)); Assert.That(mesh.GetParams().maxPolys, Is.EqualTo(0x8000)); Assert.That(mesh.GetParams().tileWidth, Is.EqualTo(9.6f).Within(0.001f)); diff --git a/test/DotRecast.Detour.TileCache.Test/Io/TileCacheReaderTest.cs b/test/DotRecast.Detour.TileCache.Test/Io/TileCacheReaderTest.cs index c5c4ab3..c6c4a8b 100644 --- a/test/DotRecast.Detour.TileCache.Test/Io/TileCacheReaderTest.cs +++ b/test/DotRecast.Detour.TileCache.Test/Io/TileCacheReaderTest.cs @@ -36,8 +36,8 @@ public class TileCacheReaderTest public void TestNavmesh() { using var ms = new MemoryStream(Loader.ToBytes("all_tiles_tilecache.bin")); - using var @is = new BinaryReader(ms); - DtTileCache tc = reader.Read(@is, 6, null); + using var br = new BinaryReader(ms); + DtTileCache tc = reader.Read(br, 6, null); Assert.That(tc.GetNavMesh().GetMaxTiles(), Is.EqualTo(256)); Assert.That(tc.GetNavMesh().GetParams().maxPolys, Is.EqualTo(16384)); Assert.That(tc.GetNavMesh().GetParams().tileWidth, Is.EqualTo(14.4f).Within(0.001f)); @@ -134,8 +134,8 @@ public class TileCacheReaderTest public void TestDungeon() { using var ms = new MemoryStream(Loader.ToBytes("dungeon_all_tiles_tilecache.bin")); - using var @is = new BinaryReader(ms); - DtTileCache tc = reader.Read(@is, 6, null); + using var br = new BinaryReader(ms); + DtTileCache tc = reader.Read(br, 6, null); Assert.That(tc.GetNavMesh().GetMaxTiles(), Is.EqualTo(256)); Assert.That(tc.GetNavMesh().GetParams().maxPolys, Is.EqualTo(16384)); Assert.That(tc.GetNavMesh().GetParams().tileWidth, Is.EqualTo(14.4f).Within(0.001f)); diff --git a/test/DotRecast.Detour.TileCache.Test/Io/TileCacheReaderWriterTest.cs b/test/DotRecast.Detour.TileCache.Test/Io/TileCacheReaderWriterTest.cs index cda5b18..a14de54 100644 --- a/test/DotRecast.Detour.TileCache.Test/Io/TileCacheReaderWriterTest.cs +++ b/test/DotRecast.Detour.TileCache.Test/Io/TileCacheReaderWriterTest.cs @@ -61,13 +61,13 @@ public class TileCacheReaderWriterTest : AbstractTileCacheTest tc.BuildNavMeshTile(refs); } - using var msout = new MemoryStream(); - using var baos = new BinaryWriter(msout); - writer.Write(baos, tc, RcByteOrder.LITTLE_ENDIAN, cCompatibility); + using var msw = new MemoryStream(); + using var bw = new BinaryWriter(msw); + writer.Write(bw, tc, RcByteOrder.LITTLE_ENDIAN, cCompatibility); - using var msis = new MemoryStream(msout.ToArray()); - using var bais = new BinaryReader(msis); - tc = reader.Read(bais, 6, null); + using var msr = new MemoryStream(msw.ToArray()); + using var br = new BinaryReader(msr); + tc = reader.Read(br, 6, null); Assert.That(tc.GetNavMesh().GetMaxTiles(), Is.EqualTo(256)); Assert.That(tc.GetNavMesh().GetParams().maxPolys, Is.EqualTo(16384)); Assert.That(tc.GetNavMesh().GetParams().tileWidth, Is.EqualTo(14.4f).Within(0.001f)); diff --git a/test/DotRecast.Detour.TileCache.Test/TileCacheFindPathTest.cs b/test/DotRecast.Detour.TileCache.Test/TileCacheFindPathTest.cs index 1a7f46d..96deaf9 100644 --- a/test/DotRecast.Detour.TileCache.Test/TileCacheFindPathTest.cs +++ b/test/DotRecast.Detour.TileCache.Test/TileCacheFindPathTest.cs @@ -38,9 +38,9 @@ public class TileCacheFindPathTest : AbstractTileCacheTest public TileCacheFindPathTest() { - using var msis = new MemoryStream(Loader.ToBytes("dungeon_all_tiles_tilecache.bin")); - using var @is = new BinaryReader(msis); - DtTileCache tcC = new DtTileCacheReader(DtTileCacheCompressorFactory.Shared).Read(@is, 6, new TestTileCacheMeshProcess()); + using var msr = new MemoryStream(Loader.ToBytes("dungeon_all_tiles_tilecache.bin")); + using var br = new BinaryReader(msr); + DtTileCache tcC = new DtTileCacheReader(DtTileCacheCompressorFactory.Shared).Read(br, 6, new TestTileCacheMeshProcess()); navmesh = tcC.GetNavMesh(); query = new DtNavMeshQuery(navmesh); }