fallahn / sfml-tmxloader

SFML 2.x based tmx tilemap parser for files created with Tiled tile map editor
106 stars 35 forks source link

Isometric causing weird issues #72

Open Steveo5 opened 7 years ago

Steveo5 commented 7 years ago

Hello, I have everything up and running properly and all works well. However I noticed that when moving the view around the map because its isometric and therefore at a different angle then things that are supposedly outside the view don't get drawn even though they are still visible. How could I fix this? Cheers!

fallahn commented 7 years ago

Probably related to #59 - the first place to look would probably be how the layer patches are generated for isometric maps. The bounding boxes for these patches are used for culling (iirc).

Steveo5 commented 7 years ago

Oh cheers, edited some of the bounding boxes and now all works well!

fallahn commented 7 years ago

Good to know! If it fixes a bug could you perhaps share what you did or submit a pull request?

Steveo5 commented 7 years ago

I just added a padding to the bounding box, for example in the MapLayer.cpp at line 94 I took off a padding of 1000 so that way the map should generate a little outside of the view port area. Possibly could check if the map is isometric first but mine is so I didn't bother.

fallahn commented 7 years ago

It sounds like it could be as simple as correctly converting isometric coords into sfml/world coords. I'll investigate further when I can. Thanks for the feedback!