Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marmalade port: changed "airplay" to "marmalade". Implemented CCImage::initWithString. #610

Merged
merged 23 commits into from
Dec 13, 2011

Conversation

gzito
Copy link
Contributor

@gzito gzito commented Dec 8, 2011

I added "marmalade" folders and new *_marmalade files, e.g. platform/marmalade/CCEGLView_marmalade.cpp.
Also I renamed symbols, such as CC_PLATFORM_AIRPLAY into CC_PLATFORM_MARMALADE.
I left old "airplay" files and folders in place until you finally decide to perform the switch, however other developers should be notified about the change.

CCImage::initWithString for Marmalade is a contribution by Alex Builder and Francis Styck

@gzito
Copy link
Contributor Author

gzito commented Dec 9, 2011

Other commits:

The stuff below fix errors when the program exits, purging CCDirector and releasing memory correctly.

  • CCDirector (updates done only for CC_PLATFORM_MARMALADE)
    sharedDirector(): s_sharedDirector is now a pointer (it was a static instance)
    purgeDirector(): m_pobOpenGLView, the CCEGLView shared instance, is deleted
  • CCApplication_marmalade:
    Run() method modified to handle correctly quit requests, CCDirector::purge() is requested before exiting
  • CCEGLView_marmalade:
    shared instance is now a pointer (it was a static instance)
    the CCEGLView::release notifies the CCApplication about quit

Additions and other fixes:

  • CocosDenshion/marmalade/SimpleAudioEngine
    Added possibility to play more than one sound fx at once
  • CCImage_marmalade (contribution by Alex Builder and Francis Styck)
    implemented initWithString
    added jpeg support (contribution by Alex Builder)
    • Integrations for marmalade port
      libFreetype and libjpeg
    • test/AppDelegate
      CCDirector shared instance is deleted in AppDelegate destructor
    • test/all
      The X icon now quit the app

Open issues:
CCLabelTTF in the Marmalade port are very slow
Device rotation doesn't work properly, see "Director Test"

@dumganhar
Copy link

Hi, thanks for your pull request. I am merging your code to master. But I have some questions:

  1. sharedDirector(): s_sharedDirector is now a pointer (it was a static instance), Why should change to this?
  2. In 'CCDirector::purgeDirector()' function
    // OpenGL view
    #if (CC_TARGET_PLATFORM != CC_PLATFORM_MARMALADE)
    m_pobOpenGLView->release();
    m_pobOpenGLView = NULL;
    #else
    CC_SAFE_DELETE(m_pobOpenGLView) ;
    #endif
    Why should use 'CC_SAFE_DELETE(m_pobOpenGLView)' instead of 'm_pobOpenGLView->release();'? In my opition, m_pobOpenGLView reference is always 1. using 'release' method will delete it.

@gzito
Copy link
Contributor Author

gzito commented Dec 12, 2011

Hi, thanks for your comment.

  1. When I tested the code Marmalade runtime checker reported memory leaks because CCDirectory was destroyed after the main (in the atexit function).
    I just tried to rollback the code and tested it again right now, it seems that this issue disappeared. So may be I need some more time to test it better.
  2. Unfortunately CCEGLView is not a CCObject, so calling release() will not delete it. I looked at win32 implementation and in fact release() method perform a "delete this" as last instruction. I tried now to add "delete this" into Marmalade implementation, it seems to work.

Please could you delay the merge and wait until i better look at both the points and perform some more tests?

Thanks again.
G.Z.

@dumganhar
Copy link

OK, waiting for your good news.
By the way, I had compiled your code successfully. And run it on bada 2.0 WVGA. There are still a lot of issues needed to be resolved. You can modify your code by basing on my repo 'https://github.com/dumganhar/cocos2d-x/tree/issue908_marmalade'. Thanks for your effort!

Optimized a little bit CCImage::initWithString
Fixed CCApplication::run in order to handle closing Marmalade simulator
@gzito
Copy link
Contributor Author

gzito commented Dec 12, 2011

Hi dumganhar,

I fixed things in CCEGLVIew, so that it's now aligned to win32 version (release method perform "delete this").
Added a fix to CCApplication::run in order to support quit from simulator and also rollback changes in CCDirector (the shared instance is static again).
I tested things on the simulator and also on iPhone, it works. You can safely go on with merge into master now.

Please let me aware about some of the opened issues you mentioned in your comment.

Thanks
Giovanni

@dumganhar
Copy link

Hi, your 'pull request' have been meged into master.
Thanks for your effort!

angeltown pushed a commit to angeltown/cocos2d-x that referenced this pull request Apr 28, 2014
angeltown pushed a commit to angeltown/cocos2d-x that referenced this pull request Apr 28, 2014
[android] fixed cocos2d#610: remove the support of ndk-r4
angeltown pushed a commit to angeltown/cocos2d-x that referenced this pull request Apr 29, 2014
angeltown pushed a commit to angeltown/cocos2d-x that referenced this pull request Apr 29, 2014
[android] fixed cocos2d#610: remove the support of ndk-r4
minggo added a commit that referenced this pull request May 4, 2014
minggo added a commit that referenced this pull request May 4, 2014
[android] fixed #610: remove the support of ndk-r4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants