本文整理汇总了C++中SetUpdateHandler函数的典型用法代码示例。如果您正苦于以下问题:C++ SetUpdateHandler函数的具体用法?C++ SetUpdateHandler怎么用?C++ SetUpdateHandler使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetUpdateHandler函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AnimatedSprite
AsScene2402TV::AsScene2402TV(NeverhoodEngine *vm, Klaymen *klaymen)
: AnimatedSprite(vm, 1100), _klaymen(klaymen), _countdown1(0), _countdown2(0) {
_x = 260;
_y = 210;
createSurface(100, 127, 90);
setDoDeltaX(1);
SetMessageHandler(&Sprite::handleMessage);
if (!getGlobalVar(V_TV_JOKE_TOLD)) {
loadSound(0, 0x58208810);
_countdown1 = 48;
startAnimation(0x4919397A, 0, -1);
_newStickFrameIndex = 0;
SetUpdateHandler(&AsScene2402TV::upWait);
} else {
int16 frameIndex;
if (_klaymen->getX() > 320)
_currFrameIndex = 29;
frameIndex = CLIP<int16>((_klaymen->getX() - _x + 150) / 10, 0, 29);
startAnimation(0x050A0103, frameIndex, -1);
_newStickFrameIndex = frameIndex;
_countdown1 = 0;
SetUpdateHandler(&AsScene2402TV::upFocusKlaymen);
}
}
示例2: sendMessage
void Scene1608::upCarAtHome() {
Scene::update();
if (_mouseClicked) {
if (_mouseClickPos.x <= 329 && _asCar->getX() == 375 && _asCar->getY() == 227) {
sendMessage(_asCar, 0x200A, 0);
SetUpdateHandler(&Scene1608::upGettingOutOfCar);
} else {
sendPointMessage(_asCar, 0x2004, _mouseClickPos);
SetMessageHandler(&Scene1608::hmRidingCar);
SetUpdateHandler(&Scene1608::upRidingCar);
}
_mouseClicked = false;
}
updateKlaymenCliprect();
}
示例3: Scene
Scene1202::Scene1202(NeverhoodEngine *vm, Module *parentModule)
: Scene(vm, parentModule), _paletteResource(vm),
_soundToggle(true), _isPuzzleSolved(false), _counter(0), _clickedIndex(-1) {
SetMessageHandler(&Scene1202::handleMessage);
SetUpdateHandler(&Scene1202::update);
setBackground(0x60210ED5);
setPalette(0x60210ED5);
addEntity(_palette);
_paletteResource.load(0x60250EB5);
_paletteResource.copyPalette(_paletteData);
insertPuzzleMouse(0x10ED160A, 20, 620);
for (int tntIndex = 0; tntIndex < 18; tntIndex++) {
_asTntItems[tntIndex] = insertSprite<AsScene1202TntItem>(this, tntIndex);
addCollisionSprite(_asTntItems[tntIndex]);
}
insertStaticSprite(0x8E8419C1, 1100);
if (getGlobalVar(V_TNT_DUMMY_BUILT))
SetMessageHandler(&Scene1202::hmSolved);
playSound(0, 0x40106542);
loadSound(1, 0x40005446);
loadSound(2, 0x40005446); // Same sound as slot 1
loadSound(3, 0x68E25540);
}
示例4: startAnimation
void AsDiskplayerSceneKey::stDropKey() {
startAnimation(0x100B90B4, 0, -1);
SetUpdateHandler(&AnimatedSprite::update);
SetMessageHandler(&AsDiskplayerSceneKey::handleMessage);
NextState(&AsDiskplayerSceneKey::stDropKeyDone);
setVisible(true);
}
示例5: Entity
Palette::Palette(NeverhoodEngine *vm, uint32 fileHash) : Entity(vm, 0) {
PaletteResource paletteResource(_vm);
init();
paletteResource.load(fileHash);
paletteResource.copyPalette(_palette);
SetUpdateHandler(&Palette::update);
}
示例6: Scene
Scene1907::Scene1907(NeverhoodEngine *vm, Module *parentModule)
: Scene(vm, parentModule), _currMovingSymbolIndex(0), _pluggedInCount(0),
_moveDownCountdown(0), _moveUpCountdown(0), _countdown3(0), _hasPlugInFailed(false) {
setBackground(0x20628E05);
setPalette(0x20628E05);
for (int i = 0; i < 9; i++)
_positionFree[i] = true;
for (int i = 0; i < 9; i++) {
_asSymbols[i] = insertSprite<AsScene1907Symbol>(this, i, getRandomPositionIndex());
addCollisionSprite(_asSymbols[i]);
}
_ssUpDownButton = insertSprite<SsScene1907UpDownButton>(this, _asSymbols[8]);
addCollisionSprite(_ssUpDownButton);
_asWaterHint = insertSprite<AsScene1907WaterHint>();
insertPuzzleMouse(0x28E0120E, 20, 620);
SetMessageHandler(&Scene1907::handleMessage);
SetUpdateHandler(&Scene1907::update);
if (getGlobalVar(V_STAIRS_PUZZLE_SOLVED))
_pluggedInCount = 9;
loadSound(0, 0x72004A10);
loadSound(1, 0x22082A12);
loadSound(2, 0x21100A10);
loadSound(3, 0x68E25540);
}
示例7: showMouse
void Scene1105::upClosePanel() {
Scene::update();
if (_backgroundIndex != 0) {
_backgroundIndex--;
if (_backgroundIndex == 14) {
showMouse(false);
_ssSymbols[0]->hide();
_ssSymbols[1]->hide();
_ssSymbols[2]->hide();
_ssSymbolDice[0]->hide();
_ssSymbolDice[1]->hide();
_ssSymbolDice[2]->hide();
}
if (_backgroundIndex < 6 && _backgroundIndex % 2 == 0) {
uint32 backgroundFileHash = kScene1105BackgroundFileHashes[3 - _backgroundIndex / 2]; // CHECKME
if (_backgroundIndex == 4) {
playSound(1);
_asTeddyBear->hide();
}
changeBackground(backgroundFileHash);
_palette->addPalette(backgroundFileHash, 0, 256, 0);
}
if (_backgroundIndex == 0) {
SetUpdateHandler(&Scene1105::update);
_isClosePanelDone = true;
}
}
}
示例8: Scene
NavigationScene::NavigationScene(NeverhoodEngine *vm, Module *parentModule, uint32 navigationListId, int navigationIndex, const byte *itemsTypes)
: Scene(vm, parentModule), _itemsTypes(itemsTypes), _navigationIndex(navigationIndex), _smackerDone(false),
_isWalkingForward(false), _isTurning(false), _smackerFileHash(0), _interactive(true), _leaveSceneAfter(false) {
_navigationList = _vm->_staticData->getNavigationList(navigationListId);
_navigationListId = navigationListId;
if (_navigationIndex < 0) {
_navigationIndex = (int)getGlobalVar(V_NAVIGATION_INDEX);
if (_navigationIndex >= (int)_navigationList->size())
_navigationIndex = 0;
}
setGlobalVar(V_NAVIGATION_INDEX, _navigationIndex);
SetUpdateHandler(&NavigationScene::update);
SetMessageHandler(&NavigationScene::handleMessage);
_smackerPlayer = addSmackerPlayer(new SmackerPlayer(_vm, this, (*_navigationList)[_navigationIndex].fileHash, true, true));
createMouseCursor();
_vm->_screen->clear();
_vm->_screen->setSmackerDecoder(_smackerPlayer->getSmackerDecoder());
sendMessage(_parentModule, 0x100A, _navigationIndex);
}
示例9: AnimatedSprite
AsCommonCarShadow::AsCommonCarShadow(NeverhoodEngine *vm, AnimatedSprite *asCar, BaseSurface *shadowSurface, uint index)
: AnimatedSprite(vm, 1100), _asCar(asCar), _index(index), _animFileHash(0) {
SetUpdateHandler(&AsCommonCarShadow::update);
createShadowSurface(shadowSurface, 211, 147, 100);
updateShadow();
}
示例10: setVisible
void AsScene1306Elevator::stGoingUp() {
setVisible(true);
_isDown = false;
startAnimation(0x043B0270, 0, -1);
playSound(0);
SetUpdateHandler(&AsScene1306Elevator::update);
NextState(&AsScene1306Elevator::cbGoingUpEvent);
}
示例11: startAnimationByHash
void KmScene2401::stContSpitIntoPipe() {
_canSpitPipe = true;
_acceptInput = true;
startAnimationByHash(0x1808B150, 0x16401CA6, 0);
SetUpdateHandler(&Klaymen::update);
SetMessageHandler(&KmScene2401::hmSpit);
SetSpriteUpdate(NULL);
}
示例12: StaticSprite
SsScene1105Button::SsScene1105Button(NeverhoodEngine *vm, Scene *parentScene, uint32 fileHash, NRect &collisionBounds)
: StaticSprite(vm, fileHash, 200), _parentScene(parentScene), _countdown(0) {
_collisionBounds = collisionBounds;
SetMessageHandler(&SsScene1105Button::handleMessage);
SetUpdateHandler(&SsScene1105Button::update);
setVisible(false);
}
示例13: sendMessage
void AsScene1306Elevator::cbGoingUpEvent() {
sendMessage(_parentScene, 0x4808, 0);
_isUp = true;
_countdown = 144;
stopAnimation();
setVisible(false);
SetUpdateHandler(&AsScene1306Elevator::update);
}
示例14: startAnimation
void KmScene2101::stHitByDoor() {
_busyStatus = 1;
_acceptInput = false;
startAnimation(0x35AA8059, 0, -1);
SetUpdateHandler(&Klaymen::update);
SetMessageHandler(&KmScene2101::hmHitByDoor);
SetSpriteUpdate(&AnimatedSprite::updateDeltaXY);
playSound(0, 0x402E82D4);
}
示例15: debug
void Module1600::createScene(int sceneNum, int which) {
debug(1, "Module1600::createScene(%d, %d)", sceneNum, which);
_sceneNum = sceneNum;
switch (_sceneNum) {
case 0:
_vm->gameState().sceneNum = 0;
createNavigationScene(0x004B39D0, which);
break;
case 1:
_vm->gameState().sceneNum = 1;
createNavigationScene(0x004B3A30, which);
break;
case 2:
_vm->gameState().sceneNum = 2;
createNavigationScene(0x004B3A60, which);
break;
case 3:
_vm->gameState().sceneNum = 3;
createNavigationScene(0x004B3A90, which);
break;
case 4:
_vm->gameState().sceneNum = 4;
createNavigationScene(0x004B3B20, which);
break;
case 5:
_vm->gameState().sceneNum = 5;
createNavigationScene(0x004B3B50, which);
break;
case 6:
_vm->gameState().sceneNum = 6;
createNavigationScene(0x004B3B80, which);
break;
case 7:
_vm->gameState().sceneNum = 7;
_childObject = new Scene1608(_vm, this, which);
break;
case 8:
_vm->gameState().sceneNum = 8;
_childObject = new Scene1609(_vm, this);
break;
case 1001:
_vm->gameState().sceneNum = 1;
if (getGlobalVar(V_TALK_COUNTING_INDEX) == 1)
createSmackerScene(0x80050200, true, true, false);
else if (getGlobalVar(V_TALK_COUNTING_INDEX) == 2)
createSmackerScene(0x80090200, true, true, false);
else
createSmackerScene(0x80000200, true, true, false);
if (getGlobalVar(V_TALK_COUNTING_INDEX) >= 2)
setGlobalVar(V_TALK_COUNTING_INDEX, 0);
else
incGlobalVar(V_TALK_COUNTING_INDEX, +1);
break;
}
SetUpdateHandler(&Module1600::updateScene);
_childObject->handleUpdate();
}