enabled more palette space; now there's ONE constant to change, too.
This commit is contained in:
@@ -28,7 +28,7 @@ namespace OpenRa.Graphics
|
||||
{
|
||||
class HardwarePalette : Sheet
|
||||
{
|
||||
const int maxEntries = 16;
|
||||
public const int MaxPalettes = 64;
|
||||
int allocated = 0;
|
||||
|
||||
// We need to store the Palettes themselves for the remap palettes to work
|
||||
@@ -36,7 +36,7 @@ namespace OpenRa.Graphics
|
||||
static Dictionary<string, Palette> palettes;
|
||||
static Dictionary<string, int> indices;
|
||||
public HardwarePalette(Renderer renderer, Map map)
|
||||
: base(renderer,new Size(256, maxEntries))
|
||||
: base(renderer,new Size(256, MaxPalettes))
|
||||
{
|
||||
palettes = new Dictionary<string, Palette>();
|
||||
indices = new Dictionary<string, int>();
|
||||
|
||||
@@ -52,23 +52,11 @@ namespace OpenRa.Graphics
|
||||
return result;
|
||||
}
|
||||
|
||||
public static readonly int2[] directions =
|
||||
new int2[] {
|
||||
new int2( -1, -1 ),
|
||||
new int2( -1, 0 ),
|
||||
new int2( -1, 1 ),
|
||||
new int2( 0, -1 ),
|
||||
new int2( 0, 1 ),
|
||||
new int2( 1, -1 ),
|
||||
new int2( 1, 0 ),
|
||||
new int2( 1, 1 ),
|
||||
};
|
||||
|
||||
static float[] channelSelect = { 0.75f, 0.25f, -0.25f, -0.75f };
|
||||
|
||||
public static void FastCreateQuad(Vertex[] vertices, ushort[] indices, float2 o, Sprite r, int palette, int nv, int ni, float2 size)
|
||||
{
|
||||
float2 attrib = new float2(palette / 16.0f, channelSelect[(int)r.channel]);
|
||||
var attrib = new float2(palette / (float)HardwarePalette.MaxPalettes, channelSelect[(int)r.channel]);
|
||||
|
||||
vertices[nv] = new Vertex(o,
|
||||
r.FastMapTextureCoords(0), attrib);
|
||||
|
||||
Reference in New Issue
Block a user