Background scrolling lags
Posted: Tue Mar 24, 2015 11:24 pm
Have anyone else experienced 1 pixel lags for part of lines when moving backgrounds - especially can feel when moving whole plane? Although speed is exactly 60 fps. Sprite movements dont lag.
If noone else have this problem possibly im doing something wrong with background setup.
I use this for drawing map. Basically it gets numbers from map content array and searches global defined tiles/fields after then it finds index for tile(so for all same looking tiles there is only one set in VRAM) and pushes thise tile to VDP and keeps doing same for all map.
Atleast i dont see anything wrong in way i set up background, but i dont think SGDK have bug like this. So please help me.
If noone else have this problem possibly im doing something wrong with background setup.
Code: Select all
void Karte_zimet(Karte* p_karte)
{
SYS_disableInts();
u16 i, j;
Laucins* _laucins;
Image* _bilde;
u16 _x = 0, _y = 0;
u8 _vertiba;
u16 _indeks, _pedejais_indeks = TILE_USERINDEX;
VDP_setPalette(0, palette_black);
VDP_setPalette(1, bmp_zale.palette->data);
for(i = 0; i < p_karte->rindas; i++)
{
_x = 0;
for(j = 0; j < p_karte->kolonnas; j++)
{
_vertiba = sisp(p_karte, iegut_saturu, i, j);
_laucins = Laucini_iegut_laucinu(_vertiba);
_bilde = _laucins->bilde;
if(_laucins->ir_VRAM)
{
_indeks = _laucins->VRAM_indeks;
}
else
{
_indeks = _pedejais_indeks;
}
VDP_drawImageEx(VDP_PLAN_B, _bilde, TILE_ATTR_FULL(PAL1, FALSE, FALSE, FALSE, _indeks), _x, _y, FALSE, TRUE);
if(_laucins->ir_VRAM == ne)
{
_laucins->VRAM_indeks = _indeks;
_pedejais_indeks += _bilde->tileset->numTile;
_laucins->ir_VRAM = ja;
}
_x += _bilde->map->h;
}
_y += _bilde->map->w;
}
SYS_enableInts();
}
Atleast i dont see anything wrong in way i set up background, but i dont think SGDK have bug like this. So please help me.