mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 15:39:20 +02:00
Editor imagery: unflip the WMS tiles, and build without libcurl
Two things about the map behind the plan, neither of them the plan's own doing. stb keeps one flip flag for the whole program - there is a single stb_image.c in the build - and the model texture loader turned it on for its own sake, because models want the bottom row first. A WMS tile is the other way about: its first row is its northern edge, which is what the drawing code takes v=0 to be. So every tile came out upside down as soon as any model texture had been loaded through that path, which is why this has come and gone with the order things load in. Both decoders now say which way they want it per thread, where nobody else can reach it. And libcurl is no longer required to configure. A tree without it builds an editor that draws and exports as usual, only with nothing behind the plan, and says so once rather than showing a silent grey screen; the CI installs it, so what comes out of the build has its imagery.
This commit is contained in:
@@ -368,7 +368,10 @@ void opengl_texture::load_PNG()
|
||||
void opengl_texture::load_STBI()
|
||||
{
|
||||
int x, y, n;
|
||||
stbi_set_flip_vertically_on_load(1);
|
||||
// per thread, not for the whole program: there is one stb_image.c in the build, so the global
|
||||
// flag reaches every other decoder too - which is how the editor's WMS tiles ended up upside
|
||||
// down as soon as any model texture had been loaded through this path
|
||||
stbi_set_flip_vertically_on_load_thread(1);
|
||||
uint8_t *image = stbi_load((name + type).c_str(), &x, &y, &n, 4);
|
||||
|
||||
if (!image) {
|
||||
|
||||
Reference in New Issue
Block a user