News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

Glowing blue edges around water?

Started by Ashley, May 28, 2014, 09:43:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ashley

See screenshot, are the edges of the water supposed to look like that? This is with the 120.0 (r7175) code, albeit running via Cocoa on OSX (so it may well be my code which is at fault here).

Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

Ters

My Simutrans has never done that. (Although it has done lots of other crazy things when I mess with it.) The general shape of the coast looks right, but not the colors. I guess the rest of the answers are up to you, since you know what you've done with Simutrans.

TurfIt

IIRC SDL2 did that with the RGB555 format. Changing to RGB565 fixed.

Ashley

Quartz doesn't support RGB565 format, I've been using RGB1555 (same code for get_system_color() as simsys_w with USE_16BIT_DIB undefined). It looks likely that none of the other backends actively use RGB1555 though. I suspect that there's a bug in simgraph16 in the routines which are drawing the pixel values for the blended textures making up the shorelines - maybe it's assuming RGB565 format or something like that and it hasn't been spotted since the platforms being compiled for don't use it.


unsigned int get_system_color(unsigned int r, unsigned int g, unsigned int b)
{
    // RGB1555
return ((r & 0x00F8) << 7) | ((g & 0x00F8) << 2) | (b >> 3);
}
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

TurfIt

Also IIRC, the '//find out bit depth' code in simgraph_init() didn't work when RGB555 was selected. Forcing the 15bpp routines worked, but just using 565 did too...

Ashley

Yep, as I thought, a little bug in simgraph16, only applying to the pix_alpha_* and pix_alpha_recode_* functions when ALPHA_BLUE is used in the flags (which is only used for tiles which blend with water, so the coast tiles). Thanks for pointing me in the right direction though :)
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

prissi