|
panel bitmap bug
#352771
01/05/11 20:22
01/05/11 20:22
|
Joined: Mar 2006
Posts: 2,252
Hummel
OP
Expert
|
OP
Expert
Joined: Mar 2006
Posts: 2,252
|
Hi, when scaling and/or mirroring a panel with bitmap several small 'offset-bugs' seem to occur in the bitmap: In the case of mirroring only (scale_x/y=-1) a single pixel offset appears (in mirroring direction). Using scale_x/y=-2 gives nearly the same effect but itīs now just a half-pixel offset. scale_x/y=(-)16 gives the same result but the panel without mirroring displays its bitmap now shifted too. I used engine version 8.10.1 Grüße PS: test code
#include <acknex.h>
#include <default.c>
BMAP *_bQuad="Quad.tga";
PANEL *_pQuad1=
{
bmap=_bQuad;
flags=SHOW;
}
PANEL *_pQuad2=
{
bmap=_bQuad;
flags=SHOW;
}
PANEL *_pQuad3=
{
bmap=_bQuad;
flags=SHOW;
}
PANEL *_pQuad4=
{
bmap=_bQuad;
flags=SHOW;
}
void main()
{
fps_max=50;
video_mode=9;
vec_set(screen_color,vector(255,255,255));
var _vScale=16;
_pQuad1->scale_x=_vScale;
_pQuad1->scale_y=_vScale;
_pQuad1->pos_x=1*_vScale;
_pQuad1->pos_y=1*_vScale;
_pQuad2->scale_x=-_vScale;
_pQuad2->scale_y=_vScale;
_pQuad2->pos_x=18*_vScale;
_pQuad2->pos_y=1*_vScale;
_pQuad3->scale_x=_vScale;
_pQuad3->scale_y=-_vScale;
_pQuad3->pos_x=1*_vScale;
_pQuad3->pos_y=18*_vScale;
_pQuad4->scale_x=-_vScale;
_pQuad4->scale_y=-_vScale;
_pQuad4->pos_x=18*_vScale;
_pQuad4->pos_y=18*_vScale;
}
Last edited by Hummel; 01/05/11 20:25.
|
|
|
Re: panel bitmap bug
[Re: jcl]
#352937
01/06/11 17:51
01/06/11 17:51
|
Joined: Mar 2006
Posts: 2,252
Hummel
OP
Expert
|
OP
Expert
Joined: Mar 2006
Posts: 2,252
|
Itīs also noticable in not (or just in one direction) scaled up images which are quite small like the ones you use when building a GUI and thatīs actually the situation when I noticed it. When I want to display a window border bar using f.i. a streched 2x16 bitmap I dont care about a possible pixel shift along the stretch. But as soon as I want to use the same bitmap for the opposite border bar by using scale_x=-1; I get the pixel offset. And since itīs the nature of this kind of bitmaps to contain important color information in just a handfull of pixels, specially in the border pixels, the visual effect can be a completely other one than the one of the opposite border. Creating multible versions of each bitmaps seems to be the only solution... ...and that makes me sad
Last edited by Hummel; 01/06/11 17:52.
|
|
|
Re: panel bitmap bug
[Re: Rei_Ayanami]
#352941
01/06/11 18:04
01/06/11 18:04
|
Joined: Mar 2006
Posts: 2,252
Hummel
OP
Expert
|
OP
Expert
Joined: Mar 2006
Posts: 2,252
|
That is my plan but still, using a single value seems to be the smarter solution to me. Memory is not really the problem as long as I just need multible versions for the GUI but it looks like memo waste when developing a 2D game with many different tiles where you have to generate multible versions for half of the pics...
EDIT: what about a shift_x/y panel member where the user could define pixel shifts for the bitmaps of a panel on his own? Is there a performance or technical prob implementing this?
Last edited by Hummel; 01/06/11 19:17.
|
|
|
|