mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
Fix code style
This commit is contained in:
@@ -126,8 +126,11 @@ namespace GameRes
|
|||||||
public static ImageData Create (ImageMetaData info, PixelFormat format, BitmapPalette palette,
|
public static ImageData Create (ImageMetaData info, PixelFormat format, BitmapPalette palette,
|
||||||
Array pixel_data)
|
Array pixel_data)
|
||||||
{
|
{
|
||||||
return Create (info, format, palette, pixel_data,
|
if (format.BitsPerPixel == 4)
|
||||||
format.BitsPerPixel == 4 ? (int)info.Width*format.BitsPerPixel/8 : (int)info.Width*((format.BitsPerPixel+7)/8));
|
return Create(info, format, palette, pixel_data,
|
||||||
|
(int)info.Width*format.BitsPerPixel/8);
|
||||||
|
return Create(info, format, palette, pixel_data,
|
||||||
|
(int)info.Width*((format.BitsPerPixel+7)/8));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ImageData CreateFlipped (ImageMetaData info, PixelFormat format, BitmapPalette palette,
|
public static ImageData CreateFlipped (ImageMetaData info, PixelFormat format, BitmapPalette palette,
|
||||||
@@ -218,10 +221,10 @@ namespace GameRes
|
|||||||
Func<int, Color> get_color;
|
Func<int, Color> get_color;
|
||||||
if (PaletteFormat.Bgr == format || PaletteFormat.BgrX == format)
|
if (PaletteFormat.Bgr == format || PaletteFormat.BgrX == format)
|
||||||
get_color = x => Color.FromRgb (palette_data[x+2], palette_data[x+1], palette_data[x]);
|
get_color = x => Color.FromRgb (palette_data[x+2], palette_data[x+1], palette_data[x]);
|
||||||
else if (PaletteFormat.BgrA7 == format)
|
|
||||||
get_color = x => Color.FromArgb(palette_data[x+3] >= byte.MaxValue / 2 ? byte.MaxValue : (byte)(palette_data[x+3] << 1), palette_data[x+2], palette_data[x+1], palette_data[x]);
|
|
||||||
else if (PaletteFormat.BgrA == format)
|
else if (PaletteFormat.BgrA == format)
|
||||||
get_color = x => Color.FromArgb (palette_data[x+3], palette_data[x+2], palette_data[x+1], palette_data[x]);
|
get_color = x => Color.FromArgb (palette_data[x+3], palette_data[x+2], palette_data[x+1], palette_data[x]);
|
||||||
|
else if (PaletteFormat.BgrA7 == format)
|
||||||
|
get_color = x => Color.FromArgb (palette_data[x+3] >= byte.MaxValue / 2 ? byte.MaxValue : (byte)(palette_data[x+3] << 1), palette_data[x+2], palette_data[x+1], palette_data[x]);
|
||||||
else if (PaletteFormat.RgbA == format)
|
else if (PaletteFormat.RgbA == format)
|
||||||
get_color = x => Color.FromArgb (palette_data[x+3], palette_data[x], palette_data[x+1], palette_data[x+2]);
|
get_color = x => Color.FromArgb (palette_data[x+3], palette_data[x], palette_data[x+1], palette_data[x+2]);
|
||||||
else if (PaletteFormat.RgbA7 == format)
|
else if (PaletteFormat.RgbA7 == format)
|
||||||
|
|||||||
Reference in New Issue
Block a user