本文整理汇总了C++中INSTANCE函数的典型用法代码示例。如果您正苦于以下问题:C++ INSTANCE函数的具体用法?C++ INSTANCE怎么用?C++ INSTANCE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了INSTANCE函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:AndrewZamansky,项目名称:uCProjects,代码行数:31,代码来源:LM35.c
示例2: INSTANCE
void GameSet::btn2Handler()
{
INSTANCE(HelpFacade)->open(INSTANCE(UserData)->getCurrentSceneId());
if(INSTANCE(GuideManager)->getIsGuiding() && INSTANCE(GuideManager)->getCurrentStep() == GuideStep_10011){
INSTANCE(GuideManager)->goToNext();
}
}
开发者ID:qokelate,项目名称:ThreeKingDoms,代码行数:7,代码来源:GameSet.cpp
示例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);
}
}
开发者ID:yibojiang,项目名称:SuperStardust,代码行数:8,代码来源:GamePauseState.cpp
示例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);
}
}
开发者ID:qokelate,项目名称:ThreeKingDoms,代码行数:9,代码来源:BossLottery.cpp
示例5: INSTANCE
bool FightManager::enoughAnger()
{
if (currentAnger >= getRole()->getSkillCost())
{
int skillNum = INSTANCE(UserData)->getSkillNum();
INSTANCE(UserData)->setSkillNum(skillNum + 1);
return true;
}
return false;
}
开发者ID:qq125384977,项目名称:ThreeKingdoms,代码行数:10,代码来源:FightManager.cpp
示例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;
}
}
开发者ID:BRAINSia,项目名称:teem,代码行数:10,代码来源:set.c
示例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);
}
}
开发者ID:qokelate,项目名称:ThreeKingDoms,代码行数:11,代码来源:GuideManager.cpp
示例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);
}
开发者ID:yibojiang,项目名称:SuperStardust,代码行数:12,代码来源:DisplayManager.cpp
示例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)));
}
}
开发者ID:qokelate,项目名称:ThreeKingDoms,代码行数:11,代码来源:GameSet.cpp
示例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;
}
开发者ID:qokelate,项目名称:ThreeKingDoms,代码行数:12,代码来源:JniManager.cpp
示例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);
}
开发者ID:yibojiang,项目名称:SuperStardust,代码行数:12,代码来源:PlayMenuState.cpp
示例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;
}
开发者ID:AndrewZamansky,项目名称:uCProjects,代码行数:53,代码来源:sw_uart_wrapper.c
示例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();
}
}
开发者ID:qokelate,项目名称:ThreeKingDoms,代码行数:13,代码来源:GameSet.cpp
示例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;
}
}
开发者ID:yibojiang,项目名称:SuperStardust,代码行数:49,代码来源:ModeMenuState.cpp
示例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;
}
开发者ID:qokelate,项目名称:ThreeKingDoms,代码行数:48,代码来源:BossLottery.cpp
示例16: print_path_exists
void print_path_exists(yajl_gen json_gen, char *buffer, const char *title, const char *path, const char *format) {
const char *walk;
char *outwalk = buffer;
struct stat st;
const bool exists = (stat(path, &st) == 0);
INSTANCE(path);
START_COLOR((exists ? "color_good" : "color_bad"));
for (walk = format; *walk != '\0'; walk++) {
if (*walk != '%') {
*(outwalk++) = *walk;
continue;
}
if (strncmp(walk+1, "title", strlen("title")) == 0) {
outwalk += sprintf(outwalk, "%s", title);
walk += strlen("title");
} else if (strncmp(walk+1, "status", strlen("status")) == 0) {
outwalk += sprintf(outwalk, "%s", (exists ? "yes" : "no"));
walk += strlen("status");
}
}
END_COLOR;
OUTPUT_FULL_TEXT(buffer);
}
开发者ID:Yuhta,项目名称:i3status,代码行数:28,代码来源:print_path_exists.c
示例17: print_eth_info
/*
* Combines ethernet IP addresses and speed (if requested) for displaying
*
*/
void print_eth_info(yajl_gen json_gen, char *buffer, const char *interface, const char *format_up, const char *format_down) {
const char *walk;
const char *ip_address = get_ip_addr(interface);
char *outwalk = buffer;
INSTANCE(interface);
if (ip_address == NULL) {
START_COLOR("color_bad");
outwalk += sprintf(outwalk, "%s", format_down);
goto out;
}
START_COLOR("color_good");
for (walk = format_up; *walk != '\0'; walk++) {
if (*walk != '%') {
*(outwalk++) = *walk;
continue;
}
if (strncmp(walk+1, "ip", strlen("ip")) == 0) {
outwalk += sprintf(outwalk, "%s", ip_address);
walk += strlen("ip");
} else if (strncmp(walk+1, "speed", strlen("speed")) == 0) {
outwalk += print_eth_speed(outwalk, interface);
walk += strlen("speed");
}
}
out:
END_COLOR;
OUTPUT_FULL_TEXT(buffer);
}
开发者ID:Yuhta,项目名称:i3status,代码行数:38,代码来源:print_eth_info.c
示例18: INSTANCE
void ComboManager::showCombo(int currentMultiple)
{
if(layer == NULL){
layer = ComboLayer::create();
INSTANCE(SceneManager)->addToCurrentScene(layer, zOrder_notice);
comboLabel = CCLabelBMFont::create("combo", "font/font_combo.fnt");
// comboLabel->setVisible(false);
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
comboLabel->setPosition(ccp(winSize.width/2 - 240, 140));
layer->addChild(comboLabel);
}
currentCombo++;
// if(currentCombo == 1){
// comboLabel->setVisible(false);
// }else{
// comboLabel->setVisible(true);
// }
comboLabel->setOpacity(255);
comboLabel->setString(CCString::createWithFormat("%d combo(%d)",currentCombo,currentMultiple)->getCString());
comboLabel->stopAllActions();
CCSequence *sequence = CCSequence::create(CCDelayTime::create(0.5),CCFadeOut::create(0.3),CCCallFunc::create(this,callfunc_selector(ComboManager::hideComboLabel)),NULL);
comboLabel->runAction(sequence);
}
开发者ID:qokelate,项目名称:ThreeKingDoms,代码行数:25,代码来源:ComboLayer.cpp
示例19: setIsGuiding
void GuideManager::exitGuide()
{
if(effect){
effect->removeFromParent();
}
if(guideFinger){
guideFinger->removeFromParent();
}
if(tips){
tips->removeFromParent();
}
setIsGuiding(false);
INSTANCE(FightManager)->endGuide();
INSTANCE(NPCManager)->setStop(false);
}
开发者ID:qokelate,项目名称:ThreeKingDoms,代码行数:16,代码来源:GuideManager.cpp
示例20: addChild
void LoadingScene::initContent()
{
SpriteFrameCache::getInstance()->addSpriteFramesWithFile("ui/loadingScene/loadingScene.plist");
SpriteFrameCache::getInstance()->addSpriteFramesWithFile("ui/loadingScene/loading_fire.plist");
auto role = Sprite::createWithSpriteFrameName("loadingScene_role.png");
addChild(role);
role->setPosition(Vec2(240,0));
auto logo = Sprite::createWithSpriteFrameName("loadingScene_logo.png");
addChild(logo);
logo->setPosition(Vec2(0,20));
frame = Sprite::createWithSpriteFrameName("loadingScene_frame.png");
addChild(frame);
frame->setPosition(Vec2(0,-150));
loadingBar = ProgressTimer::create(Sprite::createWithSpriteFrameName("loadingScene_bar.png"));
loadingBar->setType(ProgressTimer::Type::BAR);
loadingBar->setBarChangeRate(Vec2::ANCHOR_BOTTOM_RIGHT);
loadingBar->setMidpoint(Vec2::ZERO);
loadingBar->setPercentage(0.0f);
frame->addChild(loadingBar);
loadingBar->setPosition(getCenterPosition(frame));
fire = Sprite::createWithSpriteFrameName("loading_fire_0000.png");
fire->setAnchorPoint(Vec2::ANCHOR_MIDDLE_RIGHT);
frame->addChild(fire);
fire->setPosition(Vec2(50,frame->getContentSize().height/2));
auto animate = Animate::create(
INSTANCE(AnimationUtils)->getCommonAnimation("ui/loadingScene/loading_fire.plist","loading_fire",0.07f));
auto repeat = RepeatForever::create(animate);
fire->runAction(repeat);
}
开发者ID:qq125384977,项目名称:ThreeKingdoms,代码行数:35,代码来源:LoadingScene.cpp
注:本文中的INSTANCE函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论