Remove SheetType.DualIndexed from voxel rendering.
This commit is contained in:
@@ -54,10 +54,10 @@ namespace OpenRA.Graphics
|
||||
if (allocated)
|
||||
throw new SheetOverflowException("");
|
||||
allocated = true;
|
||||
return SheetBuilder.AllocateSheet(SheetType.DualIndexed, Game.Settings.Graphics.SheetSize);
|
||||
return SheetBuilder.AllocateSheet(SheetType.Indexed, Game.Settings.Graphics.SheetSize);
|
||||
};
|
||||
|
||||
return new SheetBuilder(SheetType.DualIndexed, allocate);
|
||||
return new SheetBuilder(SheetType.Indexed, allocate);
|
||||
}
|
||||
|
||||
public VoxelLoader(IReadOnlyFileSystem fileSystem)
|
||||
@@ -78,6 +78,7 @@ namespace OpenRA.Graphics
|
||||
|
||||
var c = 0;
|
||||
for (var v = 0; v < sv; v++)
|
||||
{
|
||||
for (var u = 0; u < su; u++)
|
||||
{
|
||||
var voxel = first(u, v) ?? second(u, v);
|
||||
@@ -85,22 +86,28 @@ namespace OpenRA.Graphics
|
||||
normals[c] = voxel == null ? (byte)0 : voxel.Normal;
|
||||
c++;
|
||||
}
|
||||
}
|
||||
|
||||
var s = sheetBuilder.Allocate(new Size(su, sv));
|
||||
Util.FastCopyIntoChannel(s, 0, colors);
|
||||
Util.FastCopyIntoChannel(s, 1, normals);
|
||||
var size = new Size(su, sv);
|
||||
var s = sheetBuilder.Allocate(size);
|
||||
var t = sheetBuilder.Allocate(size);
|
||||
Util.FastCopyIntoChannel(s, colors);
|
||||
Util.FastCopyIntoChannel(t, normals);
|
||||
|
||||
// s and t are guaranteed to use the same sheet because
|
||||
// of the custom voxel sheet allocation implementation
|
||||
s.Sheet.CommitBufferedData();
|
||||
|
||||
var channelP = ChannelSelect[(int)s.Channel];
|
||||
var channelC = ChannelSelect[(int)s.Channel + 1];
|
||||
var channelC = ChannelSelect[(int)t.Channel];
|
||||
return new Vertex[6]
|
||||
{
|
||||
new Vertex(coord(0, 0), s.Left, s.Top, 0, 0, channelP, channelC),
|
||||
new Vertex(coord(su, 0), s.Right, s.Top, 0, 0, channelP, channelC),
|
||||
new Vertex(coord(su, sv), s.Right, s.Bottom, 0, 0, channelP, channelC),
|
||||
new Vertex(coord(su, sv), s.Right, s.Bottom, 0, 0, channelP, channelC),
|
||||
new Vertex(coord(0, sv), s.Left, s.Bottom, 0, 0, channelP, channelC),
|
||||
new Vertex(coord(0, 0), s.Left, s.Top, 0, 0, channelP, channelC)
|
||||
new Vertex(coord(0, 0), s.Left, s.Top, t.Left, t.Top, channelP, channelC),
|
||||
new Vertex(coord(su, 0), s.Right, s.Top, t.Right, t.Top, channelP, channelC),
|
||||
new Vertex(coord(su, sv), s.Right, s.Bottom, t.Right, t.Bottom, channelP, channelC),
|
||||
new Vertex(coord(su, sv), s.Right, s.Bottom, t.Right, t.Bottom, channelP, channelC),
|
||||
new Vertex(coord(0, sv), s.Left, s.Bottom, t.Left, t.Bottom, channelP, channelC),
|
||||
new Vertex(coord(0, 0), s.Left, s.Top, t.Left, t.Top, channelP, channelC)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user