mirror of
https://github.com/minetest/minetestmapper.git
synced 2024-11-22 07:23:46 +01:00
Add workaround for color.txt parsing on MinGW
This commit is contained in:
parent
20b340e2ee
commit
722f02d121
@ -264,11 +264,20 @@ void TileGenerator::parseColorsStream(std::istream &in)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char name[75];
|
char name[75];
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
// MinGW's sscanf doesn't support %hhu
|
||||||
|
unsigned int r, g, b, a, t;
|
||||||
|
#else
|
||||||
uint8_t r, g, b, a, t;
|
uint8_t r, g, b, a, t;
|
||||||
|
#endif
|
||||||
a = 255;
|
a = 255;
|
||||||
t = 0;
|
t = 0;
|
||||||
|
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
sscanf(line, "%75s %u %u %u %u %u", name, &r, &g, &b, &a, &t);
|
||||||
|
#else
|
||||||
sscanf(line, "%75s %hhu %hhu %hhu %hhu %hhu", name, &r, &g, &b, &a, &t);
|
sscanf(line, "%75s %hhu %hhu %hhu %hhu %hhu", name, &r, &g, &b, &a, &t);
|
||||||
|
#endif
|
||||||
if(strlen(name) == 0)
|
if(strlen(name) == 0)
|
||||||
break;
|
break;
|
||||||
ColorEntry color = ColorEntry(r, g, b, a, t);
|
ColorEntry color = ColorEntry(r, g, b, a, t);
|
||||||
|
Loading…
Reference in New Issue
Block a user