src/CSLModels.cpp
void CSLObj::Load ()
{
    // only if not already requested or even available
    if (GetObjState() != OLS_UNAVAIL &&
        GetObjState() != OLS_COPYING)
        return;
    
    // If needed it is now the time to copy the .obj file
    if (!TriggerCopyAndReplace())
        return;
    
    // Prepare to load the CSL model from the .obj file
    LOG_MSG(logDEBUG, DEBUG_OBJ_LOADING,
            cslKey.c_str(), StripXPSysDir(path).c_str());
    
    // Based on experience it seems XPLMLoadObjectAsync() does not
    // properly support HFS file paths. It just replaces all ':' with '/',
    // which is incomplete.
    // That's why we store paths to .obj already in POSIX format:
    XPLMLoadObjectAsync(path.c_str(),                   // path to .obj
                        &XPObjLoadedCB,                 // static callback function
                        new pairOfStrTy(cslKey.c_str(), // _copy_ of the key string
                                        path.c_str()));
    xpObjState = OLS_LOADING;
}
// Starts loading the XP object asynchronously
/// @details    Async load takes time. Maybe this object exists no longer when the
///             load operaton returns. That's why we do not just pass `this`
///             to the XPLMLoadObjectAsync() call,
///             but a separate object, here a pair of copies of the id strings, by which we can try to
///             find the object again in the callback XPObjLoadedCB().
Starts loading the XP object asynchronously
Starts loading the XP object asynchronously
void CSLObj::Load ()
{
    if (GetObjState() != OLS_UNAVAIL &&
        GetObjState() != OLS_COPYING)
        return;
    if (!TriggerCopyAndReplace())
        return;
    LOG_MSG(logDEBUG, DEBUG_OBJ_LOADING,
            cslKey.c_str(), StripXPSysDir(path).c_str());
    XPLMLoadObjectAsync(path.c_str(),                   
                        &XPObjLoadedCB,                 
                        new pairOfStrTy(cslKey.c_str(), 
                                        path.c_str()));
    xpObjState = OLS_LOADING;
}
void CSLObj :: Load ( ) { if ( GetObjState ( ) != OLS_UNAVAIL && GetObjState ( ) != OLS_COPYING ) return ; if ( ! TriggerCopyAndReplace ( ) ) return ; LOG_MSG ( logDEBUG , DEBUG_OBJ_LOADING , cslKey . c_str ( ) , StripXPSysDir ( path ) . c_str ( ) ) ; XPLMLoadObjectAsync ( path . c_str ( ) , & XPObjLoadedCB , new pairOfStrTy ( cslKey . c_str ( ) , path . c_str ( ) ) ) ; xpObjState = OLS_LOADING ; }
Starts loading the XP object asynchronously
Starts loading the XP object asynchronously
// only if not already requested or even available // If needed it is now the time to copy the .obj file // Prepare to load the CSL model from the .obj file // Based on experience it seems XPLMLoadObjectAsync() does not // properly support HFS file paths. It just replaces all ':' with '/', // which is incomplete. // That's why we store paths to .obj already in POSIX format: // path to .obj // static callback function // _copy_ of the key string