libcg / gLib2D

A simple, fast, light-weight 2D graphics library for PSP.
GNU Lesser General Public License v3.0
46 stars 12 forks source link

Problem with crop functions and tex_repeat #3

Open nikmes opened 8 years ago

nikmes commented 8 years ago

Hi,

I am not sure if you are still working on this but i see that you made SDL port. I have an issue when running code on PSP and it has to do with crop functions. When i g2dSetCropXY(cx, cy); and i increase cx by 1 or decrease by 1 depending on which direction i am scrolling i have an issue. Basicaly when i start scrolling cx-=1 i get weird artifacts, when i scroll the other direction cx+=1 all is good. Same happens when i scolling the image using cy.

Here is a screen shot with artifacts: image

I get the same problem on a real PSP.

I am using your rendering library (an opengl version as well) to render all my graphics for this tool www.facebook.com/2dleveleditor

Thanks for this library! Is amazing!

Regards

libcg commented 8 years ago

Not sure how to fix this but I would suggest to change your view on this. Don't crop your texture but draw it large enough so it covers the screen.

Always happy to hear that someone is using that library!

nikmes commented 8 years ago

Hi, Thanks a lot for the response. Actually I crop the texture to achieve the infinite scrolling effect of the background. I figure out another work around. Before I start cx-=1 or cx+=1 to scroll it, i initialize cx=text->width_1000 and cy=text->height_1000 and now no matter which direction i scroll left or right up or down i do not get the artifacts.

Thanks a lot for your response! I learned a lot from your code, especially from the gSquare game. Thanks for your open source contributions.

Regards