I'm trying to make a NewGRF that let's you customize foundations (for example, use temperate rochy one on an arctic climate) and also tunnels. I've been trying so far following how OpenGFX is done. But I've found some bugs that I don't know how they get there.
For example, with foundations, if I replace the sprites of the tropical climate (517 onwards), newspapers get these artifacts (others works fine):
Here is the code I use:
Code: Select all
if (param_foundations == TEMPERATE) {
replace (990, "src/gfx/temperate/foundations.png") { foundations_template() }
replace (328, "src/gfx/temperate/foundations.png") { foundations_template() }
/* replace (517, "src/gfx/temperate/foundations.png") { foundations_template() } */
replace (543, "src/gfx/temperate/foundations.png") { foundations_template() }
replacenew(FOUNDATIONS_SLOPES_HALFTILES, "") {
sloped_foundations_template("src/gfx/temperate/sloped_foundations.png")
}
}else if(param_foundations == ARCTIC) {
replace (990, "src/gfx/arctic/foundations.png") { foundations_template() }
replace (328, "src/gfx/arctic/foundations.png") { foundations_template() }
/* replace (517, "src/gfx/arctic/foundations.png") { foundations_template() } */
replace (543, "src/gfx/arctic/foundations.png") { foundations_template() }
replacenew(FOUNDATIONS_SLOPES_HALFTILES, "") {
sloped_foundations_template("src/gfx/arctic/sloped_foundations.png")
}
}else if(param_foundations == TROPICAL) {
replace (990, "src/gfx/tropical/foundations.png") { foundations_template() }
replace (328, "src/gfx/tropical/foundations.png") { foundations_template() }
/* replace (517, "src/gfx/tropical/foundations.png") { foundations_template() } */
replace (543, "src/gfx/tropical/foundations.png") { foundations_template() }
replacenew(FOUNDATIONS_SLOPES_HALFTILES, "") {
sloped_foundations_template("src/gfx/tropical/sloped_foundations.png")
}
}else if(param_foundations == TOYLAND) {
replace (990, "src/gfx/toyland/foundations.png") { foundations_template() }
replace (328, "src/gfx/toyland/foundations.png") { foundations_template() }
/* replace (517, "src/gfx/toyland/foundations.png") { foundations_template() } */
replace (543, "src/gfx/toyland/foundations.png") { foundations_template() }
replacenew(FOUNDATIONS_SLOPES_HALFTILES, "") {
sloped_foundations_template("src/gfx/toyland/sloped_foundations.png")
}
}
Code: Select all
if (param_tunnels == TUNNEL_CLASSIC) {
//temperate 2429-2436 tunnel gui
/* replace (2429, "sprites/png/gui/road_tunnels_gui.png") { [ 0, 0, 20, 20, 0, 0] } // road tunnel
alternative_sprites (spr2429, ZOOM_LEVEL_IN_2X, BIT_DEPTH_8BPP, "sprites/png/gui/road_tunnels_gui.png") { tmpl_gui2x_toolbar(72, 0) } */
// temperate road tunnels 2389 - 2396
replace (2389, "src/gfx/tunnels/classic.png") { road_tunnels_template(27) }
// snowy road tunnels 2421 - 2428
replace (2421, "src/gfx/tunnels/classic.png") { road_tunnels_template(249) }
// arctic road tunnel 238 - 245
replace (238, "src/gfx/tunnels/classic.png") { road_tunnels_template(101) }
// tropical road tunnel on desert ground 509 - 516
replace (509, "src/gfx/tunnels/classic.png") { road_tunnels_template(322) }
// toyland Road tunnel sprites 1170 - 1177
replace (1170, "src/gfx/tunnels/classic.png") { road_tunnels_template(396) }
}else if(param_tunnels == TUNNEL_OPENGFX) {
// temperate road tunnels 2389 - 2396
replace (2389, "src/gfx/tunnels/opengfx.png") { road_tunnels_template(27) }
// snowy road tunnels 2421 - 2428
replace (2421, "src/gfx/tunnels/opengfx.png") { road_tunnels_template(249) }
// arctic road tunnel 238 - 245
replace (238, "src/gfx/tunnels/opengfx.png") { road_tunnels_template(101) }
// tropical road tunnel on desert ground 509 - 516
replace (509, "src/gfx/tunnels/opengfx.png") { road_tunnels_template(322) }
// toyland Road tunnel sprites 1170 - 1177
replace (1170, "src/gfx/tunnels/opengfx.png") { road_tunnels_template(396) }
}