diff --git a/README.rst b/README.rst index 9daa16a..da1f7ba 100644 --- a/README.rst +++ b/README.rst @@ -55,6 +55,18 @@ and `-o` (output image path). Parameters ^^^^^^^^^^ +colors : + Filename of the color definition file to use. + + By default, a file 'colors.txt' is used, which may be located: + + * In the directory of the world being mapped + + * In the user's private directory ($HOME/.minetest) + + * For compatibility, in the current directory as a last resort. + This causes a warning message to be printed. + bgcolor: Background color of image, `--bgcolor #ffffff` diff --git a/mapper.cpp b/mapper.cpp index a4768e9..c7b07bc 100644 --- a/mapper.cpp +++ b/mapper.cpp @@ -26,6 +26,7 @@ void usage() const char *usage_text = "minetestmapper [options]\n" " -i/--input \n" " -o/--output \n" + " --colors \n" " --bgcolor \n" " --scalecolor \n" " --playercolor \n" @@ -62,6 +63,7 @@ int main(int argc, char *argv[]) {"help", no_argument, 0, 'h'}, {"input", required_argument, 0, 'i'}, {"output", required_argument, 0, 'o'}, + {"colors", required_argument, 0, 'C'}, {"bgcolor", required_argument, 0, 'b'}, {"scalecolor", required_argument, 0, 's'}, {"origincolor", required_argument, 0, 'r'}, @@ -89,15 +91,10 @@ int main(int argc, char *argv[]) string input; string output; + string colorsFile; bool foundGeometrySpec = false; TileGenerator generator; - try { - generator.parseColorsFile("colors.txt"); - } catch(std::runtime_error e) { - std::cout<<"Exception: "<