Cocos2d-x Airplay SDK port - first release

Great! I’ve just starting to creating my game with Airplay-SDK and Box2D, now with cocos2d I’ll be able to do that much more easy! thanks.
I’ll test this on my device a soon as airplay-sdk beta will finish download.

axmx and all, thanks for all your contributions! I created this issue #379, and will integrate this port to cocos2d-x offcial repository.
But as a newbee of airplaysdk, I have a problem at the merging work.
Reference to the folder structure on http://github.com/cocos2d/cocos2d-x/, I expect the folder structure of airplaysdk port can be:

root/
       Box2D/proj.airplaysdk/Box2D.mkf
       chipmunk/proj.airplaysdk/chipmunk.mkf
       cocos2dx/proj.airplaysdk/cocos2dx.mkf
       tests/test.airplaysdk/Game.cpp
                                      Game.h
                                      Main.cpp
                                      Main.h
                                      test.airplaysdk.mkb

Can anyone do me a favour?

Please note that Box2d has a bug with Infinity number when running on device or simulator, causes many functions to assert.
the suggested workaround:
b2Math.h - the function b2IsValid should be like this (changed section is bold):

inline bool b2IsValid(float32 x)
{
if (x != x)
{
// NaN.
return false;
}
>
float32 infinity = std::numeric_limits::infinity();
>
// **iPhone FAILS with infinity = 0.0 *
>
>**if ( infinity == 0.0f ) return true;*
>
return -infinity < x && x < infinity;
}

Walzer wrote:

Reference to the folder structure on http://github.com/cocos2d/cocos2d-x/, I expect the folder structure of airplaysdk port can be:
>……
Can anyone do me a favour?

You can do exactly this structure of files - you need only take account of changes in the files . mkf and. mkb

Dave Johnson wrote:
>… the mouse becomes locked to the screen when moving menu up and down…

Dave - thanks for the feedback…

Now I have the iMac and have the opportunity to check the port on xcode:
first - the mouse (pointer) is not working correctly - that would fix it, replace the files from the attachment .
Other bugs I have no opportunity to fix now - you first need to implement a port in the source code cocos2d-x on GitHub …

#379 is planned in version 0.9.0
0.8.0 will release in these days.

And you can vote for “more platforms” including airplaysdk in this page http://www.cocos2d-x.org/news/12 :slight_smile:

@Walzer
I vote for “More stable and etc…” now :slight_smile:

Hi there, I’ll continue the mouse pointer fix above.
The attached files are based on Dave Johnson’s fix and it fixes the mismatch of pointer data while running on device.
I only replaced the lines:
m_pTouch->SetTouchInfo(0, (float)s3ePointerGetX(), (float)s3ePointerGetY());
with:
m_pTouch->SetTouchInfo(0, (float)event->m_x, (float)event->m_y);

Works fine on my device.

Has anyone made any game with cocos2dx and airplay.
I’m having trouble loading sprite sheets. I always get insufficient memory whereas iv assigned 50Mb to it in the app.icf file.

that’s probably because of the simulator configuration, you should config it to have more memory. (don’t remember where exactly)
but anyway you shouldn’t target to 50Mb of memory, older devices like iPod Touch 2G or iPhone 3G has 30-40 mb free for games.

that’s probably because of the simulator configuration, you should config it to have more memory. (don’t remember where exactly)
but anyway you shouldn’t target to 50Mb of memory, older devices like iPod Touch 2G or iPhone 3G has 30-40 mb free for games.

The problem is not only with the simulator. The game crashes on an iphone 3GS as well.
And yeah I know 50Mb is more than enough. But I just cant load 4-5 sprite sheets.

This configuration of memory size is just for cocos2dx with marmalade?

Zohaib Zaidi wrote:

The problem is not only with the simulator. The game crashes on an iphone 3GS as well.
And yeah I know 50Mb is more than enough. But I just cant load 4-5 sprite sheets.

Well this issue has been resolved if you download the current version of cocos2d-x

Note that the recent December release of Cocos2d-x includes full support for Marmalade.