(svn r18476) [0.7] -Backport from trunk:

- Fix: (Invalid) GRFs could trigger invalid reads (r18391)
- Fix: One could not share orders between buses carrying different cargos (r18380)
- Fix: Off-by-one in the preconfigured music lists [FS#3339] (r18369)
- Change [FS#3349]: Recolour the bubble generator just like any other industry (r18409)
- Add: Some missing latin-ish characters from the OpenGFX set (r18431)
This commit is contained in:
rubidium 2009-12-13 00:13:06 +00:00
parent 8808835412
commit fd89332101
11 changed files with 29 additions and 22 deletions

Binary file not shown.

Binary file not shown.

View File

@ -24,7 +24,7 @@ TRGI.GRF = da6a6c9dcc451eec88d79211437b76a8
TRGC.GRF = ed446637e034104c5559b32c18afe78d
TRGH.GRF = ee6616fb0e6ef6b24892c58c93d86fc9
TRGT.GRF = e30e8a398ae86c03dc534a8ac7dfb3b6
OPENTTDD.GRF = c886c7d5b38a93f2cb1cdc0d33472eb8
OPENTTDD.GRF = 2e1f3667175e8eeb013ea35881ecffb7
[origin]
default = You can find it on your Transport Tycoon Deluxe CD-ROM.

View File

@ -24,7 +24,7 @@ TRGI.GRF = da6a6c9dcc451eec88d79211437b76a8
TRGC.GRF = ed446637e034104c5559b32c18afe78d
TRGH.GRF = ee6616fb0e6ef6b24892c58c93d86fc9
TRGT.GRF = fcde1d7e8a74197d72a62695884b909e
OPENTTDD.GRF = c886c7d5b38a93f2cb1cdc0d33472eb8
OPENTTDD.GRF = 2e1f3667175e8eeb013ea35881ecffb7
[origin]
default = You can find it on your Transport Tycoon Deluxe CD-ROM.

View File

@ -24,7 +24,7 @@ TRGIR.GRF = 0c2484ff6be49fc63a83be6ab5c38f32
TRGCR.GRF = 3668f410c761a050b5e7095a2b14879b
TRGHR.GRF = 06bf2b7a31766f048baac2ebe43457b1
TRGTR.GRF = de53650517fe661ceaa3138c6edb0eb8
OPENTTDW.GRF = b6689105405fa3ea34cb8a5543633d29
OPENTTDW.GRF = a73ff4dce8936fadc02dea183afad638
[origin]
default = You can find it on your Transport Tycoon Deluxe CD-ROM.

View File

@ -64,7 +64,7 @@ static ReusableBuffer<uint8> _cursor_backup;
*/
static Rect _invalid_rect;
static const byte *_colour_remap_ptr;
static byte _string_colourremap[3];
static byte _string_colourremap[3]; ///< Recoloursprite for stringdrawing. The grf loader ensures, that ST_FONT sprites only use colours 0 to 2.
enum {
DIRTY_BLOCK_HEIGHT = 8,

View File

@ -29,15 +29,15 @@ static byte _playlist_all[] = {
};
static byte _playlist_old_style[] = {
1, 8, 2, 9, 14, 15, 19, 13, 0
2, 9, 3, 10, 15, 16, 20, 14, 0
};
static byte _playlist_new_style[] = {
6, 11, 10, 17, 21, 18, 5, 0
7, 12, 11, 18, 22, 19, 6, 0
};
static byte _playlist_ezy_street[] = {
12, 7, 16, 3, 20, 4, 0
13, 8, 17, 4, 21, 5, 0
};
static byte * const _playlists[] = {

View File

@ -1094,9 +1094,8 @@ CommandCost CmdCloneOrder(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
return CMD_ERROR;
/* Trucks can't share orders with busses (and visa versa) */
if (src->type == VEH_ROAD) {
if (src->cargo_type != dst->cargo_type && (IsCargoInClass(src->cargo_type, CC_PASSENGERS) || IsCargoInClass(dst->cargo_type, CC_PASSENGERS)))
return CMD_ERROR;
if (src->type == VEH_ROAD && IsCargoInClass(src->cargo_type, CC_PASSENGERS) != IsCargoInClass(dst->cargo_type, CC_PASSENGERS)) {
return CMD_ERROR;
}
/* Is the vehicle already in the shared list? */

View File

@ -46,7 +46,7 @@ void ResetViewportAfterLoadGame()
w->viewport->dest_scrollpos_y = _saved_scrollpos_y;
ViewPort *vp = w->viewport;
vp->zoom = min<ZoomLevel>(_saved_scrollpos_zoom, ZOOM_LVL_MAX);
vp->zoom = (ZoomLevel)min(_saved_scrollpos_zoom, ZOOM_LVL_MAX);
vp->virtual_width = ScaleByZoom(vp->width, vp->zoom);
vp->virtual_height = ScaleByZoom(vp->height, vp->zoom);

View File

@ -121,7 +121,11 @@ bool SpriteLoaderGrf::LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot,
}
for (int x = 0; x < length; x++) {
data->m = ((sprite_type == ST_NORMAL && _palette_remap_grf[file_slot]) ? _palette_remap[*dest] : *dest);
switch (sprite_type) {
case ST_NORMAL: data->m = _palette_remap_grf[file_slot] ? _palette_remap[*dest] : *dest; break;
case ST_FONT: data->m = min(*dest, 2u); break;
default: data->m = *dest; break;
}
dest++;
data++;
}
@ -142,7 +146,11 @@ bool SpriteLoaderGrf::LoadSprite(SpriteLoader::Sprite *sprite, uint8 file_slot,
dest = dest_orig;
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]);
switch (sprite_type) {
case ST_NORMAL: sprite->data[i].m = _palette_remap_grf[file_slot] ? _palette_remap[dest[i]] : dest[i]; break;
case ST_FONT: sprite->data[i].m = min(dest[i], 2u); break;
default: sprite->data[i].m = dest[i]; break;
}
}
}

View File

@ -684,17 +684,17 @@ static const DrawBuildingsTileStruct _industry_draw_tile_data[NEW_INDUSTRYTILEOF
M( 0x1244, PAL_NONE, 0x1282 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x1285 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1243, PAL_NONE, 0x0, PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1243, PAL_NONE, 0x1287, PALETTE_TO_RED, 0, 0, 16, 16, 50, 0),
M( 0x1243, PAL_NONE, 0x1287, PALETTE_TO_RED, 0, 0, 16, 16, 50, 0),
M( 0x1243, PAL_NONE, 0x1287, PALETTE_TO_RED, 0, 0, 16, 16, 50, 0),
M( 0x1243, PAL_NONE, 0x1287 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1243, PAL_NONE, 0x1287 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1243, PAL_NONE, 0x1287 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x0, PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x1288, PALETTE_TO_RED, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x1288, PALETTE_TO_RED, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x1288, PALETTE_TO_RED, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x1288 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x1288 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x1288 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1243, PAL_NONE, 0x0, PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1243, PAL_NONE, 0x1289, PALETTE_TO_RED, 0, 0, 16, 16, 50, 3),
M( 0x1243, PAL_NONE, 0x1289, PALETTE_TO_RED, 0, 0, 16, 16, 50, 3),
M( 0x1243, PAL_NONE, 0x1289, PALETTE_TO_RED, 0, 0, 16, 16, 50, 3),
M( 0x1243, PAL_NONE, 0x1289 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 3),
M( 0x1243, PAL_NONE, 0x1289 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 3),
M( 0x1243, PAL_NONE, 0x1289 | (1 << PALETTE_MODIFIER_COLOUR), PAL_NONE, 0, 0, 16, 16, 50, 3),
M( 0x1244, PAL_NONE, 0x0, PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x0, PAL_NONE, 0, 0, 16, 16, 50, 0),
M( 0x1244, PAL_NONE, 0x0, PAL_NONE, 0, 0, 16, 16, 50, 0),