Exemplo n.º 1
0
 public void Render(GraphicsBuffer buffer, bool flash)
 {
     var metadata = WorldObjectType.Metadata();
     var color = Palette.GetPalette(0).GetColor(metadata.PaletteIndex + (flash ? 1 : 0));
     foreach (var x in Enumerable.Range(0, 3))
         foreach (var y in Enumerable.Range(0, 3))
             if (metadata.Mask[x][y])
                 buffer.SetPixel(Location.Y + y - 1, Location.X + x - 1, color);
 }
Exemplo n.º 2
0
 public void Render(GraphicsBuffer buffer)
 {
     foreach (var row in Enumerable.Range(0, 200))
     {
         foreach (var column in Enumerable.Range(0, 320))
         {
             var paletteIndex = image[row, column];
             buffer.SetPixel(row, column, palette[paletteIndex]);
         }
     }
 }
Exemplo n.º 3
0
 public void Render(GraphicsBuffer buffer, int topRow, int leftColumn, ColorScheme scheme)
 {
     foreach (var rowIndex in Enumerable.Range(0, height))
     {
         foreach (var columnIndex in Enumerable.Range(0, Width))
         {
             var colorIndex = data[rowIndex * Width + columnIndex];
             if (colorIndex != 0)
                 buffer.SetPixel(
                     topRow + rowIndex,
                     leftColumn + columnIndex,
                     scheme.GetColor(colorIndex));
         }
     }
 }
Exemplo n.º 4
0
 public void Render(GraphicsBuffer buffer, int topRow, int leftColumn)
 {
     var nextIndex = sizeof(int) * 2;
     foreach (var row in Enumerable.Range(0, Height))
     {
         foreach (var column in Enumerable.Range(0, Width))
         {
             var index = nextIndex;
             nextIndex += 4;
             if (data[index + 3] != 0)
             {
                 buffer.SetPixel(
                     topRow + Height - row - 1,
                     leftColumn + column,
                     Color.FromArgb(data[index], data[index + 1], data[index + 2]));
             }
         }
     }
 }