(svn r14229) -Feature: allow overriding the palette of the base GRFs. This way you can play with NewGRFs made for the Windows palette with the DOS palettes base GRFs (and vice versa). Note that for this to work correctly ALL NewGRFs must use the same palette; mix and match is not yet supported.

This commit is contained in:
rubidium
2008-09-02 18:45:15 +00:00
parent 97b1eb2c6f
commit 9ca1972e01
6 changed files with 143 additions and 9 deletions

View File

@@ -83,7 +83,7 @@ bool SpriteLoaderGrf::LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot,
data = &sprite->data[y * sprite->width + skip];
for (int x = 0; x < length; x++) {
data->m = *dest;
data->m = ((sprite_type == ST_NORMAL && _palette_remap_grf[file_slot]) ? _palette_remap[*dest] : *dest);
dest++;
data++;
}
@@ -91,8 +91,10 @@ bool SpriteLoaderGrf::LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot,
}
} else {
dest = dest_orig;
for (int i = 0; i < sprite->width * sprite->height; i++)
sprite->data[i].m = dest[i];
for (int i = 0; i < sprite->width * sprite->height; i++) {
sprite->data[i].m = ((sprite_type == ST_NORMAL && _palette_remap_grf[file_slot]) ? _palette_remap[dest[i]] : dest[i]);
}
}
/* Make sure to mark all transparent pixels transparent on the alpha channel too */