Index: src/newgrf.cpp =================================================================== --- src/newgrf.cpp (Revision 11653) +++ src/newgrf.cpp (Arbeitskopie) @@ -61,7 +61,6 @@ static int _skip_sprites; // XXX static uint _file_index; // XXX -SpriteID _coast_base; static GRFFile *_cur_grffile; GRFFile *_first_grffile; @@ -3342,12 +3341,44 @@ /* case 0x0C: // Snowy temperate trees. Not yet used by OTTD. */ case 0x0D: // Coast graphics - if (num != 16) { - grfmsg(1, "GraphicsNew: Coast graphics sprite count must be 16, skipping"); - return; + switch (num) { + case 10: + /* openttd(d/w).grf missing shore sprites and initialisation of SPR_SHORE_BASE */ + LoadNextSprite( SPR_SHORE_BASE + 0, _file_index, _nfo_line++); // SLOPE_STEEP_S + DupSprite( 4063, SPR_SHORE_BASE + 1 ); // SLOPE_W + DupSprite( 4064, SPR_SHORE_BASE + 2 ); // SLOPE_S + DupSprite( 4068, SPR_SHORE_BASE + 3 ); // SLOPE_SW + DupSprite( 4062, SPR_SHORE_BASE + 4 ); // SLOPE_E + LoadNextSprite( SPR_SHORE_BASE + 5, _file_index, _nfo_line++); // SLOPE_STEEP_W + DupSprite( 4066, SPR_SHORE_BASE + 6 ); // SLOPE_SE + LoadNextSprite( SPR_SHORE_BASE + 7, _file_index, _nfo_line++); // SLOPE_WSE + DupSprite( 4065, SPR_SHORE_BASE + 8 ); // SLOPE_N + DupSprite( 4069, SPR_SHORE_BASE + 9 ); // SLOPE_NW + LoadNextSprite( SPR_SHORE_BASE + 10, _file_index, _nfo_line++); // SLOPE_STEEP_N + LoadNextSprite( SPR_SHORE_BASE + 11, _file_index, _nfo_line++); // SLOPE_NWS + DupSprite( 4067, SPR_SHORE_BASE + 12 ); // SLOPE_NE + LoadNextSprite( SPR_SHORE_BASE + 13, _file_index, _nfo_line++); // SLOPE_ENW + LoadNextSprite( SPR_SHORE_BASE + 14, _file_index, _nfo_line++); // SLOPE_SEN + LoadNextSprite( SPR_SHORE_BASE + 15, _file_index, _nfo_line++); // SLOPE_STEEP_E + LoadNextSprite( SPR_SHORE_BASE + 16, _file_index, _nfo_line++); // SLOPE_EW + LoadNextSprite( SPR_SHORE_BASE + 17, _file_index, _nfo_line++); // SLOPE_NS + + grfmsg(2, "GraphicsNew: Loading all standard shore sprites"); + return; + break; + + case 16: + case 18: + /* 'normal' newWater newGRF */ + replace = SPR_SHORE_BASE; + break; + + default: + /* no valid shore sprite count */ + grfmsg(1, "GraphicsNew: Shore graphics sprite count must be 10, 16 or 18, skipping"); + return; + break; } - _coast_base = _cur_spriteid; - _loaded_newgrf_features.has_newwater = true; break; /* case 0x0E: // New Signals. Not yet used by OTTD. */ @@ -5070,8 +5101,6 @@ _loaded_newgrf_features.has_2CC = false; _loaded_newgrf_features.has_newhouses = false; _loaded_newgrf_features.has_newindustries = false; - _loaded_newgrf_features.has_newwater = false; - _coast_base = 0; InitializeSoundPool(); InitializeSpriteGroupPool(); Index: src/table/sprites.h =================================================================== --- src/table/sprites.h (Revision 11653) +++ src/table/sprites.h (Arbeitskopie) @@ -139,7 +139,11 @@ SPR_2CCMAP_BASE = SPR_ELRAIL_BASE + ELRAIL_SPRITE_COUNT, TWOCCMAP_SPRITE_COUNT = 256, - SPR_AIRPORTX_BASE = SPR_2CCMAP_BASE + TWOCCMAP_SPRITE_COUNT, // The sprites used for other airport angles + /* shore tiles - action 05-0D */ + SPR_SHORE_BASE = SPR_2CCMAP_BASE + TWOCCMAP_SPRITE_COUNT, + SPR_SHORE_SPRITE_COUNT = 18, + + SPR_AIRPORTX_BASE = SPR_SHORE_BASE + SPR_SHORE_SPRITE_COUNT, // The sprites used for other airport angles SPR_NEWAIRPORT_TARMAC = SPR_AIRPORTX_BASE, SPR_NSRUNWAY1 = SPR_AIRPORTX_BASE + 1, SPR_NSRUNWAY2 = SPR_AIRPORTX_BASE + 2, @@ -551,17 +555,6 @@ SPR_FARMLAND_STATE_7 = 4259, SPR_FARMLAND_HAYPACKS = 4278, - /* Shores */ - SPR_NO_SHORE = 0, //used for tileh which have no shore - SPR_SHORE_TILEH_4 = 4062, // SLOPE_E - SPR_SHORE_TILEH_1 = 4063, // SLOPE_W - SPR_SHORE_TILEH_2 = 4064, // SLOPE_S - SPR_SHORE_TILEH_8 = 4065, // SLOPE_N - SPR_SHORE_TILEH_6 = 4066, // SLOPE_SE - SPR_SHORE_TILEH_12 = 4067, // SLOPE_NE - SPR_SHORE_TILEH_3 = 4068, // SLOPE_SW - SPR_SHORE_TILEH_9 = 4069, // SLOPE_NW - /* Water-related sprites */ SPR_SHIP_DEPOT_SE_FRONT = 4070, SPR_SHIP_DEPOT_SW_FRONT = 4071, Index: src/table/files.h =================================================================== --- src/table/files.h (Revision 11653) +++ src/table/files.h (Arbeitskopie) @@ -34,7 +34,7 @@ }, { "SAMPLE.CAT", {0x42, 0x2e, 0xa3, 0xdd, 0x07, 0x4d, 0x28, 0x59, 0xbb, 0x51, 0x63, 0x9a, 0x6e, 0x0e, 0x85, 0xda} }, { "CHARS.GRF", {0x5f, 0x2e, 0xbf, 0x05, 0xb6, 0x12, 0x65, 0x81, 0xd2, 0x10, 0xa9, 0x19, 0x62, 0x41, 0x70, 0x64} }, - { "OPENTTDD.GRF", {0x60, 0xfe, 0xc1, 0xc7, 0x66, 0xe7, 0x59, 0xff, 0x1b, 0x6c, 0xc4, 0x5f, 0xe6, 0x6b, 0x8c, 0x91} } + { "OPENTTDD.GRF", {0x15, 0x3d, 0x5c, 0x90, 0x59, 0x8d, 0x06, 0xf7, 0x2d, 0x19, 0x0d, 0x21, 0x90, 0x2e, 0xb6, 0x9a} } }; static FileList files_win = { @@ -48,5 +48,5 @@ }, { "SAMPLE.CAT", {0x92, 0x12, 0xe8, 0x1e, 0x72, 0xba, 0xdd, 0x4b, 0xbe, 0x1e, 0xae, 0xae, 0x66, 0x45, 0x8e, 0x10} }, { "CHARS.GRF", {0x5f, 0x2e, 0xbf, 0x05, 0xb6, 0x12, 0x65, 0x81, 0xd2, 0x10, 0xa9, 0x19, 0x62, 0x41, 0x70, 0x64} }, - { "OPENTTDW.GRF", {0x85, 0xb7, 0xd0, 0xa6, 0xc3, 0x86, 0x44, 0x03, 0xa1, 0x25, 0xa5, 0xbb, 0x50, 0x75, 0xa0, 0xa1} } + { "OPENTTDW.GRF", {0x1d, 0x64, 0x74, 0xea, 0x53, 0x20, 0xd0, 0x1a, 0xc9, 0x1b, 0x29, 0xe9, 0x39, 0x84, 0x69, 0xb4} } }; Index: src/table/station_land.h =================================================================== --- src/table/station_land.h (Revision 11653) +++ src/table/station_land.h (Arbeitskopie) @@ -1168,10 +1168,10 @@ }; static const DrawTileSprites _station_display_datas_dock[] = { - { SPR_SHORE_TILEH_3, PAL_NONE, _station_display_datas_76 }, - { SPR_SHORE_TILEH_9, PAL_NONE, _station_display_datas_77 }, - { SPR_SHORE_TILEH_12, PAL_NONE, _station_display_datas_78 }, - { SPR_SHORE_TILEH_6, PAL_NONE, _station_display_datas_79 }, + { SPR_SHORE_BASE + SLOPE_SW, PAL_NONE, _station_display_datas_76 }, + { SPR_SHORE_BASE + SLOPE_NW, PAL_NONE, _station_display_datas_77 }, + { SPR_SHORE_BASE + SLOPE_NE, PAL_NONE, _station_display_datas_78 }, + { SPR_SHORE_BASE + SLOPE_SE, PAL_NONE, _station_display_datas_79 }, { SPR_FLAT_WATER_TILE, PAL_NONE, _station_display_datas_80 }, { SPR_FLAT_WATER_TILE, PAL_NONE, _station_display_datas_81 }, }; Index: src/newgrf.h =================================================================== --- src/newgrf.h (Revision 11653) +++ src/newgrf.h (Arbeitskopie) @@ -85,13 +85,10 @@ extern GRFFile *_first_grffile; -extern SpriteID _coast_base; - struct GRFLoadedFeatures { bool has_2CC; ///< Set if any vehicle is loaded which uses 2cc (two company colours). bool has_newhouses; ///< Set if there are any newhouses loaded. bool has_newindustries; ///< Set if there are any newindustries loaded. - bool has_newwater; ///< Set it there are any newwater grf loaded }; /* Indicates which are the newgrf features currently loaded ingame */ Index: src/water_cmd.cpp =================================================================== --- src/water_cmd.cpp (Revision 11653) +++ src/water_cmd.cpp (Arbeitskopie) @@ -32,26 +32,7 @@ #include "misc/autoptr.hpp" #include "transparency.h" -/** Array for the shore sprites */ -static const SpriteID _water_shore_sprites[] = { - 0, - SPR_SHORE_TILEH_1, // SLOPE_W - SPR_SHORE_TILEH_2, // SLOPE_S - SPR_SHORE_TILEH_3, // SLOPE_SW - SPR_SHORE_TILEH_4, // SLOPE_E - 0, - SPR_SHORE_TILEH_6, // SLOPE_SE - 0, - SPR_SHORE_TILEH_8, // SLOPE_N - SPR_SHORE_TILEH_9, // SLOPE_NW - 0, - 0, - SPR_SHORE_TILEH_12, // SLOPE_NE - 0, - 0 -}; - static Vehicle *FindFloodableVehicleOnTile(TileIndex tile); static void FloodVehicle(Vehicle *v); @@ -512,15 +493,17 @@ DrawBridgeMiddle(ti); break; - case WATER_TILE_COAST: + case WATER_TILE_COAST: { + /* landscape slope => shore */ + static const uint8 tileh_to_shore[32] = { + 0, 1, 2, 3, 4, 16, 6, 7, 8, 9, 17, 11, 12, 13, 14, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 10, 15, 0, + }; + assert(!IsSteepSlope(ti->tileh)); - if (_loaded_newgrf_features.has_newwater) { - DrawGroundSprite(_coast_base + ti->tileh, PAL_NONE); - } else { - DrawGroundSprite(_water_shore_sprites[ti->tileh], PAL_NONE); - } + DrawGroundSprite(SPR_SHORE_BASE + tileh_to_shore[ti->tileh], PAL_NONE); DrawBridgeMiddle(ti); - break; + } break; case WATER_TILE_LOCK: { const WaterDrawTileStruct *t = _shiplift_display_seq[GetSection(ti->tile)]; Index: bin/data/openttdw.grf =================================================================== Kann nicht anzeigen: Dateityp ist als binär angegeben. svn:mime-type = application/octet-stream Index: bin/data/openttdd.grf =================================================================== Kann nicht anzeigen: Dateityp ist als binär angegeben. svn:mime-type = application/octet-stream