zohaib at July 4th, 2011 00:35 — #1
I have a game written using objective C and cocos2d.
I want to port it to android without using java.
I initially tried with airplay sdk but it has too many issues.
Is it possible to port my game using this cocos2dx and ndk in C++? and what resources will be required.
A quick reply will be appreciated. Thanks
zhangxm at July 4th, 2011 01:16 — #2
Yes, you can port it with cocos2d-x.
If you didn’t use too many iOS sdk, it will be very easy and quick to port.
zohaib at July 4th, 2011 01:23 — #3
Can you just help me start out.
Any tutorials and the softwares that will be required.
I’m very short on time as I wasted alot of time with airplay.
zhangxm at July 4th, 2011 01:27 — #4
zhangxm at July 4th, 2011 01:30 — #5
Ofcource, you can use the HelloWorld as your project, and add your codes.
zohaib at July 4th, 2011 01:33 — #6
I have around 800 frames in my plist file.
This was one of the major issues due to which my sprite sheet was not loading using airplay.
Will there be the same problem when using the android ndk?
Is cocos2dx stable with android ndk ? Can you send me the link of any games created using this.
zhangxm at July 4th, 2011 01:37 — #7
You can use plist file as you did with cocos2d-iphone.
The games used cocos2d-x listed in http://www.cocos2d-x.org/projects/cocos2d-x/apps.
zohaib at July 4th, 2011 01:39 — #8
Is there any limit on the number of frames that can be in a sprite sheet.
Because the sprite sheet I was using for iphone which had around 8000 frames in it and when i loaded it using cocos2dx and airplay the application crashed. There was nothing else happening in the application. I was only trying to load this one sprite sheet and was getting memory crashes.
So that is my main concern.
zohaib at July 4th, 2011 02:42 — #9
Hey Minggo thanks for the help.
I’ll be bugging you if I get stuck.
eyesiah at July 4th, 2011 23:36 — #10
I’ve managed to successfully port Chirp Chirp from cocos2d-iphone to cocos2d-x. I also had problems with anything to do with plist files. I wound up writing my own implementation for reading them, using tinyxml instead of libxml. Most of the crashes seemed to be happening inside libxml.
Are you able to load you 8000-frame sheet using the win32 version of cocos2d-x? If so, i’d imagine the engine can in theory handle it. If you’re getting android-only memory crashes, maybe you’re just using too much memory for your device?
zohaib at July 4th, 2011 23:52 — #11
I didn’t try it for windows. The 8000 frame sheet loads up easily on normal cocos2d in objC.
It kinda crashed on android. It got stuck or something while loading.
Can you email me or attach your implementation for reading them. It will be highly appreciated. Thanks
eyesiah at July 5th, 2011 08:56 — #12
I’d recommend trying it first on the win32 build, so you can see if its a problem with cocos2d-x or with android.
zohaib at July 5th, 2011 18:11 — #13
Ok cool. I’ll do that.
zohaib at July 6th, 2011 06:31 — #14
I tried loading the sprite sheet using cocos2d and android sdk in java. I got a memory error. Actually someone tried it for me. The error was something like insufficient memory and the app crashed.
So that ill assume android is not capable of handling so many frames.
Well theoretically it isn’t a very good practice that I have so many frames in a single sprite sheet but if I can get this to work then my life will be soo easy.
zohaib at July 12th, 2011 23:11 — #15
There is some issue with the parsing being used.
I tried to load the plist through airplay(marmalade) and got the same issue with loading it. The issue is not only on android but also iOS(if the native obj c parser is not used)
Can you help me out with the tinyXml implementation.
eyesiah at July 12th, 2011 23:17 — #16
I’ve attached a rar with some classes that I used for loading plist files using tinyxml. I hope they’re useful.
zohaib at July 12th, 2011 23:19 — #17
I’ll have a look at it and let you know
zohaib at July 12th, 2011 23:38 — #18
There’s a file included in the project PortTypesdef.h.
What does it contain. Because I’m getting errors in the file ENSDictionary.h
eyesiah at July 12th, 2011 23:41 — #19
It just contains some defines that convert the NS* classes to CC* classes, for help with porting. Just replace references from things like NSObject to CCObject and you should be able to remove the #include for that file and get it to compile. But I’d recommend just looking through the code that uses the TiXml* classes to see how they work, and integrate it into your own solution.
zohaib at July 12th, 2011 23:46 — #20
Yeah I figured that out after posting.
I was just integrating it with my problem just to easily follow it.
Thanks for the help
next page →