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
Post a Comment