~CROP(offset,0,w,h) causes honeycomb in large terrain imgs

Having trouble with the game? Report issues and get help here. Read this first!

Moderators: Forum Moderators, Developers

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
User avatar
doofus-01
Art Contributor
Posts: 3788
Joined: January 6th, 2008, 9:27 pm
Location: USA, the civilized part.

~CROP(offset,0,w,h) causes honeycomb in large terrain imgs

Post by doofus-01 » March 23rd, 2011, 1:05 pm

I tried to make an animated terrain by shifting a large image that was not fully displayed, using CROP() image path function. It is supposed to be distant terrain scrolling by.(http://forums.wesnoth.org/viewtopic.php ... 66#p482866) But instead, each hex independently slides away, the pixels it vacates show the underlying images. Here are some pictures:
Spoiler:
On the right side of crop-error.png, there is noticeable green slash showing through the bluish chasm edge. It's like that part of the cropped image, which shouldn't show, is getting redrawn, while the parts that are supposed to be are not (the dark blue is a lower layer). Like minus sign got dropped somewhere or something like that.

This is my WML, the image names should be changed though:
Spoiler:
As I'm writing this, it occurs to me that I did not try all mainline images, but even if that has an effect, there is still a problem. The sky-map.png image is 1814X729. Everything looks fine in the first frame.

EDIT: bug report
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects

User avatar
doofus-01
Art Contributor
Posts: 3788
Joined: January 6th, 2008, 9:27 pm
Location: USA, the civilized part.

Re: ~CROP(offset,0,w,h) causes honeycomb in large terrain im

Post by doofus-01 » March 24th, 2011, 12:57 pm

I've got a way to more easily recreate this.

1. I needed a large image, so I copied wesnoth-icon.png into the "terrain" folder of images.
2. Edit terrain-graphics.cfg so that one of the mainline terrains uses wesnoth-icon.png and CROP() function.
example using Rp

Code: Select all

#{TERRAIN_BASE_RANDOM     Rp                                                        flat/stone-path}
#########
{DISABLE_BASE_TRANSITIONS  Rp}
    [terrain_graphics]
        map="
, * , .
* , * , .
, 1 , .
* , * , .
, * , ."

        [tile]
            pos=1
            type=Rp
            set_no_flag=base
        [/tile]

        probability=100
        [image]
            name="wesnoth-icon.png~CROP(0,0,72,72):1500,wesnoth-icon.png~CROP(5,0,72,72):500,
wesnoth-icon.png~CROP(10,0,72,72):500,wesnoth-icon.png~CROP(15,0,72,72):500"
            layer=-999
            center=86,144
        [/image]
    [/terrain_graphics]
3. Open the map editor and try it out. I used shroud hexes to push the grass transitions away. I also fiddled with the crop width and height (all value 72 in the example above) and it did not behave like I'd expected.
Left is with no offest, right is with offset in x
Left is with no offest, right is with offset in x
To be clear, what I think this should do is shift a cropped wesnoth-icon.png to the left. Instead, it is making a mess.
BfW 1.12 supported, but active development only for BfW 1.13/1.14: Bad Moon Rising | Trinity | Archaic Era |
| Abandoned: Tales of the Setting Sun
GitHub link for these projects

User avatar
zookeeper
WML Wizard
Posts: 9740
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: ~CROP(offset,0,w,h) causes honeycomb in large terrain im

Post by zookeeper » March 24th, 2011, 2:14 pm

Looks like a bug to me... :|

Post Reply