Jump to content
  • Advertisement


Sign in to follow this  
  • entries
  • comments
  • views

Floating point problems... solved!!

Sign in to follow this  


Try and try as I might, I could not get a pixel accurate area of a tile. I found out that this is becuase internally Java2D uses floating point coordinates for rendereing... So I found a work around by creating a whole bunch of rectangles. Rectangles in Java are handled with int, so by adding and subtracting a whole bunch of rectangles to the clipping area I was finally able to get the correct clipping working.

Now you might be asking youself: "Why would you wasnt to mask out the tiles? They don't even overlap!" And the answer is: You want to make sure that LATER when the verts are added that they are clipped out.

Also, my linux tester got ~450fps!
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!