本文整理汇总了C++中INSTANCE函数的典型用法代码示例。如果您正苦于以下问题:C++ INSTANCE函数的具体用法?C++ INSTANCE怎么用?C++ INSTANCE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了INSTANCE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LM35_ioctl
/*---------------------------------------------------------------------------------------------------------*/
uint8_t LM35_ioctl( void * const aHandle ,const uint8_t aIoctl_num
, void * aIoctl_param1 , void * aIoctl_param2)
{
switch(aIoctl_num)
{
#if LM35_CONFIG_NUM_OF_DYNAMIC_INSTANCES > 0
case IOCTL_GET_PARAMS_ARRAY_FUNC :
*(const dev_param_t**)aIoctl_param1 = LM35_Dev_Params;
*(uint8_t*)aIoctl_param2 = sizeof(LM35_Dev_Params)/sizeof(dev_param_t); //size
break;
case IOCTL_LM35_SET_SERVER_DEVICE :
INSTANCE(aHandle)->adc_server_device = DEV_OPEN((uint8_t*)aIoctl_param1);
break;
#endif
case IOCTL_LM35_GET_CURRENT_TEMPERATURE_mC :
if(NULL != INSTANCE(aHandle)->adc_server_device)
{
DEV_IOCTL(INSTANCE(aHandle)->adc_server_device , IOCTL_ADC_GET_CURRENT_VALUE_mV , aIoctl_param1);
*(uint32_t*)aIoctl_param1 = (*(uint32_t*)aIoctl_param1)*100;
}
break;
case IOCTL_DEVICE_START :
break;
default :
return 1;
}
return 0;
}
示例2: INSTANCE
void GameSet::btn2Handler()
{
INSTANCE(HelpFacade)->open(INSTANCE(UserData)->getCurrentSceneId());
if(INSTANCE(GuideManager)->getIsGuiding() && INSTANCE(GuideManager)->getCurrentStep() == GuideStep_10011){
INSTANCE(GuideManager)->goToNext();
}
}
示例3: INSTANCE
void GamePauseState::InjectKeyDown( const OIS::KeyEvent& evt )
{
if (evt.key==OIS::KC_ESCAPE)
{
INSTANCE(GameStateManager)->ChangeGameState(GameState::GAME_PLAY_STATE);
INSTANCE(AudioManager)->soundMgr->playAudio(AudioName::SOUND_MENU_PREVIOUS_SCREEN,false);
}
}
示例4: INSTANCE
void BossLottery::rotateComplete()
{
btn->setEnabled(true);
closeBtn->setEnabled(true);
INSTANCE(BossAvatarFacade)->showBossMultiple(INSTANCE(FightManager)->getCurrentBossId());
if(result > 1){
INSTANCE(SceneManager)->addToCurrentScene(BossLotteryNotice::create(result), zOrder_notice);
}
}
示例5: INSTANCE
bool FightManager::enoughAnger()
{
if (currentAnger >= getRole()->getSkillCost())
{
int skillNum = INSTANCE(UserData)->getSkillNum();
INSTANCE(UserData)->setSkillNum(skillNum + 1);
return true;
}
return false;
}
示例6: echoInstanceSet
void
echoInstanceSet(echoObject *inst,
echoPos_t *M, echoObject *obj) {
if (inst && echoTypeInstance == inst->type) {
ell_4m_INV(INSTANCE(inst)->Mi, M);
ELL_4M_COPY(INSTANCE(inst)->M, M);
INSTANCE(inst)->obj = obj;
}
}
示例7: INSTANCE
void GuideManager::addExitBtn()
{
if(exitBtn == NULL){
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("common/common.plist");
exitBtn = INSTANCE(ButtonUtils)->createButton("common_redBtn_1.png", CCSizeMake(140, 50), "退出引导");
INSTANCE(SceneManager)->addToCurrentScene(exitBtn, zOrder_ui);
exitBtn->setPosition(ccp(winSize.width - 200, 600));
exitBtn->addTargetWithActionForControlEvents(this, cccontrol_selector(GuideManager::exitGuide), CCControlEventTouchUpInside);
}
}
示例8: AddTime
//Джх╬╤сап
void DisplayManager::AddTime(Real deltaTime)
{
lifetText->msg->setCaption("Life: "+ConvertToString(INSTANCE(PlayerManager)->lifeNum));
bombText->msg->setCaption("Bomb: "+ConvertToString(INSTANCE(PlayerManager)->bombNum));
scoreText->msg->setCaption("Score: "+ConvertToString(INSTANCE(ScoreManager)->displayScore));
lifetText->node->setVisible(true);
bombText->node->setVisible(true);
scoreText->node->setVisible(true);
}
示例9: setPosition
void GameSet::onEnter()
{
ADD_TOUCH;
CCLayer::onEnter();
setPosition(INSTANCE(GameUtils)->getWindowsCenterPosition());
if(wikiBtn){
INSTANCE(GuideManager)->registerPosition(GuideStep_10011, ccpAdd(wikiBtn->getParent()->convertToWorldSpace(wikiBtn->getPosition()), ccp(0, -20)));
}
}
示例10: CCLOG
void Java_com_duomai_threekingdoms_JniManager_JniCallC
(JNIEnv *env, jobject obj, jstring jstr)
{
string result = JniHelper::jstring2string(jstr);
CCLOG("jni-c++函数执行完毕:%s",result.c_str());
if(result == "rechargeVerification"){
INSTANCE(RechargeManager)->rechargeVerification();
}else if(result == "noticeExitGame"){
INSTANCE(MessageBoxFacade)->showMessageBox("是否退出游戏", INSTANCE(NoticeBoxFacade),callfunc_selector(NoticeBoxFacade::exitGame));
}
return;
}
示例11: INSTANCE
void PlayMenuState::InjectButtonPressed( const OIS::JoyStickEvent &arg, int button )
{
if (button==7)
{
INSTANCE(PlayerManager)->ResetController();
INSTANCE(GameStateManager)->menuState=MenuState::PAUSE_MENU_STATE;
INSTANCE(AudioManager)->soundMgr->playAudio(AudioName::SOUND_MENU_PREVIOUS_SCREEN,true);
sceneMgr->setAmbientLight(ColourValue(0.1, 0.1, 0.1));
}
INSTANCE(PlayerManager)->InjectButtonPressed(arg,button);
levelManager->InjectButtonPressed(arg,button);
}
示例12: sw_uart_wrapper_pwrite
/*---------------------------------------------------------------------------------------------------------*/
size_t sw_uart_wrapper_pwrite(const void *aHandle ,const uint8_t *apData , size_t aLength, size_t aOffset)
{
tx_int_size_t dataLen= (tx_int_size_t)aLength;
tx_int_size_t curr_transmit_len;
if(INSTANCE(aHandle)->use_task_for_out)
{
xMessage_t xMessage;
uint8_t *pSendData;
os_queue_t xQueue = INSTANCE(aHandle)->xQueue;
if(NULL == xQueue) return 1;
while(dataLen)
{
curr_transmit_len = dataLen;
if ( SW_UART_WRAPPER_CONFIG_MAX_TX_BUFFER_SIZE < curr_transmit_len )
{
curr_transmit_len=SW_UART_WRAPPER_CONFIG_MAX_TX_BUFFER_SIZE;
}
#ifdef SW_UART_WRAPPER_CONFIG_USE_MALLOC
xMessage.pData=(uint8_t*)malloc(curr_transmit_len * sizeof(uint8_t));
#endif
pSendData=xMessage.pData;
memcpy(pSendData,(uint8_t*)apData,curr_transmit_len);
xMessage.len=curr_transmit_len;
if(OS_QUEUE_SEND_SUCCESS != os_queue_send_infinite_wait( xQueue, ( void * ) &xMessage ))
{
#ifdef SW_UART_WRAPPER_CONFIG_USE_MALLOC
free(pSendData);
#endif
return 0;
}
dataLen-=curr_transmit_len;
apData += curr_transmit_len;
}
}
else
{
sw_uart_send_and_wait_for_end(INSTANCE(aHandle), busy_delay,apData,dataLen);
}
return aLength;
}
示例13: close
void GameSet::btn1Handler()
{
close();
if(INSTANCE(FightManager)->getIsFighting()){
INSTANCE(FightManager)->startGuide();
}else{
INSTANCE(GuideManager)->setIsGuiding(true);
INSTANCE(UserData)->setCurrentSceneId(40001);
INSTANCE(FightSceneFacade)->openFightScene();
}
}
示例14: switch
void ModeMenuState::InjectKeyDown( const OIS::KeyEvent& evt )
{
switch(evt.key)
{
case OIS::KC_W:
case OIS::KC_UP:
if (menuIndex>0)
{
menuIndex--;
INSTANCE(AudioManager)->soundMgr->playAudio(AudioName::SOUND_MENU_MOVE,true);
}
break;
case OIS::KC_S:
case OIS::KC_DOWN:
if (menuIndex<menuCount-1)
{
menuIndex++;
INSTANCE(AudioManager)->soundMgr->playAudio(AudioName::SOUND_MENU_MOVE,true);
}
break;
case OIS::KC_RETURN:
if (menuArray[menuIndex].tag==GameMode::BOSSRUSH_MODE)
{
INSTANCE(AudioManager)->soundMgr->playAudio(AudioName::SOUND_MENU_INVALID_SELECTION_OR_ACTI,true);
}
else if (menuArray[menuIndex].tag==GameMode::RANK)
{
Removed();
INSTANCE(AudioManager)->soundMgr->playAudio(AudioName::SOUND_NEW_LINE_SHOWN,true);
INSTANCE(GameStateManager)->menuState=MenuState::RANK_MENU_STATE;
}
else
{
Removed();//IMPORTANT: remove must before enter game.
INSTANCE(AudioManager)->bgmMgr->stopAudio(AudioName::BGM_ORCHESTRAL_MENU);
INSTANCE(AudioManager)->soundMgr->playAudio(AudioName::SOUND_MENUSTART,true);
INSTANCE(GameStateManager)->ChangeGameState(GameState::GAME_PLAY_STATE,MenuState::PLAY_MENU_STATE,menuArray[menuIndex].tag);
}
break;
case OIS::KC_ESCAPE:
INSTANCE(GameStateManager)->menuState=MenuState::TITLE_MENU_STATE;
INSTANCE(AudioManager)->soundMgr->playAudio(AudioName::SOUND_MENU_PREVIOUS_SCREEN,false);
Removed();
default:
break;
}
}
示例15: addChild
void BossLottery::initContent()
{
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("ui/fightUI/bossLottery.plist");
circle = CCSprite::createWithSpriteFrameName("bossLottery_bg.png");
addChild(circle);
btn = INSTANCE(ButtonUtils)->createButton("bossLottery_btn.png", CCSizeMake(157, 207), "");
btn->setAnchorPoint(ccp(0.51, 0.37));
addChild(btn);
btn->setZoomOnTouchDown(false);
btn->addTargetWithActionForControlEvents(this, cccontrol_selector(BossLottery::btnHandler), CCControlEventTouchUpInside);
CCPoint cP = circle->getAnchorPointInPoints();
for(int i=0;i<36;i++){
BossLotteryLight *light = BossLotteryLight::create();
circle->addChild(light);
float t = i*10*3.14f/180;
light->setPosition(ccpAdd(cP,ccp(200.0f * sin(t), 200.0f * cos(t))));
array->addObject(light);
}
lightFlag = 0;
getScheduler()->scheduleSelector(schedule_selector(BossLottery::updateLight), this, 0.1f, false);
CCLabelTTF *desc = CCLabelTTF::create();
desc->setFontSize(24);
desc->setString("击杀将领");
btn->addChild(desc);
desc->setColor(ccYELLOW);
desc->setPosition(ccpAdd(btn->getAnchorPointInPoints(), ccp(0, 33)));
costLabel = CCLabelTTF::create();
costLabel->setFontSize(24);
costLabel->setColor(ccGREEN);
btn->addChild(costLabel);
costLabel->setPosition(ccpAdd(btn->getAnchorPointInPoints(), ccp(0, -34)));
costLabel->setString("首次免费");
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("common/common.plist");
closeBtn = INSTANCE(ButtonUtils)->createButton("common_redBtn_1.png", "common_redBtn_2.png", "common_redBtn_1.png", CCSizeMake(151, 48), "关闭",24,ccYELLOW);
addChild(closeBtn);
closeBtn->setPosition(ccp(0, -190));
closeBtn->addTargetWithActionForControlEvents(this, cccontrol_selector(BossLottery::close), CCControlEventTouchUpInside);
times = 1;
}