Jump to content
  • Advertisement
Sign in to follow this  
Feidias

Clipping problem (SDL)

This topic is 4775 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a manual clipping which doesn't match with SDL rectangle clipping. This problem is driving me nuts.. The error is only when clipping left or upper sides. I'm using if (x<0) { w+=x; x=0; } for the manual clipping. The picture shows what happens if the cursor is outside the tile. It's one pixel "late" than the actual pixel. When the cursor is totally visible everything works ok. Image What I'm trying to do here is a precise cursor for a brush in sprite editor.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Easca
What is wrong with using if (x<0) { w+=x+1; x=0; } .


Well, that doesn't make any sense. I think the manual clipping works exactly as it should, it's just something with the precise cursor I'm doing wrong. Actually, if I make the mouse cursor "jump" forward one pixel when x<0 then it works. But it's not the proper solution, because you can see how the cursor jumps and it makes you wonder what just happened..

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!