Skip to content

Commit 5d0b36f

Browse files
committed
Added -nowater option to allow map rendering without water.
1 parent c6e8234 commit 5d0b36f

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

colors.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,13 @@ void loadColors()
4444
SETCOLORNOISE(WOOD, 157,128,79,255, 11);
4545
SETCOLOR(6, 120,120,120,0);
4646
SETCOLOR(7, 84,84,84,255);
47-
SETCOLOR(WATER, 38,92,225,36);
48-
SETCOLOR(STAT_WATER, 38,92,225,36);
47+
if (g_NoWater) {
48+
SETCOLOR(WATER, 255,255,255,0);
49+
SETCOLOR(STAT_WATER, 255,255,255,0);
50+
} else {
51+
SETCOLOR(WATER, 38,92,225,36);
52+
SETCOLOR(STAT_WATER, 38,92,225,36);
53+
}
4954
SETCOLOR(10, 255,90,0,255);
5055
SETCOLOR(11, 255,90,0,255);
5156
SETCOLORNOISE(SAND, 220,212,160,255, 14);

globals.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ bool g_Skylight = false;
1515
int g_Noise = 0;
1616
bool g_BlendAll = false;
1717
bool g_Hell = false, g_ServerHell = false;
18+
bool g_NoWater = false;
1819

1920
bool g_UseBiomes = false;
2021
uint64_t g_BiomeMapSize = 0;

globals.h

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ extern bool g_Skylight;
4040
extern int g_Noise;
4141
extern bool g_BlendAll; // If set, do not assume certain blocks (like grass) are always opaque
4242
extern bool g_Hell, g_ServerHell; // rendering the nether
43+
extern bool g_NoWater; // render water clear
4344

4445
// For rendering biome colors properly, external png files are used
4546
extern bool g_UseBiomes;

main.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ int main(int argc, char **argv)
135135
g_Hell = true;
136136
} else if (strcmp(option, "-end") == 0) {
137137
end = true;
138+
} else if (strcmp(option, "-nowater") == 0) {
139+
g_NoWater = true;
138140
} else if (strcmp(option, "-serverhell") == 0) {
139141
g_ServerHell = true;
140142
} else if (strcmp(option, "-biomes") == 0) {
@@ -1133,6 +1135,7 @@ void printHelp(char *binary)
11331135
" -hell render the hell/nether dimension of the given world\n"
11341136
" -end render the end dimension of the given world\n"
11351137
" -serverhell force cropping of blocks at the top (use for nether servers)\n"
1138+
" -nowater render map with water clear\n"
11361139
" -texture NAME extract colors from png file 'NAME'; eg. terrain.png\n"
11371140
" -biomes apply biome colors to grass/leaves; requires that you run\n"
11381141
" Donkey Kong's biome extractor first on your world\n"

0 commit comments

Comments
 (0)