Ejemplo n.º 1
0
Forge::Bias Forge::DetermineMaterialBias(Special special, int material)
{
    // Check the material map for bias
    MaterialMap::const_iterator materialIter(Materials().find(material));
    if (materialIter == Materials().end())
        return Normal;
    
    // Run down the affinity list
    for (size_t i(0); i < materialIter->second.size(); ++i)
    {
        if (materialIter->second[i].special == special)
            return materialIter->second[i].bias;
    }

    return Normal;
}
Ejemplo n.º 2
0
void QtMainWindow::SetupActions()
{
	QtMainWindowHandler *actionHandler = QtMainWindowHandler::Instance();

	//File
	connect(ui->menuFile, SIGNAL(triggered(QAction *)), actionHandler, SLOT(FileMenuTriggered(QAction *)));
	connect(ui->actionNewScene, SIGNAL(triggered()), actionHandler, SLOT(NewScene()));
	connect(ui->actionOpenScene, SIGNAL(triggered()), actionHandler, SLOT(OpenScene()));
	connect(ui->actionOpenProject, SIGNAL(triggered()), actionHandler, SLOT(OpenProject()));
	connect(ui->actionSaveScene, SIGNAL(triggered()), actionHandler, SLOT(SaveScene()));
	connect(ui->actionSaveToFolder, SIGNAL(triggered()), actionHandler, SLOT(SaveToFolderWithChilds()));
    
    ui->actionExportPVRIOS->setData(GPU_POWERVR_IOS);
    ui->actionExportPVRAndroid->setData(GPU_POWERVR_ANDROID);
    ui->actionExportTegra->setData(GPU_TEGRA);
    ui->actionExportMali->setData(GPU_MALI);
    ui->actionExportAdreno->setData(GPU_ADRENO);
    ui->actionExportPNG->setData(GPU_UNKNOWN);
	connect(ui->menuExport, SIGNAL(triggered(QAction *)), actionHandler, SLOT(ExportMenuTriggered(QAction *)));
    
    
	connect(ui->actionReloadAll, SIGNAL(triggered()), actionHandler, SLOT(RepackAndReloadTextures()));

	//View
	connect(ui->actionRestoreViews, SIGNAL(triggered()), actionHandler, SLOT(RestoreViews()));

	//Tools
	connect(ui->actionMaterialEditor, SIGNAL(triggered()), actionHandler, SLOT(Materials()));
	connect(ui->actionTextureConverter, SIGNAL(triggered()), actionHandler, SLOT(ConvertTextures()));
	connect(ui->actionHeightMapEditor, SIGNAL(triggered()), actionHandler, SLOT(HeightmapEditor()));
	connect(ui->actionTileMapEditor, SIGNAL(triggered()), actionHandler, SLOT(TilemapEditor()));
	connect(ui->actionRulerTool, SIGNAL(triggered()), actionHandler, SLOT(RulerTool()));
	connect(ui->actionShowSettings, SIGNAL(triggered()), actionHandler, SLOT(ShowSettings()));
    connect(ui->actionSquareTextures, SIGNAL(triggered()), actionHandler, SLOT(SquareTextures()));
    connect(ui->actionShowMipmapLevel, SIGNAL(triggered()), actionHandler, SLOT(ReplaceZeroMipmaps()));
    
#if defined (__DAVAENGINE_MACOS__)
    ui->menuTools->removeAction(ui->actionBeast);
#else //#if defined (__DAVAENGINE_MACOS__)
	connect(ui->actionBeast, SIGNAL(triggered()), actionHandler, SLOT(Beast()));
#endif //#if defined (__DAVAENGINE_MACOS__)
    
	//Edit
	connect(ui->actionConvertToShadow, SIGNAL(triggered()), actionHandler, SLOT(ConvertToShadow()));
    
	//Temporary hided for development-qa branch
	ui->actionEnableCameraLight->setVisible(false);
    ui->actionEnableCameraLight->setChecked(EditorSettings::Instance()->GetShowEditorCamerLight());
	connect(ui->actionEnableCameraLight, SIGNAL(triggered()), actionHandler, SLOT(CameraLightTrigerred()));

    //Help
    connect(ui->actionHelp, SIGNAL(triggered()), actionHandler, SLOT(OpenHelp()));
}