Hi

I've been looking through the code to try to find the source to the glitches I presented in the dev forum (which is down now so I can't provide an URL). There are basicly two bugs:

1. Artifacts along the edges of hexes
2. Multihex/overlay tiles get corrupted

I have found the first one to be present when the tiles are of the type SCALED:

image_type = image::SCALED;

So there seems to be something wrong with the scaling of the images. For some reason scaling is applied to all zoom levels, also the default one which seems unecessary.

I did the following test in void display::draw_terrain_on_tile:

<     image::TYPE image_type = image::SCALED;

>     image::TYPE image_type;
>     if (zoom_ == DefaultZoom) {
>       image_type = image::UNSCALED;
>     } else {
>       image_type = image::SCALED;
>     }

This removed the artifacts on default zoom (96x96 in my test). Although it still appears at other zoom levels as it doesn't solve the real problem. I would appreciate some input from devs that are familiar with this code on what could be wrong with the scaling code. It doesn't seem to happen at all zoom levels:

Artifacts on zoom levels: 100, 104, 120, 124, 128, 132, 136, 140, 144
No artifacts on zoom levels: 108, 112, 116

Some zoom lvl experience far more artifacts than others. I suspect it doesn't work as it should on any zoom lvl != default, but at some the artifacts are to few to notice.

I looked at surface get_scaled(const locator i_locator, COLOUR_ADJUSTMENT adj) in image.cpp, but I couldn't figure out that it does any scaling at all. It gets an UNMASKED image, does some color adjusting, then sets the alpha value if it gets an image mask and thats it...? I've basicly never coded any C/C++ and is unfamiliar with the code so any pointers to where I should look would be nice :)

There is also this in the get_Scaled function:
//commented out pending reply from SDL team about bug report
//SDL_BlitSurface(mask,NULL,result,NULL);

As to problem 2 I don't know whats up, haven't looked into it yet.

--
mvh                 (o_
Hogne Håskjold      //\
                    V_/_


_______________________________________________
Wesnoth-dev mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-dev

Reply via email to