Gamua / Sparrow-Framework

The Open Source Game Engine for iOS
http://www.sparrow-framework.org
Other
294 stars 83 forks source link

Added support for Xcode 6 #46

Closed MrLarryLi closed 9 years ago

MrLarryLi commented 9 years ago

Hello,

Thank you for the feedback. I managed to redo my fork so now it's cleaner.

1) I changed glBufferData() because I noticed that it always sends the entire buffer. I do not know how much it impacts performance, but it makes it easier for me to debug. 2) I changed the colors to have alpha because I ran into situations where SPColorWhite wasn't equal to SPColorMakeARGB(255,255,255,255). 3) As for NSCopying, I did encounter a situation where I called "copy" on one of my sprites. It called the SPSprite "copy" method and didn't call my copyWithZone: method (I can't remember for sure). I did notice something wrong in my game when it happened. That's why I changed them all. It could also be that I don't call [super copy] on my sprites because SPSprite didn't used to implement it.

Please let me know if there are other things I should do.

racarone commented 9 years ago

Looks great!

1.) Yeah uploading the full buffer is actually more efficient, at least on iOS devices. I'm guessing this is because 'glBufferData' describes the capacity of the buffer as well as the data. Since the capacity increases less often than the size, OpenGL doesn't have to find new space for the buffer every frame. 2.) Makes sense, will merge this. 3.) Ah I understand how that can occur now as 'copy' never calls 'copyWithZone:', will merge. =)

Thanks Larry!

MrLarryLi commented 9 years ago

I am glad I could help out.

I do have a request. Could you look into the anti-aliasing? It doesn't seem to work. It generates OpenGL errors about missing depth/stencil buffer when testing for them. I couldn't fix it as I don't have enough understanding about frame buffers.

racarone commented 9 years ago

Of course, I'll take a look tomorrow.

racarone commented 9 years ago

It's fixed now, the multisample buffer was never being resolved =P

MrLarryLi commented 9 years ago

That was fast. Thank you for fixing it.