Skip to content

Commit

Permalink
Extend Allegro Palettes from 0-63 to 0-255
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanDrake committed Jul 7, 2024
1 parent 29bb4fa commit 628232d
Show file tree
Hide file tree
Showing 18 changed files with 121 additions and 312 deletions.
36 changes: 18 additions & 18 deletions Common/gfx/image_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ static void bmp_read_palette(int bytes, RGB *pal, Stream *in, bool is_os2)
int i, j;

for (i=j=0; (i+3 <= bytes && j < PAL_SIZE); j++) {
pal[j].b = static_cast<uint8_t>(in->ReadInt8()) / 4;
pal[j].g = static_cast<uint8_t>(in->ReadInt8()) / 4;
pal[j].r = static_cast<uint8_t>(in->ReadInt8()) / 4;
pal[j].b = static_cast<uint8_t>(in->ReadInt8());
pal[j].g = static_cast<uint8_t>(in->ReadInt8());
pal[j].r = static_cast<uint8_t>(in->ReadInt8());

i += 3;

Expand Down Expand Up @@ -526,9 +526,9 @@ bool SaveBMP(const BitmapData &bmp, const RGB *pal, Stream *out) {

/* palette */
for (i=0; i<hdr.colorsCount; i++) {
out->WriteInt8(_rgb_scale_6[pal[i].b]);
out->WriteInt8(_rgb_scale_6[pal[i].g]);
out->WriteInt8(_rgb_scale_6[pal[i].r]);
out->WriteInt8(pal[i].b);
out->WriteInt8(pal[i].g);
out->WriteInt8(pal[i].r);
out->WriteInt8(0);
}

Expand Down Expand Up @@ -699,9 +699,9 @@ bool SavePCX(const BitmapData &bmp, const RGB *pal, Stream *out)
out->WriteInt16(200); /* VDpi */

for (c=0; c<16; c++) {
out->WriteInt8(_rgb_scale_6[pal[c].r]);
out->WriteInt8(_rgb_scale_6[pal[c].g]);
out->WriteInt8(_rgb_scale_6[pal[c].b]);
out->WriteInt8(pal[c].r);
out->WriteInt8(pal[c].g);
out->WriteInt8(pal[c].b);
}

out->WriteInt8(0); /* reserved */
Expand Down Expand Up @@ -760,9 +760,9 @@ bool SavePCX(const BitmapData &bmp, const RGB *pal, Stream *out)
out->WriteInt8(12);

for (c=0; c<256; c++) {
out->WriteInt8(_rgb_scale_6[pal[c].r]);
out->WriteInt8(_rgb_scale_6[pal[c].g]);
out->WriteInt8(_rgb_scale_6[pal[c].b]);
out->WriteInt8(pal[c].r);
out->WriteInt8(pal[c].g);
out->WriteInt8(pal[c].b);
}
}
return true;
Expand All @@ -788,9 +788,9 @@ PixelBuffer LoadPCX(Stream *in, RGB *pal) {
in->ReadInt32(); /* skip DPI values */

for (int i=0; i<16; i++) { /* read the 16 color palette */
pal[i].r = static_cast<uint8_t>(in->ReadInt8()) / 4;
pal[i].g = static_cast<uint8_t>(in->ReadInt8()) / 4;
pal[i].b = static_cast<uint8_t>(in->ReadInt8()) / 4;
pal[i].r = static_cast<uint8_t>(in->ReadInt8());
pal[i].g = static_cast<uint8_t>(in->ReadInt8());
pal[i].b = static_cast<uint8_t>(in->ReadInt8());
}

in->ReadInt8();
Expand Down Expand Up @@ -869,9 +869,9 @@ PixelBuffer LoadPCX(Stream *in, RGB *pal) {
for (int8_t j=0; !in->EOS(); j = in->ReadInt8()) {
if (j == 12) {
for (int i=0; i<256; i++) {
pal[i].r = static_cast<uint8_t>(in->ReadInt8()) / 4;
pal[i].g = static_cast<uint8_t>(in->ReadInt8()) / 4;
pal[i].b = static_cast<uint8_t>(in->ReadInt8()) / 4;
pal[i].r = static_cast<uint8_t>(in->ReadInt8());
pal[i].g = static_cast<uint8_t>(in->ReadInt8());
pal[i].b = static_cast<uint8_t>(in->ReadInt8());
pal[i].filler = 0;
}
break;
Expand Down
6 changes: 3 additions & 3 deletions Editor/AGS.Editor/DataFileWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,9 @@ private static void WriteGameSetupStructBase(BinaryWriter writer, Game game, out
}
for (int i = 0; i < 256; ++i)
{
writer.Write((byte)(game.Palette[i].Colour.R / 4));
writer.Write((byte)(game.Palette[i].Colour.G / 4));
writer.Write((byte)(game.Palette[i].Colour.B / 4));
writer.Write((byte)(game.Palette[i].Colour.R));
writer.Write((byte)(game.Palette[i].Colour.G));
writer.Write((byte)(game.Palette[i].Colour.B));
writer.Write((byte)0); // filler
}
writer.Write(game.ViewCount);
Expand Down
8 changes: 4 additions & 4 deletions Editor/AGS.Editor/ImportExport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public static PaletteEntry[] ImportPaletteFromFile(string filename)

for (int i = 0; i < newPalette.Length; i++)
{
newPalette[i] = new PaletteEntry(i, Color.FromArgb(rawPalette[i * 3] * 4, rawPalette[i * 3 + 1] * 4, rawPalette[i * 3 + 2] * 4));
newPalette[i] = new PaletteEntry(i, Color.FromArgb(rawPalette[i * 3], rawPalette[i * 3 + 1], rawPalette[i * 3 + 2]));
}
}
else if (filename.ToLower().EndsWith(".bmp"))
Expand Down Expand Up @@ -694,9 +694,9 @@ public static void ExportCharacter272(Character character, string fileName, Game
writer.Write((int)6);
for (int i = 0; i < 256; i++)
{
writer.Write((byte)(game.Palette[i].Colour.R / 4));
writer.Write((byte)(game.Palette[i].Colour.G / 4));
writer.Write((byte)(game.Palette[i].Colour.B / 4));
writer.Write((byte)(game.Palette[i].Colour.R));
writer.Write((byte)(game.Palette[i].Colour.G));
writer.Write((byte)(game.Palette[i].Colour.B));
writer.Write((byte)0);
}

Expand Down
8 changes: 4 additions & 4 deletions Editor/AGS.Editor/Utils/ColorMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ public int MapRgbColorToAgsColourNumber(Color rgbColor)
return FindNearestColourInGamePalette(rgbColor);
}

return (rgbColor.B / 8) + ((green / 4) << 5) + ((rgbColor.R / 8) << 11);
return rgbColor.B + (rgbColor.G << 8) + (rgbColor.R << 16);
}

public Color MapAgsColourNumberToRgbColor(int agsColorNumber)
{
int red = ((agsColorNumber >> 11) * 8) & 255;
int green = ((agsColorNumber >> 5) * 4) & 255;
int blue = ((agsColorNumber) * 8) & 255;
int red = (agsColorNumber >> 16) & 255;
int green = (agsColorNumber >> 8) & 255;
int blue = agsColorNumber & 255;
if (((agsColorNumber > 0) && (agsColorNumber < 32)) ||
(_editor.CurrentGame.Settings.ColorDepth == GameColorDepth.Palette))
{
Expand Down
5 changes: 2 additions & 3 deletions Editor/AGS.Editor/Utils/PaletteUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,10 @@ public static void RemapBackground(Bitmap scene, bool exactPal, PaletteEntry[] g
usedSlotCount++;
}

// Nativize RGB, clamp to 64-unit format to match historical engine's palette restriction
Color[] srcColors = new Color[256];
for (int i = 0; i < palette.Entries.Length; ++i)
{
srcColors[i] = Color.FromArgb(0xFF, palette.Entries[i].R / 4, palette.Entries[i].G / 4, palette.Entries[i].B / 4);
srcColors[i] = Color.FromArgb(0xFF, palette.Entries[i].R, palette.Entries[i].G, palette.Entries[i].B);
}
// Fill any remaining slots with black color
for (int i = palette.Entries.Length; i < 256; ++i)
Expand Down Expand Up @@ -186,7 +185,7 @@ public static void RemapBackground(Bitmap scene, bool exactPal, PaletteEntry[] g
ColorPalette finalPalette = BitmapExtensions.CreateColorPalette();
for (int i = 0; i < 256; ++i)
{
finalPalette.Entries[i] = Color.FromArgb(0xFF, finalColors[i].R * 4, finalColors[i].G * 4, finalColors[i].B * 4);
finalPalette.Entries[i] = Color.FromArgb(0xFF, finalColors[i].R, finalColors[i].G, finalColors[i].B);
}
scene.SetRawData(pixels);
scene.Palette = finalPalette;
Expand Down
19 changes: 6 additions & 13 deletions Editor/AGS.Native/agsnative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ void sort_out_transparency(Common::Bitmap *toimp, int sprite_import_method, RGB*
if (toimp->GetColorDepth() > 8)
{
if (importedColourDepth == 8)
replaceWithCol = makecol_depth(toimp->GetColorDepth(), itspal[0].r * 4, itspal[0].g * 4, itspal[0].b * 4);
replaceWithCol = makecol_depth(toimp->GetColorDepth(), itspal[0].r, itspal[0].g, itspal[0].b);
else
replaceWithCol = 0;
}
Expand Down Expand Up @@ -1710,13 +1710,6 @@ static void ConvertPaletteToNativeFormat(AGSBitmap *dst, RGB *imgpal, cli::array
imgpal[i].g = 0;
imgpal[i].b = 0;
}
else if (thisgame.color_depth == 1)
{
// allegro palette is 0-63
imgpal[i].r = bmpPalette[i].R / 4;
imgpal[i].g = bmpPalette[i].G / 4;
imgpal[i].b = bmpPalette[i].B / 4;
}
else
{
imgpal[i].r = bmpPalette[i].R;
Expand Down Expand Up @@ -1967,7 +1960,7 @@ void SetBitmapPaletteFromGlobalPalette(System::Drawing::Bitmap ^bmp)
cli::array<System::Drawing::Color> ^bmpPalette = colorPal->Entries;
for (int i = 0; i < 256; i++)
{
bmpPalette[i] = Color::FromArgb((i == 0) ? i : 255, palette[i].r * 4, palette[i].g * 4, palette[i].b * 4);
bmpPalette[i] = Color::FromArgb((i == 0) ? i : 255, palette[i].r, palette[i].g, palette[i].b);
}

// Need to set this back to make it pick up the changes
Expand Down Expand Up @@ -2101,9 +2094,9 @@ void ApplyPalette(cli::array<PaletteEntry^>^ newPalette)
{
for each (PaletteEntry ^colour in newPalette)
{
palette[colour->Index].r = colour->Colour.R / 4;
palette[colour->Index].g = colour->Colour.G / 4;
palette[colour->Index].b = colour->Colour.B / 4;
palette[colour->Index].r = colour->Colour.R;
palette[colour->Index].g = colour->Colour.G;
palette[colour->Index].b = colour->Colour.B;
}
set_palette(palette);
}
Expand Down Expand Up @@ -2434,7 +2427,7 @@ Game^ import_compiled_game_dta(const AGSString &filename)
{
game->Palette[i]->ColourType = PaletteColourType::Gamewide;
}
game->Palette[i]->Colour = Color::FromArgb(palette[i].r * 4, palette[i].g * 4, palette[i].b * 4);
game->Palette[i]->Colour = Color::FromArgb(palette[i].r, palette[i].g, palette[i].b);
}

for (size_t i = 0; i < thisgamePlugins.size(); ++i)
Expand Down
8 changes: 4 additions & 4 deletions Editor/AGS.Types/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1060,9 +1060,9 @@ public byte[] GetPaletteAsRawPAL()
byte[] rawPalette = new byte[768];
for (int i = 0; i < _palette.Length; i++)
{
rawPalette[i * 3] = (byte)(_palette[i].Colour.R / 4);
rawPalette[i * 3 + 1] = (byte)(_palette[i].Colour.G / 4);
rawPalette[i * 3 + 2] = (byte)(_palette[i].Colour.B / 4);
rawPalette[i * 3] = (byte)(_palette[i].Colour.R);
rawPalette[i * 3 + 1] = (byte)(_palette[i].Colour.G);
rawPalette[i * 3 + 2] = (byte)(_palette[i].Colour.B);
}
return rawPalette;
}
Expand All @@ -1071,7 +1071,7 @@ public void SetPaletteFromRawPAL(byte[] rawPalette, bool resetColourTypes)
{
for (int i = 0; i < _palette.Length; i++)
{
_palette[i] = new PaletteEntry(i, Color.FromArgb(rawPalette[i * 3] * 4, rawPalette[i * 3 + 1] * 4, rawPalette[i * 3 + 2] * 4));
_palette[i] = new PaletteEntry(i, Color.FromArgb(rawPalette[i * 3], rawPalette[i * 3 + 1], rawPalette[i * 3 + 2]));
if (resetColourTypes)
{
if (i <= 41)
Expand Down
4 changes: 2 additions & 2 deletions Editor/Native/color_native.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ void __my_setcolor(int *ctset, int newcol, int wantColDep)
else if ((newcol >= 32) && (wantColDep > 16)) {
// true-color
#ifdef SWAP_RB_HICOL_FOR_32to24_32
ctset[0] = makeacol32(getb16(newcol), getg16(newcol), getr16(newcol), 255);
ctset[0] = makeacol32(getb24(newcol), getg24(newcol), getr24(newcol), 255);
#else
ctset[0] = makeacol32(getr16(newcol), getg16(newcol), getb16(newcol), 255);
ctset[0] = makeacol32(getr24(newcol), getg24(newcol), getb24(newcol), 255);
#endif
}
else if (newcol >= 32) {
Expand Down
12 changes: 6 additions & 6 deletions Engine/ac/room.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,12 +603,12 @@ void load_new_room(int newnum, CharacterInfo*forchar) {
// the create_rgb_table call
// so, fix them
for (int ff = 0; ff < 256; ff++) {
if (palette[ff].r > 63)
palette[ff].r = 63;
if (palette[ff].g > 63)
palette[ff].g = 63;
if (palette[ff].b > 63)
palette[ff].b = 63;
if (palette[ff].r > 255)
palette[ff].r = 255;
if (palette[ff].g > 255)
palette[ff].g = 255;
if (palette[ff].b > 255)
palette[ff].b = 255;
}
create_rgb_table (&rgb_table, palette, nullptr);
rgb_map = &rgb_table;
Expand Down
6 changes: 3 additions & 3 deletions Engine/ac/screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,9 @@ class ScreenFadeSoftware : public ScreenTransition
{
for (int a = 0; a < 256; a++)
{
_fadePal[a].r = r / 4;
_fadePal[a].g = g / 4;
_fadePal[a].b = b / 4;
_fadePal[a].r = r;
_fadePal[a].g = g;
_fadePal[a].b = b;
}
}

Expand Down
6 changes: 3 additions & 3 deletions libsrc/allegro/include/allegro/inline/color.inl
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ AL_INLINE(int, makeacol32, (int r, int g, int b, int a),

AL_INLINE(int, getr8, (int c),
{
return _rgb_scale_6[(int)_current_palette[c].r];
return (int)_current_palette[c].r;
})


AL_INLINE(int, getg8, (int c),
{
return _rgb_scale_6[(int)_current_palette[c].g];
return (int)_current_palette[c].g;
})


AL_INLINE(int, getb8, (int c),
{
return _rgb_scale_6[(int)_current_palette[c].b];
return (int)_current_palette[c].b;
})


Expand Down
80 changes: 5 additions & 75 deletions libsrc/allegro/src/allegro.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,84 +75,14 @@ PALETTE _current_palette;
int _current_palette_changed = 0xFFFFFFFF;


PALETTE desktop_palette =
PALETTE desktop_palette =
{
{ 63, 63, 63, 0 }, { 63, 0, 0, 0 }, { 0, 63, 0, 0 }, { 63, 63, 0, 0 },
{ 0, 0, 63, 0 }, { 63, 0, 63, 0 }, { 0, 63, 63, 0 }, { 16, 16, 16, 0 },
{ 31, 31, 31, 0 }, { 63, 31, 31, 0 }, { 31, 63, 31, 0 }, { 63, 63, 31, 0 },
{ 31, 31, 63, 0 }, { 63, 31, 63, 0 }, { 31, 63, 63, 0 }, { 0, 0, 0, 0 }
{ 255, 255, 255, 0 },{ 255, 0, 0, 0 },{ 0, 255, 0, 0 },{ 255, 255, 0, 0 },
{ 0, 0, 255, 0 },{ 255, 0, 255, 0 },{ 0, 255, 255, 0 },{ 65, 65, 65, 0 },
{ 125, 125, 125, 0 },{ 255, 125, 125, 0 },{ 125, 255, 125, 0 },{ 255, 255, 125, 0 },
{ 125, 125, 255, 0 },{ 255, 125, 255, 0 },{ 125, 255, 255, 0 },{ 0, 0, 0, 0 }
};


PALETTE default_palette =
{
{ 0, 0, 0, 0 }, { 0, 0, 42, 0 }, { 0, 42, 0, 0 }, { 0, 42, 42, 0 },
{ 42, 0, 0, 0 }, { 42, 0, 42, 0 }, { 42, 21, 0, 0 }, { 42, 42, 42, 0 },
{ 21, 21, 21, 0 }, { 21, 21, 63, 0 }, { 21, 63, 21, 0 }, { 21, 63, 63, 0 },
{ 63, 21, 21, 0 }, { 63, 21, 63, 0 }, { 63, 63, 21, 0 }, { 63, 63, 63, 0 },
{ 0, 0, 0, 0 }, { 5, 5, 5, 0 }, { 8, 8, 8, 0 }, { 11, 11, 11, 0 },
{ 14, 14, 14, 0 }, { 17, 17, 17, 0 }, { 20, 20, 20, 0 }, { 24, 24, 24, 0 },
{ 28, 28, 28, 0 }, { 32, 32, 32, 0 }, { 36, 36, 36, 0 }, { 40, 40, 40, 0 },
{ 45, 45, 45, 0 }, { 50, 50, 50, 0 }, { 56, 56, 56, 0 }, { 63, 63, 63, 0 },
{ 0, 0, 63, 0 }, { 16, 0, 63, 0 }, { 31, 0, 63, 0 }, { 47, 0, 63, 0 },
{ 63, 0, 63, 0 }, { 63, 0, 47, 0 }, { 63, 0, 31, 0 }, { 63, 0, 16, 0 },
{ 63, 0, 0, 0 }, { 63, 16, 0, 0 }, { 63, 31, 0, 0 }, { 63, 47, 0, 0 },
{ 63, 63, 0, 0 }, { 47, 63, 0, 0 }, { 31, 63, 0, 0 }, { 16, 63, 0, 0 },
{ 0, 63, 0, 0 }, { 0, 63, 16, 0 }, { 0, 63, 31, 0 }, { 0, 63, 47, 0 },
{ 0, 63, 63, 0 }, { 0, 47, 63, 0 }, { 0, 31, 63, 0 }, { 0, 16, 63, 0 },
{ 31, 31, 63, 0 }, { 39, 31, 63, 0 }, { 47, 31, 63, 0 }, { 55, 31, 63, 0 },
{ 63, 31, 63, 0 }, { 63, 31, 55, 0 }, { 63, 31, 47, 0 }, { 63, 31, 39, 0 },
{ 63, 31, 31, 0 }, { 63, 39, 31, 0 }, { 63, 47, 31, 0 }, { 63, 55, 31, 0 },
{ 63, 63, 31, 0 }, { 55, 63, 31, 0 }, { 47, 63, 31, 0 }, { 39, 63, 31, 0 },
{ 31, 63, 31, 0 }, { 31, 63, 39, 0 }, { 31, 63, 47, 0 }, { 31, 63, 55, 0 },
{ 31, 63, 63, 0 }, { 31, 55, 63, 0 }, { 31, 47, 63, 0 }, { 31, 39, 63, 0 },
{ 45, 45, 63, 0 }, { 49, 45, 63, 0 }, { 54, 45, 63, 0 }, { 58, 45, 63, 0 },
{ 63, 45, 63, 0 }, { 63, 45, 58, 0 }, { 63, 45, 54, 0 }, { 63, 45, 49, 0 },
{ 63, 45, 45, 0 }, { 63, 49, 45, 0 }, { 63, 54, 45, 0 }, { 63, 58, 45, 0 },
{ 63, 63, 45, 0 }, { 58, 63, 45, 0 }, { 54, 63, 45, 0 }, { 49, 63, 45, 0 },
{ 45, 63, 45, 0 }, { 45, 63, 49, 0 }, { 45, 63, 54, 0 }, { 45, 63, 58, 0 },
{ 45, 63, 63, 0 }, { 45, 58, 63, 0 }, { 45, 54, 63, 0 }, { 45, 49, 63, 0 },
{ 0, 0, 28, 0 }, { 7, 0, 28, 0 }, { 14, 0, 28, 0 }, { 21, 0, 28, 0 },
{ 28, 0, 28, 0 }, { 28, 0, 21, 0 }, { 28, 0, 14, 0 }, { 28, 0, 7, 0 },
{ 28, 0, 0, 0 }, { 28, 7, 0, 0 }, { 28, 14, 0, 0 }, { 28, 21, 0, 0 },
{ 28, 28, 0, 0 }, { 21, 28, 0, 0 }, { 14, 28, 0, 0 }, { 7, 28, 0, 0 },
{ 0, 28, 0, 0 }, { 0, 28, 7, 0 }, { 0, 28, 14, 0 }, { 0, 28, 21, 0 },
{ 0, 28, 28, 0 }, { 0, 21, 28, 0 }, { 0, 14, 28, 0 }, { 0, 7, 28, 0 },
{ 14, 14, 28, 0 }, { 17, 14, 28, 0 }, { 21, 14, 28, 0 }, { 24, 14, 28, 0 },
{ 28, 14, 28, 0 }, { 28, 14, 24, 0 }, { 28, 14, 21, 0 }, { 28, 14, 17, 0 },
{ 28, 14, 14, 0 }, { 28, 17, 14, 0 }, { 28, 21, 14, 0 }, { 28, 24, 14, 0 },
{ 28, 28, 14, 0 }, { 24, 28, 14, 0 }, { 21, 28, 14, 0 }, { 17, 28, 14, 0 },
{ 14, 28, 14, 0 }, { 14, 28, 17, 0 }, { 14, 28, 21, 0 }, { 14, 28, 24, 0 },
{ 14, 28, 28, 0 }, { 14, 24, 28, 0 }, { 14, 21, 28, 0 }, { 14, 17, 28, 0 },
{ 20, 20, 28, 0 }, { 22, 20, 28, 0 }, { 24, 20, 28, 0 }, { 26, 20, 28, 0 },
{ 28, 20, 28, 0 }, { 28, 20, 26, 0 }, { 28, 20, 24, 0 }, { 28, 20, 22, 0 },
{ 28, 20, 20, 0 }, { 28, 22, 20, 0 }, { 28, 24, 20, 0 }, { 28, 26, 20, 0 },
{ 28, 28, 20, 0 }, { 26, 28, 20, 0 }, { 24, 28, 20, 0 }, { 22, 28, 20, 0 },
{ 20, 28, 20, 0 }, { 20, 28, 22, 0 }, { 20, 28, 24, 0 }, { 20, 28, 26, 0 },
{ 20, 28, 28, 0 }, { 20, 26, 28, 0 }, { 20, 24, 28, 0 }, { 20, 22, 28, 0 },
{ 0, 0, 16, 0 }, { 4, 0, 16, 0 }, { 8, 0, 16, 0 }, { 12, 0, 16, 0 },
{ 16, 0, 16, 0 }, { 16, 0, 12, 0 }, { 16, 0, 8, 0 }, { 16, 0, 4, 0 },
{ 16, 0, 0, 0 }, { 16, 4, 0, 0 }, { 16, 8, 0, 0 }, { 16, 12, 0, 0 },
{ 16, 16, 0, 0 }, { 12, 16, 0, 0 }, { 8, 16, 0, 0 }, { 4, 16, 0, 0 },
{ 0, 16, 0, 0 }, { 0, 16, 4, 0 }, { 0, 16, 8, 0 }, { 0, 16, 12, 0 },
{ 0, 16, 16, 0 }, { 0, 12, 16, 0 }, { 0, 8, 16, 0 }, { 0, 4, 16, 0 },
{ 8, 8, 16, 0 }, { 10, 8, 16, 0 }, { 12, 8, 16, 0 }, { 14, 8, 16, 0 },
{ 16, 8, 16, 0 }, { 16, 8, 14, 0 }, { 16, 8, 12, 0 }, { 16, 8, 10, 0 },
{ 16, 8, 8, 0 }, { 16, 10, 8, 0 }, { 16, 12, 8, 0 }, { 16, 14, 8, 0 },
{ 16, 16, 8, 0 }, { 14, 16, 8, 0 }, { 12, 16, 8, 0 }, { 10, 16, 8, 0 },
{ 8, 16, 8, 0 }, { 8, 16, 10, 0 }, { 8, 16, 12, 0 }, { 8, 16, 14, 0 },
{ 8, 16, 16, 0 }, { 8, 14, 16, 0 }, { 8, 12, 16, 0 }, { 8, 10, 16, 0 },
{ 11, 11, 16, 0 }, { 12, 11, 16, 0 }, { 13, 11, 16, 0 }, { 15, 11, 16, 0 },
{ 16, 11, 16, 0 }, { 16, 11, 15, 0 }, { 16, 11, 13, 0 }, { 16, 11, 12, 0 },
{ 16, 11, 11, 0 }, { 16, 12, 11, 0 }, { 16, 13, 11, 0 }, { 16, 15, 11, 0 },
{ 16, 16, 11, 0 }, { 15, 16, 11, 0 }, { 13, 16, 11, 0 }, { 12, 16, 11, 0 },
{ 11, 16, 11, 0 }, { 11, 16, 12, 0 }, { 11, 16, 13, 0 }, { 11, 16, 15, 0 },
{ 11, 16, 16, 0 }, { 11, 15, 16, 0 }, { 11, 13, 16, 0 }, { 11, 12, 16, 0 },
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 },
{ 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 63, 63, 63, 0 }
};


/* colors for the standard GUI dialogs (alerts, file selector, etc) */
int gui_fg_color = 255;
int gui_mg_color = 8;
Expand Down
2 changes: 1 addition & 1 deletion libsrc/allegro/src/blit.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static int get_replacement_mask_color(BITMAP *bmp)
if (rgb_map)
return rgb_map->data[31][1][31];
else
return bestfit_color(_current_palette, 63, 1, 63);
return bestfit_color(_current_palette, 255, 1, 255);
}
else {
do
Expand Down
Loading

0 comments on commit 628232d

Please sign in to comment.