当前位置: 首页>>代码示例>>C++>>正文


C++ utArray类代码示例

本文整理汇总了C++中utArray的典型用法代码示例。如果您正苦于以下问题:C++ utArray类的具体用法?C++ utArray怎么用?C++ utArray使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了utArray类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: finalizeAssemblyLoad

void LSLuaState::finalizeAssemblyLoad(Assembly *assembly, utArray<Type *>& types)
{
    for (UTsize j = 0; j < types.size(); j++)
    {
        Type *type = types.at(j);

        if (type->isNative() || type->hasStaticNativeMember())
        {
            // we're native
            NativeInterface::resolveScriptType(type);
        }
    }

    declareLuaTypes(types);
    initializeLuaTypes(types);

    // we avoid runtime validation on mobile, this works but should be unnecessary
    // as issues with be caught on OSX/WINDOWS development platforms
#if LOOM_PLATFORM == LOOM_PLATFORM_OSX || LOOM_PLATFORM == LOOM_PLATFORM_WIN32
    for (UTsize j = 0; j < types.size(); j++)
    {
        Type            *type = types.at(j);
        TypeValidatorRT tv(this, type);
        tv.validate();
    }
#endif

    assembly->bootstrap();
}
开发者ID:Bewolf2,项目名称:LoomSDK,代码行数:29,代码来源:lsLuaState.cpp

示例2: initializeLuaTypes

void LSLuaState::initializeLuaTypes(const utArray<Type *>& types)
{
    for (UTsize i = 0; i < types.size(); i++)
    {
        types[i]->cache();
    }

    // initialize all classes
    for (UTsize i = 0; i < types.size(); i++)
    {
        initializeClass(types[i]);
    }

    // run static initializers now that all classes have been initialized
    for (UTsize i = 0; i < types.size(); i++)
    {
        lsr_classinitializestatic(VM(), types[i]);
    }
}
开发者ID:Bewolf2,项目名称:LoomSDK,代码行数:19,代码来源:lsLuaState.cpp

示例3: akMeshLoaderUtils_getVertexGroups

void akMeshLoaderUtils_getVertexGroups(Blender::Mesh* bmesh, Blender::Object* bobj, utArray<utString>& vgroups)
{
    if(bmesh->dvert)
    {
        Blender::bDeformGroup* dg = (Blender::bDeformGroup*)bobj->defbase.first;
        while(dg)
        {
            vgroups.push_back(dg->name);
            dg = dg->next;
        }
    }
}
开发者ID:erwincoumans,项目名称:astojilj_animkit,代码行数:12,代码来源:akMeshLoader.cpp

示例4: findMembers

void Type::findMembers(const MemberTypes& memberTypes,
                       utArray<MemberInfo *>& membersOut, bool includeBases, bool includePropertyGetterSetters)
{
    if (!includeBases)
    {
        membersOut.clear();
    }

    for (size_t i = 0; i < members.size(); i++)
    {
        MemberInfo *m = members.at((int)i);

        if (m->isConstructor() && memberTypes.constructor)
        {
            membersOut.push_back(m);
        }

        if (m->isMethod() && memberTypes.method)
        {
            membersOut.push_back(m);
        }

        if (m->isField() && memberTypes.field)
        {
            membersOut.push_back(m);
        }

        if (m->isProperty() && memberTypes.property)
        {
            membersOut.push_back(m);

            if (includePropertyGetterSetters)
            {
                PropertyInfo *p = (PropertyInfo *)m;

                if (p->getter && (p->getter->getDeclaringType() == p->getDeclaringType()))
                {
                    membersOut.push_back(p->getter);
                }

                if (p->setter && (p->setter->getDeclaringType() == p->getDeclaringType()))
                {
                    membersOut.push_back(p->setter);
                }
            }
        }
    }

    if (baseType && includeBases)
    {
        baseType->findMembers(memberTypes, membersOut, true, includePropertyGetterSetters);
    }
}
开发者ID:Ivory27,项目名称:LoomSDK,代码行数:53,代码来源:lsType.cpp

示例5: declareLuaTypes

void LSLuaState::declareLuaTypes(const utArray<Type *>& types)
{
    for (UTsize i = 0; i < types.size(); i++)
    {
        declareClass(types[i]);
    }

    // validate/initialize native types
    for (UTsize i = 0; i < types.size(); i++)
    {
        Type *type = types.at(i);

        if (type->isNative() || type->hasStaticNativeMember())
        {
            NativeTypeBase *ntb = NativeInterface::getNativeType(type);

            if (!ntb)
            {
                LSError("Unable to get NativeTypeBase for type %s", type->getFullName().c_str());
            }

            if (type->isNativeManaged() != ntb->isManaged())
            {
                if (type->isNativeManaged())
                {
                    LSError("Managed mismatch for type %s, script declaration specifies native while native bindings are unmanaged", type->getFullName().c_str());
                }
                else
                {
                    LSError("Managed mismatch for type %s, script declaration specifies unmanaged while native bindings are managed", type->getFullName().c_str());
                }
            }

            ntb->validate(type);
            type->setCTypeName(ntb->getCTypeName());
        }
    }
}
开发者ID:Bewolf2,项目名称:LoomSDK,代码行数:38,代码来源:lsLuaState.cpp

示例6: akMeshLoaderUtils_getSmoothFaces

void akMeshLoaderUtils_getSmoothFaces(Blender::Mesh* bmesh, utArray<utArray<UTuint32> >& faces)
{
    faces.resize(bmesh->totvert);
    for (int i = 0; i< bmesh->totvert; i++)
    {
        for (int j = 0; j< bmesh->totface; j++)
        {
            const Blender::MFace& bface = bmesh->mface[j];
            if( (bface.flag & ME_SMOOTH) &&
                    (bface.v1 == i ||
                     bface.v2 == i ||
                     bface.v3 == i ||
                     bface.v4 == i ))
            {
                faces[i].push_back(j);
            }
        }
    }
}
开发者ID:erwincoumans,项目名称:astojilj_animkit,代码行数:19,代码来源:akMeshLoader.cpp

示例7: postAllFiles

/**
 * Post all known files to all clients, or if specified, a single client.
 *
 * Useful for fully synching client with the current asset state.
 *
 * TODO: Optimize to use hashes to only transmit modified data, based on
 * client's starting assets.
 */
static void postAllFiles(int clientId = -1)
{
    lmLog(gAssetAgentLogGroup, "Queueing all files for client %d.", clientId);

    loom_mutex_lock(gFileScannerLock);

    // Walk all the files.
    utArray<FileEntry> *list = lmNew(NULL) utArray<FileEntry>();
    platform_walkFiles(".", handleFileStateWalkCallback, list);

    // Queue them all to be sent.
    for (UTsize i = 0; i < list->size(); i++)
    {
        FileModificationNote note;
        note.path          = stringtable_insert((*list)[i].path.c_str());
        note.lastSeenTime  = 0;
        note.onlyForClient = clientId;
        gPendingModifications.push_back(note);
    }

    loom_mutex_unlock(gFileScannerLock);
}
开发者ID:Y-way,项目名称:LoomSDK,代码行数:30,代码来源:main.cpp

示例8: akMeshLoaderUtils_getShapeKeysNormals

void akMeshLoaderUtils_getShapeKeysNormals(Blender::Mesh* bmesh, UTuint32 numshape, utArray<btAlignedObjectArray<akVector3> >& shapenormals)
{
    Blender::Key* bk = bmesh->key;
    if(bk)
    {

        shapenormals.resize(numshape);
        Blender::KeyBlock* bkb = (Blender::KeyBlock*)bk->block.first;

        // skip first shape key (basis)
        UTuint32 shape=0;
        if(bkb) bkb = bkb->next;
        while(bkb)
        {
            if(bkb->type == KEY_RELATIVE)
            {
                Blender::KeyBlock* basis = (Blender::KeyBlock*)bk->block.first;
                for(int i=0; basis && i<bkb->relative; i++)
                    basis = basis->next;

                if(basis)
                {
                    float* pos = (float*)bkb->data;
                    shapenormals[shape].resize(bmesh->totface);
                    for(int i=0; i<bmesh->totface; i++)
                    {
                        const Blender::MFace& bface = bmesh->mface[i];
                        akVector3 normal = akMeshLoaderUtils_calcMorphNormal(bface, pos);
                        shapenormals[shape][i]=normal;
                    }
                    shape++;
                }
            }
            bkb = bkb->next;
        }
    }
}
开发者ID:erwincoumans,项目名称:astojilj_animkit,代码行数:37,代码来源:akMeshLoader.cpp

示例9: akMeshLoaderUtils_getShapeKeys

void akMeshLoaderUtils_getShapeKeys(Blender::Mesh* bmesh, utArray<utString>& shapes)
{
    Blender::Key* bk = bmesh->key;
    if(bk)
    {
        Blender::KeyBlock* bkb = (Blender::KeyBlock*)bk->block.first;

        // skip first shape key (basis)
        if(bkb) bkb = bkb->next;
        while(bkb)
        {
            if(bkb->type == KEY_RELATIVE)
            {
                Blender::KeyBlock* basis = (Blender::KeyBlock*)bk->block.first;
                for(int i=0; basis && i<bkb->relative; i++)
                    basis = basis->next;

                if(basis)
                    shapes.push_back(bkb->name);
            }
            bkb = bkb->next;
        }
    }
}
开发者ID:erwincoumans,项目名称:astojilj_animkit,代码行数:24,代码来源:akMeshLoader.cpp

示例10: assetAgent_command

void DLLEXPORT assetAgent_command(const char *cmd)
{
    if (strstr(cmd, ".sendall") != 0)
    {
        postAllFiles();
    }
    else if (strstr(cmd, ".clients") != 0)
    {
        listClients();
    }
    else if (strstr(cmd, ".telemetry") != 0)
    {
        TelemetryServer::isRunning() ? TelemetryServer::stop() : TelemetryServer::start();
        assetAgent_command(TelemetryServer::isRunning() ? "telemetryEnable" : "telemetryDisable");
    }
    else if (cmd[0] != 0)
    {
        loom_mutex_lock(gActiveSocketsMutex);

        if (gActiveHandlers.size() == 0)
        {
            if (strcmp(cmd, "terminate") != 0) sendIgnoredError();
        }

        for (UTsize i = 0; i < gActiveHandlers.size(); i++)
        {
            gActiveHandlers[i]->sendCommand(cmd);
        }

        loom_mutex_unlock(gActiveSocketsMutex);
    }
}
开发者ID:Y-way,项目名称:LoomSDK,代码行数:32,代码来源:main.cpp

示例11: loom_asset_pump

void loom_asset_pump()
{
   // Currently we only want to do this on the main thread so piggy back on the
   // native delegate sanity check to bail if on secondary thread.
   if(platform_getCurrentThreadId() != LS::NativeDelegate::smMainThreadID && LS::NativeDelegate::smMainThreadID != 0xBAADF00D)
      return;

   loom_mutex_lock(gAssetLock);

   // Talk to the asset server.
   loom_asset_serviceServer();

   // For now just blast all the data from each file into the asset.
   while(gAssetLoadQueue.size())
   {
      loom_asset_t *asset = gAssetLoadQueue.front();

      // Figure out the type from the path.
      utString path = asset->name;
      int type = loom_asset_recognizeAssetTypeFromPath(path);
      
      if(type == 0)
      {
         lmLog(gAssetLogGroup, "Could not infer type of resource '%s', skipping it...", path.c_str());
         asset->state = loom_asset_t::Unloaded;
         gAssetLoadQueue.erase((UTsize)0, true);
         continue;
      }

      // Open the file.
      void *ptr;
      long size;
      if(!platform_mapFile(asset->name.c_str(), &ptr, &size))
      {
         lmAssert(false, "Could not open file '%s'.", asset->name.c_str());
      }

      // Deserialize it.
      LoomAssetCleanupCallback dtor = NULL;
      void *assetBits = loom_asset_deserializeAsset(path, type, size, ptr, &dtor);

      // Close the file.
      platform_unmapFile(ptr);

      // Instate the asset.
      asset->instate(type, assetBits, dtor);

      // Done! Update queue.
      gAssetLoadQueue.erase((UTsize)0, true);
   }

   loom_mutex_unlock(gAssetLock);
}
开发者ID:Bewolf2,项目名称:LoomSDK,代码行数:53,代码来源:assets.cpp

示例12: loom_asset_registerType

void loom_asset_registerType(unsigned int type, LoomAssetDeserializeCallback deserializer, LoomAssetRecognizerCallback recognizer)
{
    lmAssert(gAssetDeserializerMap.find(type) == UT_NPOS, "Asset type already registered!");

    gAssetDeserializerMap.insert(type, deserializer);
    gRecognizerList.push_back(recognizer);
}
开发者ID:RichardRanft,项目名称:LoomSDK,代码行数:7,代码来源:assets.cpp

示例13: loom_asset_initialize

void loom_asset_initialize(const char *rootUri)
{
    // Set up the lock for the mutex.
    lmAssert(gAssetLock == NULL, "Double initialization!");
    gAssetLock = loom_mutex_create();

    // Note the CWD.
    char tmpBuff[1024];
    platform_getCurrentWorkingDir(tmpBuff, 1024);
    lmLog(gAssetLogGroup, "Current working directory ='%s'", tmpBuff);

    // And the allocator.
    //gAssetAllocator = loom_allocator_initializeTrackerProxyAllocator(loom_allocator_getGlobalHeap());
    gAssetAllocator = (loom_allocator_getGlobalHeap());

    // Clear, it might have been filled up before (for unit tests)
    gAssetLoadQueue.clear();
    gAssetHash.clear();

    // Asset server connection state.
    gAssetServerSocketLock = loom_mutex_create();

    // And set up some default asset types.
    loom_asset_registerType(LATText, loom_asset_textDeserializer, loom_asset_textRecognizer);
    loom_asset_registerType(LATBinary, loom_asset_binaryDeserializer, loom_asset_binaryRecognizer);

    loom_asset_registerImageAsset();
    loom_asset_registerSoundAsset();
    loom_asset_registerScriptAsset();

    // Listen to log and send it if we have a connection.
    loom_log_addListener(loom_asset_logListener, NULL);
}
开发者ID:RichardRanft,项目名称:LoomSDK,代码行数:33,代码来源:assets.cpp

示例14: loom_asset_reload

void loom_asset_reload(const char *name)
{
    loom_mutex_lock(gAssetLock);

    loom_asset_t *asset = loom_asset_getAssetByName(name, 1);

    // Put it in the queue, this will trigger a new blob to be loaded.
    gAssetLoadQueue.push_back(asset);

    loom_mutex_unlock(gAssetLock);
}
开发者ID:RichardRanft,项目名称:LoomSDK,代码行数:11,代码来源:assets.cpp

示例15: loom_asset_shutdown

void loom_asset_shutdown()
{
    loom_asset_flushAll();

    // Clear out our queues and maps.
    gAssetDeserializerMap.clear();
    gRecognizerList.clear();

    lmAssert(gAssetLock != NULL, "Shutdown without being initialized!");
    loom_mutex_destroy(gAssetLock);
    gAssetLock = NULL;
}
开发者ID:Bewolf2,项目名称:LoomSDK,代码行数:12,代码来源:assets.cpp


注:本文中的utArray类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。