StaticMesh* StaticMeshLoader::LoadContent(const stl::string &file, const ContentParam *params)
{
    LOG_INFO(LOGCAT_ASSETS, "%s: loading \"%s\"\n",
             GetLoggingTag(),
             file.c_str()
            );

    // load the file data
    File *f = GetContentManager()->GetGameApp()->GetOperatingSystem()->GetFileSystem()->Open(file, FILEMODE_READ | FILEMODE_BINARY);
    StaticMeshFile *meshFile = new StaticMeshFile(f);
    ASSERT(meshFile != NULL);

    // convert it into a mesh object
    StaticMesh *mesh = new StaticMesh(meshFile, GetContentManager());
    SAFE_DELETE(meshFile);

    // done with the file now
    SAFE_DELETE(f);

    return mesh;
}
void ErrorPopUpScreen::LoadContent()
{
    auto screenManager = this->Manager();
    m_backgroundTexture = screenManager->GetContentManager()->LoadTexture(L"Assets\\blank.png");
}
示例#3
0
void GameScene::Setup   (void           )
{
    auto background_texture     = LOAD_TEXTURE(GetContentManager()              ,
                                               L"background"                    ,
                                               L"assets\\game\\platform.png"    );

    // =====

    auto sprite                 = new DNDLayerSprites(L"root", GetRenderer());
    {
        sprite->SetLocked(true);

        auto background = new DNDEntity(L"background", PBSize(800, 480));
        {
            background->SetLocked(true);

            // uh lah?
            background->AddModel(L"default", new DNDModelSprite(background_texture));
        }
        background->Add(sprite);

        auto trainLeft = new DNDNode(L"train_left"      , DNDNodeSizingRule::None, PBSize(150, 480));
        {
            auto entity = trainLeft;
            auto trans  = entity->GetTransform();

            trans.SetLocation(PBPoint2(250, 0));

            entity->SetTransform(trans);

            auto train = new Train(L"train", true);
            {
                auto entity = train;
                auto trans  = entity->GetTransform();

                trans.SetLocation(PBPoint2(75, 0));

                entity->SetTransform(trans);
            }
            train->Add(trainLeft);
        }
        trainLeft->Add(sprite);

        auto trainRight = new DNDNode(L"train_right"    , DNDNodeSizingRule::None, PBSize(150, 480));
        {
            auto entity = trainRight;
            auto trans  = entity->GetTransform();

            trans.SetLocation(PBPoint2(400, 0));

            entity->SetTransform(trans);

            auto train = new Train(L"train", false);
            {
                auto entity = train;
                auto trans  = entity->GetTransform();

                trans.SetLocation(PBPoint2(75, 480));

                entity->SetTransform(trans);
            }
            train->Add(trainRight);
        }
        trainRight->Add(sprite);
    }
    sprite->Add(this);
}