Page 1 of 1

Cegui for OgreIPhone Target’s error

Posted: Sun Jun 27, 2010 07:02
by yaxinhoo
I want to use cegui for ogre IPhone, I got the cegui source and build it in the mac 。then i setup three iphone static lib target in the project,it is CEGUIbase_I,CEGUIOgreRenderer_I,CEGUITinyXMLParser_I ,replace the dependence pcre and freetype2 with iphone dependencies. it work, i build and got the static lib for iphone.

but when i use it in i phone project ,the project can't bootstartupsystem

Code: Select all

mOgreRenderer = &CEGUI::OgreRenderer::bootstrapSystem(*m_pRenderWnd);

it is error in runtime when cegui load the tinyXmlparser, the exception code process createBundle in the function of mac_loadexebundle(const char*name)
it log a message "Couldn't get bundle from main app bundle reference; trying CEGUIbase instead"

Code: Select all

    if (pluginName)
    {
        bundle = createBundle(CFBundleGetMainBundle(), pluginName);

        if (!bundle)
        {
            if(logger)
                logger->logEvent(
                    "-- Couldn't get bundle from main app bundle reference; "
                    "trying CEGUIbase instead.");

            bundle =
                createBundle(CFBundleGetBundleWithIdentifier(
                                CFSTR("net.sourceforge.crayzedsgui.CEGUIBase")),
                             pluginName);
        }


i want to know the diffrence of macexebundle and iphonebundle to let the cegui work for iphone .
anyone can tell me ,or tell me the way to let cegui work for iphone .

Re: Cegui for OgreIPhone Target’s error

Posted: Sun Jun 27, 2010 13:43
by yaxinhoo
the errer is CFBundleCreate unsuccess, it return zero.

the crash code is

Code: Select all

bundle =
                createBundle(CFBundleGetBundleWithIdentifier(
                                CFSTR("net.sourceforge.crayzedsgui.CEGUIBase")),
                             pluginName);



Code: Select all

//----------------------------------------------------------------------------//
CFBundleRef createBundle(CFBundleRef sourceBundle, CFStringRef bundleName)
{
    CFBundleRef bundle = 0;

    CFURLRef pluginsURL = createFullPluginsURL(sourceBundle);

    if (pluginsURL)
    {
        CFURLRef bundleURL =
            CFURLCreateCopyAppendingPathComponent(0, pluginsURL,
                                                  bundleName, false);
        if (bundleURL)
        {
            bundle = CFBundleCreate(0, bundleURL);
            CFRelease(bundleURL);
        }

        CFRelease(pluginsURL);
    }

    return bundle;
}

//----------------------------------------------------------------------------//
CFBundleRef mac_loadExeBundle(const char* name)
{
    Logger* logger = Logger::getSingletonPtr();

    if (logger)
    {
       logger->logEvent("---- Beginning exe bundle loading ----");
       logger->logEvent("-- Input bundle name: " + String(name));
    }

    CFBundleRef bundle = 0;

    CFStringRef pluginName = createBundleNameString(name);
   
    if (pluginName)
    {
        bundle = createBundle(CFBundleGetMainBundle(), pluginName);

        if (!bundle)
        {
            if(logger)
                logger->logEvent(
                    "-- Couldn't get bundle from main app bundle reference; "
                    "trying CEGUIbase instead.");

            bundle =
                createBundle(CFBundleGetBundleWithIdentifier(
                                CFSTR("net.sourceforge.crayzedsgui.CEGUIBase")),
                             pluginName);
        }

        if (bundle)
        {
            if (!CFBundleLoadExecutable(bundle))
            {
                CFRelease(bundle);
                bundle = 0;
            }
        }
       
        CFRelease(pluginName);
    }

    if (logger)
    {
        if (bundle)
            logger->logEvent("-- Bundle loaded successfully.");
        else
            logger->logEvent("-- Bundle loading failed!");

        logger->logEvent("---- Finished exe bundle loading ----");
    }
 
    return bundle;
}