use ref parameters in a few more places where able
This commit is contained in:
parent
d20837e199
commit
4946006e8d
|
@ -69,9 +69,9 @@ namespace Blarg.GameFramework.TileMap
|
||||||
color = tileMesh.Color;
|
color = tileMesh.Color;
|
||||||
|
|
||||||
if (tileMesh is CubeTileMesh)
|
if (tileMesh is CubeTileMesh)
|
||||||
HandleCubeMesh(buffer, x, y, z, tile, chunk, (CubeTileMesh)tileMesh, position, transform, color);
|
HandleCubeMesh(buffer, x, y, z, tile, chunk, (CubeTileMesh)tileMesh, ref position, transform, ref color);
|
||||||
else
|
else
|
||||||
HandleGenericMesh(buffer, x, y, z, tile, chunk, tileMesh, position, transform, color);
|
HandleGenericMesh(buffer, x, y, z, tile, chunk, tileMesh, ref position, transform, ref color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -84,9 +84,9 @@ namespace Blarg.GameFramework.TileMap
|
||||||
Tile tile,
|
Tile tile,
|
||||||
TileChunk chunk,
|
TileChunk chunk,
|
||||||
CubeTileMesh mesh,
|
CubeTileMesh mesh,
|
||||||
Point3 tileMapPosition,
|
ref Point3 tileMapPosition,
|
||||||
Matrix4x4 transform,
|
Matrix4x4? transform,
|
||||||
Color color)
|
ref Color color)
|
||||||
{
|
{
|
||||||
// determine what's next to each cube face
|
// determine what's next to each cube face
|
||||||
Tile left = chunk.GetWithinSelfOrNeighbourSafe(x - 1, y, z);
|
Tile left = chunk.GetWithinSelfOrNeighbourSafe(x - 1, y, z);
|
||||||
|
@ -103,9 +103,9 @@ namespace Blarg.GameFramework.TileMap
|
||||||
tile,
|
tile,
|
||||||
mesh,
|
mesh,
|
||||||
chunk,
|
chunk,
|
||||||
tileMapPosition,
|
ref tileMapPosition,
|
||||||
transform,
|
transform,
|
||||||
color,
|
ref color,
|
||||||
mesh.LeftFaceVertexOffset,
|
mesh.LeftFaceVertexOffset,
|
||||||
TileMesh.CUBE_VERTICES_PER_FACE);
|
TileMesh.CUBE_VERTICES_PER_FACE);
|
||||||
}
|
}
|
||||||
|
@ -115,9 +115,9 @@ namespace Blarg.GameFramework.TileMap
|
||||||
tile,
|
tile,
|
||||||
mesh,
|
mesh,
|
||||||
chunk,
|
chunk,
|
||||||
tileMapPosition,
|
ref tileMapPosition,
|
||||||
transform,
|
transform,
|
||||||
color,
|
ref color,
|
||||||
mesh.RightFaceVertexOffset,
|
mesh.RightFaceVertexOffset,
|
||||||
TileMesh.CUBE_VERTICES_PER_FACE);
|
TileMesh.CUBE_VERTICES_PER_FACE);
|
||||||
}
|
}
|
||||||
|
@ -127,9 +127,9 @@ namespace Blarg.GameFramework.TileMap
|
||||||
tile,
|
tile,
|
||||||
mesh,
|
mesh,
|
||||||
chunk,
|
chunk,
|
||||||
tileMapPosition,
|
ref tileMapPosition,
|
||||||
transform,
|
transform,
|
||||||
color,
|
ref color,
|
||||||
mesh.FrontFaceVertexOffset,
|
mesh.FrontFaceVertexOffset,
|
||||||
TileMesh.CUBE_VERTICES_PER_FACE);
|
TileMesh.CUBE_VERTICES_PER_FACE);
|
||||||
}
|
}
|
||||||
|
@ -139,9 +139,9 @@ namespace Blarg.GameFramework.TileMap
|
||||||
tile,
|
tile,
|
||||||
mesh,
|
mesh,
|
||||||
chunk,
|
chunk,
|
||||||
tileMapPosition,
|
ref tileMapPosition,
|
||||||
transform,
|
transform,
|
||||||
color,
|
ref color,
|
||||||
mesh.BackFaceVertexOffset,
|
mesh.BackFaceVertexOffset,
|
||||||
TileMesh.CUBE_VERTICES_PER_FACE);
|
TileMesh.CUBE_VERTICES_PER_FACE);
|
||||||
}
|
}
|
||||||
|
@ -151,9 +151,9 @@ namespace Blarg.GameFramework.TileMap
|
||||||
tile,
|
tile,
|
||||||
mesh,
|
mesh,
|
||||||
chunk,
|
chunk,
|
||||||
tileMapPosition,
|
ref tileMapPosition,
|
||||||
transform,
|
transform,
|
||||||
color,
|
ref color,
|
||||||
mesh.BottomFaceVertexOffset,
|
mesh.BottomFaceVertexOffset,
|
||||||
TileMesh.CUBE_VERTICES_PER_FACE);
|
TileMesh.CUBE_VERTICES_PER_FACE);
|
||||||
}
|
}
|
||||||
|
@ -163,9 +163,9 @@ namespace Blarg.GameFramework.TileMap
|
||||||
tile,
|
tile,
|
||||||
mesh,
|
mesh,
|
||||||
chunk,
|
chunk,
|
||||||
tileMapPosition,
|
ref tileMapPosition,
|
||||||
transform,
|
transform,
|
||||||
color,
|
ref color,
|
||||||
mesh.TopFaceVertexOffset,
|
mesh.TopFaceVertexOffset,
|
||||||
TileMesh.CUBE_VERTICES_PER_FACE);
|
TileMesh.CUBE_VERTICES_PER_FACE);
|
||||||
}
|
}
|
||||||
|
@ -178,9 +178,9 @@ namespace Blarg.GameFramework.TileMap
|
||||||
Tile tile,
|
Tile tile,
|
||||||
TileChunk chunk,
|
TileChunk chunk,
|
||||||
TileMesh mesh,
|
TileMesh mesh,
|
||||||
Point3 tileMapPosition,
|
ref Point3 tileMapPosition,
|
||||||
Matrix4x4 transform,
|
Matrix4x4? transform,
|
||||||
Color color)
|
ref Color color)
|
||||||
{
|
{
|
||||||
bool visible = false;
|
bool visible = false;
|
||||||
|
|
||||||
|
@ -204,16 +204,24 @@ namespace Blarg.GameFramework.TileMap
|
||||||
visible = true;
|
visible = true;
|
||||||
|
|
||||||
if (visible)
|
if (visible)
|
||||||
AddMesh(buffer, tile, mesh, chunk, tileMapPosition, transform, color, 0, mesh.Vertices.NumElements);
|
AddMesh(buffer,
|
||||||
|
tile,
|
||||||
|
mesh,
|
||||||
|
chunk,
|
||||||
|
ref tileMapPosition,
|
||||||
|
transform,
|
||||||
|
ref color,
|
||||||
|
0,
|
||||||
|
mesh.Vertices.NumElements);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void AddMesh(VertexBuffer buffer,
|
protected void AddMesh(VertexBuffer buffer,
|
||||||
Tile tile,
|
Tile tile,
|
||||||
TileMesh sourceMesh,
|
TileMesh sourceMesh,
|
||||||
TileChunk chunk,
|
TileChunk chunk,
|
||||||
Point3 position,
|
ref Point3 position,
|
||||||
Matrix4x4? transform,
|
Matrix4x4? transform,
|
||||||
Color color,
|
ref Color color,
|
||||||
int firstVertex,
|
int firstVertex,
|
||||||
int numVertices)
|
int numVertices)
|
||||||
{
|
{
|
||||||
|
|
Reference in a new issue