# 1 "" # 1 "" # 1 "" # 1 "" /* $Id$ */ /* * This file is part of the Swedish RailSet. * Swedish RailSet is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. * Swedish RailSet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Swedish RailSet. If not, see . */ # 1 "src/header.pnml" 1 /* $Id$ */ /* * This file is part of the Swedish RailSet. * Swedish RailSet is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. * Swedish RailSet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Swedish RailSet. If not, see . */ grf { grfid : "SER0"; name : string(STR_GRF_NAME); desc : string(STR_GRF_DESCRIPTION); } param[10] = (ttd_platform == PLATFORM_TTDPATCH) | (param[0]); // Use TTD ground sprites if (openttd_version > version_openttd(1, 1, 0, 20003)) { param[11] = param[1] ? param[1] : 1975; } else { param[11] = param[1] ? param[1] : 5000000; } # 11 "" 2 # 1 "src/with_ground.pnml" 1 /* $Id$ */ /* * This file is part of the Swedish RailSet. * Swedish RailSet is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. * Swedish RailSet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Swedish RailSet. If not, see . */ // Default ground tile template (re-use as needed) template ground_tile(x, y) { [x, y, 64, 31, -31, 0, 9] } // Define the sprite templates for the actionA: template tmpl_ttd_ground(x) { [358, 4, 64,31, -31, 0] [438, 4, 64,31, -31, 0] [518, 4, 64,31, -31, 0] [598, 4, 64,31, -31, 0] [678, 4, 64,31, -31, 0] [358,150, 64,31, -31, 0] [438,150, 64,31, -31, 0] [518,150, 64,31, -31, 0] [598,150, 64,31, -31, 0] [678,150, 64,31, -31, 0] [358, 50, 64,31, -31, 0] [438, 50, 64,31, -31, 0] [518, 50, 64,39, -31, -8] [598, 50, 64,31, -31, 0] [678, 50, 64,31, -31, 0] [358,200, 64,23, -31, 0] [438,200, 64,31, -31, -8] [518,200, 64,23, -31, 0] [598,200, 64,31, -31, -8] [678,200, 64,39, -31, -8] [358,100, 64,39, -31, -8] [438,100, 64,23, -31, 0] [518,100, 64,23, -31, 0] [598,100, 64,39, -31, -8] [678,100, 64,31, -31, 0] [358,250, 64,31, -31, 0] } template tmpl_overlay_TTD(x,y) { [ 20,198, 40,21, -20, 5] [ 71,198, 40,21, -20, 5] [117,198, 40, 7, -19, 4] [165,198, 40, 7, -21, 20] [216,198, 12,19, 11, 6] [248,198, 12,19, -21, 6] } template tmpl_tunnel(y) { [ 4, 6, 33,33, -31, -2] [ 52, 6, 40,38, -7,-38] [ 95, 6, 27,19, -31, 2] [129, 6, 42,23, -9,-30] [177, 6, 25,18, 8, 3] [209, 6, 43,23, -31,-30] [258, 6, 33,33, -0, -2] [295, 6, 40,38, -31,-38] } // Only activate actionA if param0 is set (TTDP mode) // temperate climate: if ((climate == CLIMATE_TEMPERATE) & (param[10] == 1)) { // Rail overlays replace (1005, "src/gfx/rails_overlays.png") { tmpl_overlay_TTD(20,198) } // Standard temperate rail sprites replace (1011, "src/gfx/temperate_rails_TTD.png") { tmpl_ttd_ground(358) } // Replacement of standard rail tunnels in temperate replace (2365, "src/gfx/temperate_rails_TTD.png") { tmpl_tunnel(6) } } // temperate TTD behaviour // Only activate actionA if param0 is set (TTDP mode) // arctic climate: if ((climate == CLIMATE_ARCTIC) & (param[10] == 1)) { // Rail overlays replace (1005, "src/gfx/rails_overlays.png") { tmpl_overlay_TTD(20,198) } // Standard temperate rail sprites replace (1011, "src/gfx/arctic_rails_TTD.png") { tmpl_ttd_ground(358) } // Replacement of standard rail tunnels in temperate replace (2365, "src/gfx/arctic_rails_TTD.png") { tmpl_tunnel(6) } } // arctic TTD behaviour // Only activate actionA if param0 is set (TTDP mode) // snowy tiles: if (((climate == CLIMATE_ARCTIC) | (climate == CLIMATE_TEMPERATE)) & (param[10] == 1)) { // Standard temperate rail sprites replace (1037, "src/gfx/snow_rails_TTD.png") { tmpl_ttd_ground(358) } // Replacement of standard rail tunnels in temperate replace (2397, "src/gfx/snow_rails_TTD.png") { tmpl_tunnel(6) } } // snow for arctic + temperate TTD mode // Only activate actionA if param0 is set (TTDP mode) // tropical climate: if ((climate == CLIMATE_TROPICAL) & (param[10] == 1)) { // Rail overlays replace (1005, "src/gfx/rails_overlays.png") { tmpl_overlay_TTD(20,198) } // Standard rainforest rail sprites replace (1011, "src/gfx/rainforest_rails_TTD.png") { tmpl_ttd_ground(358) } // Replacement of standard rail tunnels in rainforest replace (2365, "src/gfx/rainforest_rails_TTD.png") { tmpl_tunnel(6) } // Standard desert rail sprites replace (1037, "src/gfx/desert_rails_TTD.png") { tmpl_ttd_ground(358) } // Replacement of standard rail tunnels in desert replace (2397, "src/gfx/desert_rails_TTD.png") { tmpl_tunnel(6) } } // tropical TTD behaviour template tmpl_opengfx_tunnels(y) { [ 0, y, 64,39, -31, -8] [ 80, y, 64,39, -31,-38] [160, y, 64,23, -31, 0] [240, y, 64,23, -31,-30] [320, y, 64,23, -31, 0] [400, y, 64,23, -31,-30] [480, y, 64,39, -31, -8] [560, y, 64,39, -31,-38] } if ((param[10] == 2)) { if (climate == CLIMATE_TEMPERATE) { replace (2365, "src/gfx/tunnels_opengfx.png") { tmpl_opengfx_tunnels(0) // temperate } replace (2397, "src/gfx/tunnels_opengfx.png") { tmpl_opengfx_tunnels(50) // snow } } // temperate climate if (climate == CLIMATE_TROPICAL) { replace (2365, "src/gfx/tunnels_opengfx.png") { tmpl_opengfx_tunnels(150) // rainforest } replace (2397, "src/gfx/tunnels_opengfx.png") { tmpl_opengfx_tunnels(200) // desert } } // tropical climate if (climate == CLIMATE_ARCTIC) { replace (2365, "src/gfx/tunnels_opengfx.png") { tmpl_opengfx_tunnels(100) // arctic } replace (2397, "src/gfx/tunnels_opengfx.png") { tmpl_opengfx_tunnels(50) // snow } } // arctic climate } // OpenGFX ground sprites # 12 "" 2 # 1 "src/default_fences.pnml" 1 template tmpl_fences(y) { [ 0, y, 32,20, -30, -4] [ 48, y, 32,20, 0, -3] [ 96, y, 2,30, 0,-17] [112, y, 64, 5, -32, -4] [192, y, 32,12, -30, -4] [240, y, 32,12, 2, -3] [288, y, 32,28, -31,-12] [350, y, 32,28, 1,-10] } template tmpl_no_fences() { [ 1, 26, 1, 1, 0, 0] [ 1, 26, 1, 1, 0, 0] [ 1, 26, 1, 1, 0, 0] [ 1, 26, 1, 1, 0, 0] [ 1, 26, 1, 1, 0, 0] [ 1, 26, 1, 1, 0, 0] [ 1, 26, 1, 1, 0, 0] [ 1, 26, 1, 1, 0, 0] } if (param[2] == 0) { replace (1301, "src/gfx/fences.png") { tmpl_fences(50) } } if (param[2] == 2) { replace (1301, "src/gfx/fences.png") { tmpl_no_fences() } } # 13 "" 2 # 1 "src/railtypes.pnml" 1 /* $Id$ */ /* * This file is part of the Swedish RailSet. * Swedish RailSet is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. * Swedish RailSet is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Swedish RailSet. If not, see . */ template tmpl_underlay_railtypes() { [ 75, 0, 64,31, -31, 0] [ 0, 0, 64,31, -31, 0] [150, 0, 64,31, -31, 0] [225, 0, 64,31, -31, 0] [ 0, 40, 64,31, -31, 0] [300, 0, 64,31, -31, 0] [ 75, 40, 64,39, -31, -8] [150, 40, 64,23, -31, 0] [225, 40, 64,23, -31, 0] [300, 40, 64,39, -30, -9] [ 0,120, 64,31, -31, 0] [ 0, 80, 64,31, -31, 0] [225, 80, 64,31, -31, 0] [150, 80, 64,31, -31, 0] [ 75, 80, 64,31, -31, 0] [300, 80, 64,31, -31, 0] } template tmpl_overlay_railtypes() { [ 0,155, 40,21, -20, 5] [ 50,155, 40,21, -20, 5] [100,155, 40, 7, -19, 4] [150,155, 40, 7, -21, 20] [200,155, 12,19, 11, 6] [250,155, 12,19, -21, 6] [ 0,195, 64,39, -31, -8] [ 75,195, 64,23, -31, 0] [150,195, 64,23, -31, 0] [225,195, 64,39, -30, -9] } template tmpl_tunnel_tracks() { [ 75, 0, 64,31, -31, 0] [ 0, 0, 64,31, -31, 0] [ 75, 50, 64,31, -31, 0] [ 0, 50, 64,31, -31, 0] } template tmpl_depot() { [200, 10, 16, 8, 17, 7] [118, 10, 64,44, -9, -28] [ 0, 10, 16, 8, -31, 7] [ 37, 10, 64,44, -53, -28] [ 37, 66, 64,44, -53, -28] [118, 66, 64,44, -9, -28] } template tmpl_depot_snow() { [118,128, 64,31, -31, -4] [118, 10, 64,44, -9, -28] [ 37,128, 64,31, -31, -4] [ 37, 10, 64,44, -53, -28] [ 37, 66, 64,44, -53, -28] [118, 66, 64,44, -9, -28] } /********************************************** * Track underlays for different ground types: **********************************************/ spriteblock(FEAT_RAILTYPES) { spriteset(track_underlays, "src/gfx/rails_overlays.png") { tmpl_underlay_railtypes() } spritegroup track_underlay_group { default: track_underlays; } } spriteblock(FEAT_RAILTYPES) { spriteset(track_underlays_arctic, "src/gfx/rails_overlays_snow.png") { tmpl_underlay_railtypes() } spritegroup track_underlay_arctic_group { default: track_underlays_arctic; } } switch(FEAT_RAILTYPES, SELF, ground_switch_underlay, terrain_type) { TILETYPE_SNOW: track_underlay_arctic_group; track_underlay_group; } /********************************************** * Track overlays for different ground types: **********************************************/ spriteblock(FEAT_RAILTYPES) { spriteset(track_overlays, "src/gfx/rails_overlays.png") { tmpl_overlay_railtypes() } spritegroup track_overlay_group { default: track_overlays; } } spriteblock(FEAT_RAILTYPES) { spriteset(track_overlays_arctic, "src/gfx/rails_overlays_snow.png") { tmpl_overlay_railtypes() } spritegroup track_overlay_arctic_group { default: track_overlays_arctic; } } switch(FEAT_RAILTYPES, SELF, ground_switch_overlay, terrain_type) { TILETYPE_SNOW: track_overlay_arctic_group; track_overlay_group; } /********************************************** * Level crossings: **********************************************/ spriteblock(FEAT_RAILTYPES) { spriteset(level_crossing, "src/gfx/rails_overlays.png") { [ 0,155, 40,21, -20, 5] [ 50,155, 40,21, -20, 5] [ 0,240, 10,10, 0, 0] [ 0,240, 10,10, 0, 0] [ 0,240, 10,10, 0, 0] [ 0,240, 10,10, 0, 0] [ 0,240, 10,10, 0, 0] [ 0,240, 10,10, 0, 0] [ 0,240, 10,10, 0, 0] [ 0,240, 10,10, 0, 0] } spritegroup level_crossing_group { default: level_crossing; } } /********************************************** * Tracks in tunnels: **********************************************/ spriteblock(FEAT_RAILTYPES) { spriteset(tunnel_overlay, "src/gfx/tunnel_track_normal.png") { tmpl_tunnel_tracks() } spritegroup tunnel_group { default: tunnel_overlay; } } spriteblock(FEAT_RAILTYPES) { spriteset(tunnel_overlay_snow, "src/gfx/tunnel_track_snow.png") { tmpl_tunnel_tracks() } spritegroup tunnel_snow_group { default: tunnel_overlay_snow; } } switch(FEAT_RAILTYPES, SELF, tunnel_switch, terrain_type) { TILETYPE_SNOW: tunnel_snow_group; tunnel_group; } /********************************************** * Depots: **********************************************/ spriteblock(FEAT_RAILTYPES) { spriteset(depot_normal_rail, "src/gfx/depot_normal.png") { tmpl_depot() } spriteset(depot_normal_rail_snow, "src/gfx/depot_normal_snow.png") { tmpl_depot_snow() } spriteset(depot_modern_normal_rail, "src/gfx/depot_modern_normal.png") { tmpl_depot() } spriteset(depot_modern_normal_rail_snow, "src/gfx/depot_modern_normal_snow.png") { tmpl_depot_snow() } spritegroup depot_normal_rail_group { default: depot_normal_rail; } spritegroup depot_normal_rail_snow_group { default: depot_normal_rail_snow; } spritegroup depot_modern_normal_rail_group { default: depot_modern_normal_rail; } spritegroup depot_modern_normal_rail_snow_group { default: depot_modern_normal_rail_snow; } } switch(FEAT_RAILTYPES, SELF, oldversion_depot_normal_year_switch_snow, years_since_0) { 0 .. param[11]-1: depot_normal_rail_snow_group; depot_modern_normal_rail_snow_group; } switch(FEAT_RAILTYPES, SELF, oldversion_depot_normal_year_switch, years_since_0) { 0 .. param[11]-1: depot_normal_rail_group; depot_modern_normal_rail_group; } switch(FEAT_RAILTYPES, SELF, depot_normal_year_switch_snow, max(build_date - date(param[11],1,1),0)) { 0: depot_normal_rail_snow_group; depot_modern_normal_rail_snow_group; } switch(FEAT_RAILTYPES, SELF, depot_normal_year_switch, max(build_date - date(param[11],1,1),0)) { 0: depot_normal_rail_group; depot_modern_normal_rail_group; } switch(FEAT_RAILTYPES, SELF, version_switch_normal_snow, max(openttd_version - version_openttd(1, 1, 0, 20003),0)) { 0: oldversion_depot_normal_year_switch_snow; depot_normal_year_switch_snow; } switch(FEAT_RAILTYPES, SELF, version_switch_normal, max(openttd_version - version_openttd(1, 1, 0, 20003),0)) { 0: oldversion_depot_normal_year_switch; depot_normal_year_switch; } switch(FEAT_RAILTYPES, SELF, depot_switch_normal, terrain_type) { TILETYPE_SNOW: version_switch_normal_snow; version_switch_normal; } spriteblock(FEAT_RAILTYPES) { spriteset(depot_electric_rail, "src/gfx/depot_electric.png") { tmpl_depot() } spriteset(depot_electric_rail_snow, "src/gfx/depot_electric_snow.png") { tmpl_depot_snow() } spriteset(depot_modern_electric_rail, "src/gfx/depot_modern_electric.png") { tmpl_depot() } spriteset(depot_modern_electric_rail_snow, "src/gfx/depot_modern_electric_snow.png") { tmpl_depot_snow() } spritegroup depot_electric_rail_group { default: depot_electric_rail; } spritegroup depot_electric_rail_snow_group { default: depot_electric_rail_snow; } spritegroup depot_modern_electric_rail_group { default: depot_modern_electric_rail; } spritegroup depot_modern_electric_rail_snow_group { default: depot_modern_electric_rail_snow; } } switch(FEAT_RAILTYPES, SELF, oldversion_depot_electric_year_switch_snow, years_since_0) { 0 .. param[11]-1: depot_electric_rail_snow_group; depot_modern_electric_rail_snow_group; } switch(FEAT_RAILTYPES, SELF, oldversion_depot_electric_year_switch, years_since_0) { 0 .. param[11]-1: depot_electric_rail_group; depot_modern_electric_rail_group; } switch(FEAT_RAILTYPES, SELF, depot_electric_year_switch_snow, max(build_date - date(param[11],1,1),0)) { 0: depot_electric_rail_snow_group; depot_modern_electric_rail_snow_group; } switch(FEAT_RAILTYPES, SELF, depot_electric_year_switch, max(build_date - date(param[11],1,1),0)) { 0: depot_electric_rail_group; depot_modern_electric_rail_group; } switch(FEAT_RAILTYPES, SELF, version_switch_electric_snow, max(openttd_version - version_openttd(1, 1, 0, 20003),0)) { 0: oldversion_depot_electric_year_switch_snow; depot_electric_year_switch_snow; } switch(FEAT_RAILTYPES, SELF, version_switch_electric, max(openttd_version - version_openttd(1, 1, 0, 20003),0)) { 0: oldversion_depot_electric_year_switch; depot_electric_year_switch; } switch(FEAT_RAILTYPES, SELF, depot_switch_electric, terrain_type) { TILETYPE_SNOW: version_switch_electric_snow; version_switch_electric; } /********************************************** * Fences: **********************************************/ spriteblock(FEAT_RAILTYPES) { spriteset(fences_snow, "src/gfx/fences.png") { tmpl_fences(50) } spriteset(fences, "src/gfx/fences.png") { tmpl_fences(0) } spriteset(no_fences, "src/gfx/fences.png") { tmpl_no_fences() } spritegroup fences_snow_group { default: fences_snow; } spritegroup fences_group { default: fences; } spritegroup no_fences_group { default: no_fences; } } switch(FEAT_RAILTYPES, SELF, fences_terrain_switch, terrain_type) { TILETYPE_SNOW: fences_snow_group; fences_group; } switch(FEAT_RAILTYPES, SELF, fences_switch, param[2]) { 2: no_fences_group; fences_terrain_switch; } // Only activate railtypes for OpenTTD // if-statement must not enclose real sprite definitions, though if (ttd_platform == PLATFORM_OPENTTD) { item(FEAT_RAILTYPES, rail, 0x0A) { property { label: "RAIL"; compatible_railtype_list: ["ELRL"]; // We don't want to change rail properties. Just provide new graphics } graphics { TRACKOVERLAY: ground_switch_overlay; UNDERLAY: ground_switch_underlay; LEVEL_CROSSINGS: level_crossing_group; TUNNELS: tunnel_switch; DEPOTS: depot_switch_normal; FENCES: fences_switch; } } item(FEAT_RAILTYPES, elrail, 0x0B) { property { label: "ELRL"; // We don't want to change rail properties. Just provide new graphics } graphics { TRACKOVERLAY: ground_switch_overlay; UNDERLAY: ground_switch_underlay; LEVEL_CROSSINGS: level_crossing_group; TUNNELS: tunnel_switch; DEPOTS: depot_switch_electric; FENCES: fences_switch; } } } // of OpenTTD only # 13 "" 2