Skip to content

Commit

Permalink
miners: Rework classic terrain selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Wallbraker committed May 31, 2016
1 parent e57996a commit d3d3753
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/miners/startup.d
Original file line number Diff line number Diff line change
Expand Up @@ -546,23 +546,24 @@ class LoadClassicTexture : OptionsTask
borrowClassicTerrainTexture();

// Get a texture that works with classic
auto pic = getClassicTerrainTexture(p);
if (pic is null) {
sysReference(&pic, opts.defaultClassicTerrain());
}

if (pic is null) {
if (opts.modernTerrainPic() is null) {
auto text = format(terrainNotFoundText, chargeConfigFolder);
signalError([text]);
return false;
}

Picture pic;
pic = getClassicTerrainTexture(p);
if (pic !is null) {
l.info("Found \"terrain.default.png\" using it.");
} else if (opts.modernTerrainPic() !is null) {
// Copy and manipulate
pic = Picture(opts.modernTerrainPic());
manipulateTextureClassic(pic);

l.info("Using a modified modern terrain.png for classic terrain.");
} else if (opts.defaultClassicTerrain() !is null) {
sysReference(&pic, opts.defaultClassicTerrain());
l.info("Using \"terrain.default.png\" for classic terrain.");
} else {
l.error("No classic texture found.");
auto text = format(terrainNotFoundText, chargeConfigFolder);
signalError([text]);
return false;
}

opts.classicTerrainPic = pic;
Expand Down

0 comments on commit d3d3753

Please sign in to comment.