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


C++ ISkin类代码示例

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


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

示例1: title

	GameOptionsMenu::GameOptionsMenu(SMenuConfig* menuConfig) :
		title("Options de la partie", TITLEFONT, 30),
		category(TITLEFONT, 100),		
		cancel("Annuler", 550, CREATEGAMEMENU),
		save("Valider", 550, CREATEGAMEMENU),
		menuConfig(menuConfig)
	{
		ISkin* skin = PolyBomberApp::getISkin();
		
		title.setColor(skin->getColor(TITLECOLOR));

		category.push_back("Bonus de bombe");
		category.push_back("Bonus de personnage");
		category.push_back("Infections");

		cancel.move(-100, 0);
		save.move(100, 0);

		cancel.setSelected(true);
		
		cancel.setNext(&save);			
		save.setNext(&cancel);

		this->widgets.push_back(&title);
		this->widgets.push_back(&category);
		this->widgets.push_back(&cancel);
		this->widgets.push_back(&save);

		initBonus();
	}
开发者ID:Damsolla,项目名称:projetBomberman,代码行数:30,代码来源:GameOptionsMenu.cpp

示例2: validPressed

	void GraphicsConfigMenu::validPressed(EMenuScreen* nextScreen)
	{
		ISkin* skin = PolyBomberApp::getISkin();

		if (cancel.getSelected())
		{
			skin->reloadConfig();
			*nextScreen = cancel.activate();
		}
		
		if (save.getSelected())
		{
			if (window->canFullScreen())
			{
				window->setFullScreen(fullscreen.getCurrentItem());

				IConfigFile* configFile = new ConfigFileManager();

				configFile->setIntValue("window.fullscreen.enabled", fullscreen.getCurrentItem());

				delete configFile;
			}

			skin->saveConfig();							
			*nextScreen = save.activate();
		}
	}
开发者ID:Damsolla,项目名称:projetBomberman,代码行数:27,代码来源:GraphicsConfigMenu.cpp

示例3: initBonus

	void GameOptionsMenu::initBonus()
	{				
		ISkin* skin = PolyBomberApp::getISkin();

		EImage icones[18] = {EIMAGE_BOMBPLUS, EIMAGE_BOMBMOINS, EIMAGE_RANGEPLUS, EIMAGE_RANGEMOINS,
							EIMAGE_RANGEMAX, EIMAGE_MINEBONUS, EIMAGE_INFINITY, EIMAGE_ATOMIC,
							EIMAGE_VITESSEPLUS, EIMAGE_VITESSEMOINS, EIMAGE_BOMBLINE, EIMAGE_REMOTEBONUS,
							EIMAGE_CRANE, EIMAGE_HELL, EIMAGE_CONFUSION,	EIMAGE_SPASME,	EIMAGE_DILATATION,
							EIMAGE_RAGE};
		int i;
		
		for (i=0; i<18; i++)
		{
			int j = i;
			if (i >= 12) j -= 12;
			else if (i >= 8) j -= 8;

			this->images[i] = new ImageWidget();
			this->images[i]->setImage(skin->loadImage(icones[i]));
			this->images[i]->setPosition(300,200+40*j);			
			
			this->bonus[i] = new SelectionWidget(TEXTFONT, 200 + 40*j);
			this->bonus[i]->push_back("0");
			this->bonus[i]->push_back("1");
			this->bonus[i]->push_back("2");
			this->bonus[i]->push_back("3");
			this->bonus[i]->push_back("4");
			this->bonus[i]->push_back("5");
			this->bonus[i]->push_back("6");
			this->bonus[i]->push_back("7");
			this->bonus[i]->push_back("8");
			this->bonus[i]->push_back("9");
			this->bonus[i]->push_back("10");
			this->bonus[i]->setCurrentItem(this->menuConfig->gameConfig.nbBonus[i]);
			this->bonus[i]->move(70, 0);

			if (j > 0)
				this->bonus[i]->setPrevious(this->bonus[i-1]);
			else
				this->bonus[i]->setPrevious(&category);
			
			this->widgets.push_back(this->images[i]);
			this->widgets.push_back(this->bonus[i]);
		}

		for (i=0; i<7; i++)
			this->bonus[i]->setNext(this->bonus[i+1]);

		for (i=8; i<11; i++)
			this->bonus[i]->setNext(this->bonus[i+1]);

		for (i=12; i<17; i++)
			this->bonus[i]->setNext(this->bonus[i+1]);

		this->bonus[7]->setNext(&cancel);						
		this->bonus[11]->setNext(&cancel);						
		this->bonus[17]->setNext(&cancel);

		setCategory();				
	}
开发者ID:Damsolla,项目名称:projetBomberman,代码行数:60,代码来源:GameOptionsMenu.cpp

示例4: GetObjectRef

//// FindSkinModifier ///////////////////////////////////////////////////////
//  Given an INode, gets the ISkin object of that node, or nil if there is
//  none. Taken from the Max4 SDK, ISkin.h
ISkin* plMaxNodeBase::FindSkinModifier()
{
    int modStackIndex;

    // Get object from node. Abort if no object.
    Object *pObj = GetObjectRef();
    if( pObj == nil )
        return nil;

    // Is derived object ?
    while( pObj->SuperClassID() == GEN_DERIVOB_CLASS_ID )
    {
        IDerivedObject *pDerObj = (IDerivedObject *)pObj;

        // Iterate over all entries of the modifier stack.
        for( modStackIndex = 0; modStackIndex < pDerObj->NumModifiers(); modStackIndex++ )
        {
            // Get current modifier.
            Modifier *mod = pDerObj->GetModifier( modStackIndex );

            // Is this Skin ?
            if( mod->ClassID() == SKIN_CLASSID )
            {
                ISkin* skin = (ISkin*)mod->GetInterface(I_SKIN);
                if( skin->GetNumBones() > 0 )
                    return skin;
            }
        }
        pObj = pDerObj->GetObjRef();
    }

    // Not found.
    return nil;
}
开发者ID:cwalther,项目名称:Plasma-nobink-test,代码行数:37,代码来源:plMaxNodeBase.cpp

示例5: run

	EMenuScreen GraphicsConfigMenu::run(MainWindow& window, EMenuScreen previous)
	{
		this->window = &window;

		// Configuration plein ecran
		fullscreen.setCurrentItem(window.getFullScreen());

		if (window.canFullScreen())
		{
			skinList.setPrevious(&fullscreen);
			this->widgets.push_back(&fullscreen);
		}
		else
			this->widgets.push_back(&noFullscreen);

		// Mise à jour du skin
		ISkin* skin = PolyBomberApp::getISkin();
		std::vector<std::string> skins = skin->getSkinsList();
		
		for (unsigned int i=0; i<skins.size(); i++)
		{
			if (skin->getSkin().compare(skins[i]) == 0)
				skinList.setCurrentItem(i);
		}

		return IMenuScreen::run(window, previous);
	}
开发者ID:Damsolla,项目名称:projetBomberman,代码行数:27,代码来源:GraphicsConfigMenu.cpp

示例6: title

	ScoreMenu::ScoreMenu(SMenuConfig* menuConfig) :
		title("Score de la partie", TITLEFONT, 100),
		winner("Le joueur i a gagne !", TEXTFONT, 170),
		back("Retour au menu", 550, MAINMENU),
		menuConfig(menuConfig)
	{
		ISkin* skin = PolyBomberApp::getISkin();

		title.setColor(skin->getColor(TITLECOLOR));
		winner.setColor(skin->getColor(TEXTCOLOR));

		back.setSelected(true);

		this->widgets.push_back(&title);
		this->widgets.push_back(&winner);
		this->widgets.push_back(&back);

		for (int i=0; i<4; i++)
		{
			this->pictures[i] = new ImageWidget();
			this->pictures[i]->setPosition(300, 250 + 60*i);				
			this->pictures[i]->setImage(skin->loadImage((EImage)(PLAYER1 + i)));				

			this->names[i] = new TextWidget("", TEXTFONT, 250 + 60*i);
			this->names[i]->setColor(skin->getColor(TEXTCOLOR));

			this->widgets.push_back(this->pictures[i]);
			this->widgets.push_back(this->names[i]);
		}
	}
开发者ID:Damsolla,项目名称:projetBomberman,代码行数:30,代码来源:ScoreMenu.cpp

示例7: rightPressed

	void GraphicsConfigMenu::rightPressed()
	{
		ISkin* skin = PolyBomberApp::getISkin();
		std::vector<std::string> skins = skin->getSkinsList();

		cancel.goNext();
		fullscreen.goNextItem();
		skinList.goNextItem();
		skin->setSkin(skins[skinList.getCurrentItem()]);
	}
开发者ID:Damsolla,项目名称:projetBomberman,代码行数:10,代码来源:GraphicsConfigMenu.cpp

示例8: isSkinController

	//---------------------------------------------------------------
	bool SkinController::isSkinController( Modifier * modifier )
	{
		Class_ID classId = modifier->ClassID();
		if (classId == SKIN_CLASSID)
		{
			ISkin* skin = (ISkin*) modifier->GetInterface(I_SKIN);
			if ( !skin) 
				return false;
			return skin->GetNumBonesFlat() > 0;
		}
		else 
			return (classId == PHYSIQUE_CLASSID) != false;

		return false;
	}
开发者ID:AsherBond,项目名称:MondocosmOS,代码行数:16,代码来源:COLLADAMaxController.cpp

示例9: title

	ControllersConfigMenu::ControllersConfigMenu() :
		title("Configuration des controleurs", TITLEFONT, 100),
		error("Aucun controleur detecte", TEXTFONT, 200),
		cancel("Retour", 500, CONFIGMENU)
	{
		ISkin* skin = PolyBomberApp::getISkin();	
		title.setColor(skin->getColor(TITLECOLOR));
		error.setColor(skin->getColor(ERRORCOLOR));

		this->widgets.push_back(&title);
		this->widgets.push_back(&error);
		this->widgets.push_back(&cancel);

		error.setVisible(false);

		for (int i=0; i<4; i++)
		{
			std::ostringstream text;
			text << "Joueur " << i+1 << " : ";
			playerText[i] = new TextWidget(text.str(), TEXTFONT, 250 + 50*i);
			playerText[i]->setColor(skin->getColor(TEXTCOLOR));
			playerText[i]->move(-100, 0);

			playerController[i] = new SelectionWidget(LINKFONT, 250 + 50*i);

			playerController[i]->push_back("Gamepad");
			playerController[i]->push_back("Clavier");
			playerController[i]->push_back("Wii");

			playerController[i]->move(100, 0);

			if (i > 0)
				playerController[i]->setPrevious(playerController[i-1]);			

			this->widgets.push_back(playerText[i]);
			this->widgets.push_back(playerController[i]);
		}

		playerController[0]->setNext(playerController[1]);
		playerController[1]->setNext(playerController[2]);
		playerController[2]->setNext(playerController[3]);
		playerController[3]->setNext(&cancel);

		cancel.setPrevious(playerController[3]);
		cancel.setSelected(true);
	}
开发者ID:Damsolla,项目名称:projetBomberman,代码行数:46,代码来源:ControllersConfigMenu.cpp

示例10: title

	WaitingMenu::WaitingMenu(SMenuConfig* menuConfig) :
		title("Resume de la partie", TITLEFONT, 50),
		ip("Adresse IP du serveur : ", TEXTFONT, 150),
		cancel("Annuler", 500, GAMEMENU),
		start("Jouer !", 500, RUNGAME),
		menuConfig(menuConfig)
	{
		ISkin* skin = PolyBomberApp::getISkin();
		
		title.setColor(skin->getColor(TITLECOLOR));
		ip.setColor(skin->getColor(TEXTCOLOR));

		this->network = PolyBomberApp::getINetworkToMenu();
		ip.setString(ip.getString() + this->network->getIpAddress());
		
		ip.move(-80, 0);
		
		cancel.move(-100, 0);
		start.move(100, 0);

		cancel.setSelected(true);
		cancel.setNext(&start);
		start.setNext(&cancel);

		this->widgets.push_back(&title);
		this->widgets.push_back(&ip);
		this->widgets.push_back(&cancel);
		this->widgets.push_back(&start);

		for (int i=0; i<4; i++)
		{
			this->pictures[i] = new ImageWidget();
			this->pictures[i]->setPosition(300, 200 + 60*i);				
			this->pictures[i]->setImage(skin->loadImage((EImage)(PLAYER1 + i)));				

			this->names[i] = new TextWidget("...", TEXTFONT, 210 + 60*i);
			this->names[i]->setColor(skin->getColor(TEXTCOLOR));
			this->names[i]->move(100, 0);

			this->widgets.push_back(this->pictures[i]);
			this->widgets.push_back(this->names[i]);
		}
	}
开发者ID:Damsolla,项目名称:projetBomberman,代码行数:43,代码来源:WaitingMenu.cpp

示例11: ClickableWidget

	InputWidget::InputWidget(ETextFont font, unsigned int y, ETextPosition position, unsigned int width) :
		ClickableWidget(),
		text("", font, 0, LEFT),
		maxLength(10),
		WIDTH(800)
	{
		ISkin* skin = PolyBomberApp::getISkin();
		
		area.setSize(sf::Vector2f(width, 35));
		area.setFillColor(skin->getColor(BGCOLOR));
		area.setOutlineColor(skin->getColor(TEXTCOLOR));
		area.setOutlineThickness(3);

		text.setPosition(5, 5);
		text.setColor(skin->getColor(TEXTCOLOR));

		if (position == RIGHT)
			setPosition(this->WIDTH - width, y);
		else if (position == CENTER)
			setPosition(this->WIDTH/2 - (width)/2, y);
	}
开发者ID:Damsolla,项目名称:projetBomberman,代码行数:21,代码来源:InputWidget.cpp

示例12: title

	SelectSlotsMenu::SelectSlotsMenu(SMenuConfig* menuConfig) :
		title("Creation d'une partie", TITLEFONT, 100),
		error("Pas assez de place sur le serveur", TEXTFONT, 300),
		nbPlayersText("Nombre de joueurs sur cet ordinateur :", TEXTFONT, 250),
		nbPlayers(TEXTFONT, 300),
		cancel("Annuler", 450, GAMEMENU),
		next("Valider", 450, SELECTNAMEMENU),
		menuConfig(menuConfig)
	{
		ISkin* skin = PolyBomberApp::getISkin();
		
		title.setColor(skin->getColor(TITLECOLOR));
		error.setColor(skin->getColor(ERRORCOLOR));
		nbPlayersText.setColor(skin->getColor(TEXTCOLOR));

		cancel.move(-100, 0);
		next.move(100, 0);

		nbPlayers.push_back("1");
		nbPlayers.setCurrentItem(0);

		error.setVisible(false);

		cancel.setSelected(true);

		nbPlayers.setNext(&cancel);
		cancel.setPrevious(&nbPlayers);
		next.setPrevious(&nbPlayers);
		cancel.setNext(&next);
		next.setNext(&cancel);

		this->widgets.push_back(&title);
		this->widgets.push_back(&error);
		this->widgets.push_back(&nbPlayersText);
		this->widgets.push_back(&nbPlayers);
		this->widgets.push_back(&cancel);
		this->widgets.push_back(&next);

		this->network = PolyBomberApp::getINetworkToMenu();
	}
开发者ID:Damsolla,项目名称:projetBomberman,代码行数:40,代码来源:SelectSlotsMenu.cpp

示例13: title

	GraphicsConfigMenu::GraphicsConfigMenu() :
		title("Configuration graphique", TITLEFONT, 100),
		textFullscreen("Mode plein-ecran : ", TEXTFONT, 200),
		fullscreen(TEXTFONT, 200),
		noFullscreen("Indisponible", ERRORFONT, 200),
		skinText("Skin choisi :", TEXTFONT, 300),
		skinList(TEXTFONT, 350),
		cancel("Annuler", 450, CONFIGMENU),
		save("Valider", 450, CONFIGMENU)
	{
		ISkin* skin = PolyBomberApp::getISkin();
		
		title.setColor(skin->getColor(TITLECOLOR));
		skinText.setColor(skin->getColor(TEXTCOLOR));		
		textFullscreen.setColor(skin->getColor(TEXTCOLOR));

		// Mode plein ecran
		textFullscreen.move(-100, 0);

		fullscreen.push_back("non");
		fullscreen.push_back("oui");
		fullscreen.move(100, 0);

		noFullscreen.setColor(skin->getColor(ERRORCOLOR));
		noFullscreen.move(100, 0);

		// Liste des skins
		std::vector<std::string> skins = skin->getSkinsList();		
		for (unsigned int i=0; i<skins.size(); i++)
			skinList.push_back(skins[i]);

		cancel.move(-100, 0);
		save.move(100, 0);

		cancel.setSelected(true);
		
		fullscreen.setNext(&skinList);
		skinList.setNext(&cancel);
		
		cancel.setPrevious(&skinList);
		cancel.setNext(&save);
			
		save.setPrevious(&skinList);
		save.setNext(&cancel);

		this->widgets.push_back(&title);
		this->widgets.push_back(&textFullscreen);
		this->widgets.push_back(&skinText);
		this->widgets.push_back(&skinList);
		this->widgets.push_back(&cancel);
		this->widgets.push_back(&save);

		this->window = NULL;
	}
开发者ID:Damsolla,项目名称:projetBomberman,代码行数:54,代码来源:GraphicsConfigMenu.cpp

示例14: setSelected

	void InputWidget::setSelected(bool selected)
	{
		ISkin* skin = PolyBomberApp::getISkin();
		ClickableWidget::setSelected(selected);

		if (selected)
		{
			area.setFillColor(skin->getColor(SELECTEDBGCOLOR));
			area.setOutlineColor(skin->getColor(SELECTEDCOLOR));
			text.setColor(skin->getColor(SELECTEDCOLOR));
		}
		else
		{
			area.setFillColor(skin->getColor(BGCOLOR));
			area.setOutlineColor(skin->getColor(TEXTCOLOR));
			text.setColor(skin->getColor(TEXTCOLOR));
		}
	}
开发者ID:Damsolla,项目名称:projetBomberman,代码行数:18,代码来源:InputWidget.cpp

示例15: CVertexCandidate


//.........这里部分代码省略.........
        {
            // typecast to rigid vertex
            IPhyRigidVertex *pTypeVertex;
            pTypeVertex = (IPhyRigidVertex *)pVertexExport;

                // add the influence to the vertex candidate
            // get the influencing bone
            if(!AddBoneInfluence(pSkeletonCandidate, pVertexCandidate, pTypeVertex->GetNode(), 1.0f))
            {
                pPhysiqueExport->ReleaseContextInterface(pContextExport);
                m_pModifier->ReleaseInterface(I_PHYINTERFACE, pPhysiqueExport);
                delete pVertexCandidate;
                theExporter.SetLastError("Invalid bone assignment.", __FILE__, __LINE__);
                return 0;
            }
        }
        else if(vertexType == RIGID_BLENDED_TYPE)
        {
            // typecast to blended vertex
            IPhyBlendedRigidVertex *pTypeVertex;
            pTypeVertex = (IPhyBlendedRigidVertex *)pVertexExport;

            // loop through all influencing bones
            int nodeId;
            for(nodeId = 0; nodeId < pTypeVertex->GetNumberNodes(); nodeId++)
            {
                // add the influence to the vertex candidate
                if(!AddBoneInfluence(pSkeletonCandidate, pVertexCandidate, pTypeVertex->GetNode(nodeId), pTypeVertex->GetWeight(nodeId)))
                {
                    pPhysiqueExport->ReleaseContextInterface(pContextExport);
                    m_pModifier->ReleaseInterface(I_PHYINTERFACE, pPhysiqueExport);
                    delete pVertexCandidate;
                    theExporter.SetLastError("Invalid bone assignment.", __FILE__, __LINE__);
                    return 0;
                }
            }
        }

        // release all interfaces
        pPhysiqueExport->ReleaseContextInterface(pContextExport);
        m_pModifier->ReleaseInterface(I_PHYINTERFACE, pPhysiqueExport);
    }
#if MAX_RELEASE >= 4000
    // check for skin modifier
    else if(m_modifierType == MODIFIER_SKIN)
    {
        // create a skin interface
        ISkin *pSkin;
        pSkin = (ISkin*)m_pModifier->GetInterface(I_SKIN);
        if(pSkin == 0)
        {
            delete pVertexCandidate;
            theExporter.SetLastError("Skin modifier interface not found.", __FILE__, __LINE__);
            return 0;
        }

        // create a skin context data interface
        ISkinContextData *pSkinContextData;
        pSkinContextData = (ISkinContextData *)pSkin->GetContextInterface(m_pINode);
        if(pSkinContextData == 0)
        {
            m_pModifier->ReleaseInterface(I_SKIN, pSkin);
            delete pVertexCandidate;
            theExporter.SetLastError("Skin context data interface not found.", __FILE__, __LINE__);
            return 0;
        }

        // loop through all influencing bones
        int nodeId;
        for(nodeId = 0; nodeId < pSkinContextData->GetNumAssignedBones(vertexId); nodeId++)
        {
            // get the bone id
            int boneId;
            boneId = pSkinContextData->GetAssignedBone(vertexId, nodeId);
            if(boneId < 0) continue;

            // add the influence to the vertex candidate
            if(!AddBoneInfluence(pSkeletonCandidate, pVertexCandidate, pSkin->GetBone(boneId), pSkinContextData->GetBoneWeight(vertexId, nodeId)))
            {
                m_pModifier->ReleaseInterface(I_SKIN, pSkin);
                delete pVertexCandidate;
                theExporter.SetLastError("Invalid bone assignment.", __FILE__, __LINE__);
                return 0;
            }
        }

        // release all interfaces
        m_pModifier->ReleaseInterface(I_SKIN, pSkin);
    }
#endif
        else if( m_modifierType == MODIFIER_MORPHER || m_modifierType == MODIFIER_NONE ) {
        }
        else 
    {
          theExporter.SetLastError("No physique/skin/morpher modifier found.", __FILE__, __LINE__);
          return 0;
    }

    return pVertexCandidate;
}
开发者ID:imvu,项目名称:cal3d,代码行数:101,代码来源:MaxMesh.cpp


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