Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2004:
[Freeciv-Dev] Re: (PR#7428) remove special-casing for ocean drawing
Home

[Freeciv-Dev] Re: (PR#7428) remove special-casing for ocean drawing

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#7428) remove special-casing for ocean drawing
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Thu, 19 Feb 2004 09:31:25 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7428 >

On Mon, Feb 16, 2004 at 10:59:59PM -0800, Jason Short wrote:
> 
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7428 >
> 
> Currently fill_tile_sprite_array_iso returns an array called "coasts". 
> This is an array of 4 sprites, used for ocean only, to be drawn and 
> dithered at special offsets.
> 
> This was needed originally because, unlike all the sprites in the 
> sprites array, these sprites have a nonzero offset.  However with the 
> introduction of the drawn_sprite the sprite array gives an offset for 
> each sprite.  Thus we don't need the coasts array; we can just fold this 
> into the sprite array.
> 
> This simplifies the logic for blending.  A new variable dither_count 
> must be passed to fill_tile_sprite_array_iso.  This variable specifies 
> the number of sprites to be drawn before doing the blend.  For most 
> terrains this is 1; for oceans it is 4.  (I snuck in a check to disable 
> blending if it's not needed - basically, don't blend the deep ocean.)

Sounds like a good idea.

> A bug in pixmap_put_drawn_sprite is exposed.  Attached is an diagram to 
> explain what this function is supposed to do.  Originally it was buggy, 
> and I'm not sure that my fix is correct either.
> 
> In the diagram, point A is the drawing origin (canvas_x, canvas_y). 
> Point B is the draw offset at (offset_x, offset_y) (with respect to the 
> origin); rectangle B has dimension (width, height).  Point C is the 
> sprite offset at (s->offset_x, s->offset_y) (with respect to the 
> origin); rectangle B has dimension (s->sprite->width, 
> s->sprite->height).  Note that point B is at the sprite origin (0,0 in 
> sprite coordinates).  The blue area is to be copied from the sprite to 
> the canvas.
> 
> Note that the relative positions of the two rectangles may be different 
> from how it is in the diagram.  You can't assume offset_x < s->offset_x, 
> or anything like that.  This makes the correct logic pretty complicated.

No idea here.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Make it idiot-proof and someone will make a better idiot."




[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#7428) remove special-casing for ocean drawing, Raimar Falke <=