2d - Java rendering bug -


i'm using simple rendering method in java render tiles. looks fine, notice rows grow 1 pixel when move, , shrink back, have no idea why. infos: i'm using 16 x 16 tiles, render method runs around 500 times per second, use triple buffering, code of tile rendering method (located in screen class):

public void rendertile(int xpos, int ypos, tile tile) {         xpos -= xoffset;         ypos -= yoffset;          (int y = 0; y < 16; y++) {              int ypixel = y + ypos;              (int x = 0; x < 16; x++) {                 int xpixel = x + xpos;                 if (ypixel < 0 || ypixel >= height) continue;                 if (xpixel < 0 || xpixel >= width) continue;                 pixels[(xpixel) + (ypixel) * width] = tile.sprite.pixels[x + y * tile.sprite.size];             }         }     } 

i load sprites sprite sheets, , contain pixel data in array,

can help? (if additional info needed, tell me)

image issue: http://i59.tinypic.com/330y34i.png


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -