www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: IZACIZAC on May 31, 2013, 11:27:59 pm

Title: blit inaccuracy
Post by: IZACIZAC on May 31, 2013, 11:27:59 pm
Hey, I am blitting a portion of a texture (1024x256)

Code: [Select]
buffer.blit(ui,0,0,0,0,600,25,true);
Which is working fine, but when I resize the window

Code: [Select]
if (Display.wasResized())
            {
                buffer.resize(Display.getWidth(), Display.getHeight());
            }

It no longer draws the portion that I want, and instead draws 1 extra pixels worth (so 26 instead of 25) and shrinks it to fill the 25 pixel space (baiscally it has a big white line under it on screen). It also shifts the entire drawing down by 1, so draws at 1 instead of 0 (both in Y and X). This is only when the Display is a odd number in height/width e.g. 801x601

Is this normal/what should I do to avoid this?
Title: Re: blit inaccuracy
Post by: EgonOlsen on May 31, 2013, 11:32:11 pm
Have you tried the latest beta to see if it fixes this problem: http://jpct.de/download/beta/jpct.jar (http://jpct.de/download/beta/jpct.jar)?
Title: Re: blit inaccuracy
Post by: IZACIZAC on June 01, 2013, 12:06:42 am
Perfect. Thanks for the quick reply, prob solved