示例#1
0
文件: main.cpp 项目: AramKS/Mif39
void OnReceiveWorldCell ( SharedResourcePtr resource )
{
    std::cout << "WorldCell::" << resource->getName().toStdString() << std::endl;
    Assets::WorldCellPtr cell = resource.dynamicCast<Assets::WorldCell> ();
    for ( int i = 0 ; i < cell->getSize < QUuid > ( "GameObjects" ) ; i ++ ) {
        fetchResource ( cell->get < QUuid > ( "GameObjects", i ) );
    }
}
示例#2
0
文件: main.cpp 项目: AramKS/Mif39
void OnReceiveWorld ( SharedResourcePtr resource )
{
    std::cout << "World::" << resource->getName().toStdString() << std::endl;
    Assets::WorldPtr world = resource.dynamicCast<Assets::World> ();
    for ( int i = 0 ; i < world->getSize < QUuid > ( "Cells" ) ; i ++ ) {
        fetchResource ( world->get < QUuid > ( "Cells", i ) );
    }
}
示例#3
0
文件: main.cpp 项目: AramKS/Mif39
void OnReceiveMesh ( SharedResourcePtr resource )
{
    std::cout << "Mesh::" << resource->getName().toStdString() << std::endl;
    Assets::MeshPtr mesh = resource.dynamicCast<Assets::Mesh> ();
    for ( unsigned int i = 0 ; i < mesh->getSize < Assets::MaterialGroup* > ( "MaterialGroups" ) ; i ++ ) {
        Assets::MaterialGroup* grp = mesh->get < Assets::MaterialGroup* > ( "MaterialGroups", i );
        fetchResource ( grp->get < QUuid > ( "Material" ) );
    }
}
示例#4
0
文件: main.cpp 项目: AramKS/Mif39
void OnReceiveGameEntity ( SharedResourcePtr resource )
{
    std::cout << "GameEntity::" << resource->getName().toStdString() << std::endl;
    Assets::GameEntityPtr ge = resource.dynamicCast<Assets::GameEntity> ();
    for ( int i = 0 ; i < ge->getSize < Assets::GameEntityElement* > ( "Elements" ) ; i ++ ) {
        Assets::GameEntityElement* elt = ge->get < Assets::GameEntityElement* > ( "Elements", i );
        for ( int j = 0 ; j < elt->getSize < QUuid > ( "Resources" ) ; j ++ ) {
            fetchResource ( elt->get < QUuid > ( "Resources", j ) );
        }
    }
}
示例#5
0
文件: main.cpp 项目: AramKS/Mif39
void OnReceiveWavefrontMaterial ( SharedResourcePtr resource )
{
    QUuid fake;
    std::cout << "WavefrontMaterial::" << resource->getName().toStdString() << std::endl;
    Assets::MaterialPtr material = resource.dynamicCast<WavefrontMaterial> ();
    if ( fake != material->get < Texture > ( "AmbientMap" ).imageID )
        fetchResource ( material->get < Texture > ( "AmbientMap" ).imageID );
    if ( fake != material->get < Texture > ( "DiffuseMap" ).imageID )
        fetchResource ( material->get < Texture > ( "DiffuseMap" ).imageID );
    if ( fake != material->get < Texture > ( "SpecularMap" ).imageID )
        fetchResource ( material->get < Texture > ( "SpecularMap" ).imageID );
    if ( fake != material->get < Texture > ( "SpecularExponentMap" ).imageID )
        fetchResource ( material->get < Texture > ( "SpecularExponentMap" ).imageID );
    if ( fake != material->get < Texture > ( "DissolveMap" ).imageID )
        fetchResource ( material->get < Texture > ( "DissolveMap" ).imageID );
    if ( fake != material->get < Texture > ( "DecalMap" ).imageID )
        fetchResource ( material->get < Texture > ( "DecalMap" ).imageID );
    if ( fake != material->get < Texture > ( "DisplacementMap" ).imageID )
        fetchResource ( material->get < Texture > ( "DisplacementMap" ).imageID );
    if ( fake != material->get < Texture > ( "BumpMap" ).imageID )
        fetchResource ( material->get < Texture > ( "BumpMap" ).imageID );
    if ( fake != material->get < Texture > ( "ReflectionMap" ).imageID )
        fetchResource ( material->get < Texture > ( "ReflectionMap" ).imageID );
}
示例#6
0
文件: main.cpp 项目: AramKS/Mif39
void OnReceiveLight ( SharedResourcePtr resource )
{
    std::cout << "Light::" << resource->getName().toStdString() << std::endl;
    Assets::LightPtr light = resource.dynamicCast<Assets::Light> ();
}
示例#7
0
文件: main.cpp 项目: AramKS/Mif39
void OnReceiveGameObject ( SharedResourcePtr resource )
{
    std::cout << "GameObject::" << resource->getName().toStdString() << std::endl;
    Assets::GameObjectPtr go = resource.dynamicCast<Assets::GameObject> ();
    fetchResource ( go->get < QUuid > ( "Entity" ) );
}
示例#8
0
文件: main.cpp 项目: AramKS/Mif39
void OnReceiveImage ( SharedResourcePtr resource )
{
    std::cout << "Image::" << resource->getName().toStdString() << std::endl;
    Assets::ImagePtr image = resource.dynamicCast<Assets::Image> ();
}