summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-02-03 13:59:57 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-02-03 13:59:57 +0100
commit05b2cc0e1e9b4ffb160f0edee947d793213bedc5 (patch)
tree70cbfabda482caac30dbe7cccd6b644b253c92b5
parent4cd7e83a70f1c1b3ccb3dc63ee468cec593a71df (diff)
downloadMinedMap-05b2cc0e1e9b4ffb160f0edee947d793213bedc5.tar
MinedMap-05b2cc0e1e9b4ffb160f0edee947d793213bedc5.zip
PNG: fix mipmapping of grayscale images
-rw-r--r--src/PNG.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/PNG.cpp b/src/PNG.cpp
index 6f83fc5..9edf88c 100644
--- a/src/PNG.cpp
+++ b/src/PNG.cpp
@@ -139,7 +139,7 @@ static void readScaled(uint8_t *data, size_t offset_w, size_t offset_h, const ch
}
void mipmap(const char *output, size_t width, size_t height, bool colored, const char *nw, const char *ne, const char *sw, const char *se) {
- uint8_t data[4*width*height];
+ uint8_t data[(colored ? 4 : 2)*width*height];
std::memset(data, 0, sizeof(data));
readScaled(data, 0, 0, nw, width, height, colored);