本文整理汇总了C++中MessageParam类的典型用法代码示例。如果您正苦于以下问题:C++ MessageParam类的具体用法?C++ MessageParam怎么用?C++ MessageParam使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MessageParam类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
uint32 Scene1609::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
case 0x0001:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620)
leaveScene(0);
break;
case 0x2000:
if (!_isSolved) {
if (_changeCurrentSymbol)
_asSymbols[_symbolPosition]->change(_currentSymbolIndex + 12, false);
_asSymbols[_symbolPosition]->stopSymbolSound();
_symbolPosition++;
if (_symbolPosition >= 12) {
if (testVars()) {
playSound(0);
setGlobalVar(V_CODE_SYMBOLS_SOLVED, 1);
_isSolved = true;
} else {
_symbolPosition = 0;
for (int i = 0; i < 12; i++)
_asSymbols[i]->hide();
}
}
_changeCurrentSymbol = true;
_countdown1 = 1;
}
break;
}
return 0;
}
示例2:
uint32 AsScene1307Key::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
case 0x1011:
if (_isClickable) {
sendMessage(_parentScene, 0x4826, 0);
stRemoveKey();
messageResult = 1;
}
break;
case 0x2000:
_isClickable = param.asInteger() != 0;
break;
case 0x2001:
setSubVar(VA_CURR_KEY_SLOT_NUMBERS, _keyIndex, param.asInteger());
stMoveKey();
break;
case 0x2003:
playSound(3);
stUnlock();
break;
case 0x2004:
playSound(2);
stInsert();
break;
}
return messageResult;
}
示例3: if
uint32 Scene1201::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
case NM_ANIMATION_START:
if (param.asInteger() == 0x07053000) {
_creatureExploded = true;
sendMessage(_asCreature, 0x2004, 0);
} else if (param.asInteger() == 0x140E5744)
sendMessage(_asCreature, NM_KLAYMEN_CLIMB_LADDER, 0);
else if (param.asInteger() == 0x40253C40) {
_canAcceptInput = false;
sendMessage(_asCreature, NM_KLAYMEN_STOP_CLIMBING, 0);
} else if (param.asInteger() == 0x090EB048) {
if (_klaymen->getX() < 572)
setMessageList2(0x004AEC90);
else
setMessageList2(0x004AEC20);
}
break;
case 0x2001:
if (getGlobalVar(V_MATCH_STATUS) == 0)
setMessageList2(0x004AECB0);
else {
sendEntityMessage(_klaymen, 0x1014, _asMatch);
setMessageList2(0x004AECC0);
}
break;
case NM_POSITION_CHANGE:
if (getGlobalVar(V_TNT_DUMMY_FUSE_LIT)) {
// Move the TNT dummy if the fuse is burning
sendEntityMessage(_klaymen, 0x1014, _asTntMan);
setMessageList2(0x004AECF0, false);
} else if (getGlobalVar(V_MATCH_STATUS) == 3) {
// Light the TNT dummy if we have the match
sendEntityMessage(_klaymen, 0x1014, _asTntMan);
if (_klaymen->getX() > _asTntMan->getX())
setMessageList(0x004AECD0);
else
setMessageList(0x004AECE0);
}
break;
case 0x4814:
cancelMessageList();
break;
case 0x4826:
if (sender == _asTape) {
sendEntityMessage(_klaymen, 0x1014, _asTape);
setMessageList(0x004AED38);
}
break;
case 0x4829:
sendMessage(_asRightDoor, 0x4829, 0);
break;
case 0x8000:
sendMessage(_asKlaymenHead, NM_KLAYMEN_STOP_CLIMBING, 0);
break;
}
return messageResult;
}
示例4:
uint32 KmScene1109::xHandleMessage(int messageNum, const MessageParam ¶m) {
uint32 messageResult = 0;
switch (messageNum) {
case NM_ANIMATION_UPDATE:
_isSittingInTeleporter = param.asInteger() != 0;
messageResult = 1;
break;
case 0x4001:
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
case NM_KLAYMEN_STAND_IDLE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stSitIdleTeleporter);
else
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4804:
if (param.asInteger() != 0) {
_destX = param.asInteger();
GotoState(&Klaymen::stWalkingFirst);
} else
GotoState(&Klaymen::stPeekWall);
break;
case 0x4817:
setDoDeltaX(param.asInteger());
gotoNextStateExt();
break;
case NM_KLAYMEN_TURN_TO_USE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stTurnToUseInTeleporter);
break;
case NM_KLAYMEN_RETURN_FROM_USE:
if (_isSittingInTeleporter)
GotoState(&Klaymen::stReturnFromUseInTeleporter);
break;
case 0x4834:
GotoState(&Klaymen::stStepOver);
break;
case 0x4835:
sendMessage(_parentScene, 0x2000, 1);
_isSittingInTeleporter = true;
GotoState(&Klaymen::stSitInTeleporter);
break;
case 0x4836:
sendMessage(_parentScene, 0x2000, 0);
_isSittingInTeleporter = false;
GotoState(&Klaymen::stGetUpFromTeleporter);
break;
case 0x483D:
teleporterAppear(0x2C2A4A1C);
break;
case 0x483E:
teleporterDisappear(0x3C2E4245);
break;
}
return messageResult;
}
示例5: handleMessage
uint32 Scene::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
switch (messageNum) {
case 0x0000: // mouse moved
if (_mouseCursor && _mouseCursor->hasMessageHandler())
sendMessage(_mouseCursor, 0x4002, param);
break;
case 0x0001: // mouse clicked
_mouseClicked = true;
_mouseClickPos = param.asPoint();
break;
case 0x0006:
sendMessage(_parentModule, 0x1009, param);
break;
case 0x1006:
// Sent by Klaymen when its animation sequence has finished
if (_isKlaymenBusy) {
_isKlaymenBusy = false;
if (_messageListIndex == _messageListCount) {
// If the current message list was processed completely,
// sent Klaymen into the idle state.
sendMessage(_klaymen, 0x4004, 0);
} else {
// Else continue with the next message in the current message list
processMessageList();
}
}
break;
case 0x1007:
// This isn't sent by any code, check if it's in a message list
// This cancels the current message list and sets Klaymen into the idle state.
if (_isKlaymenBusy) {
_isKlaymenBusy = false;
_messageList = NULL;
sendMessage(_klaymen, 0x4004, 0);
}
break;
case 0x101D:
// Hide the mouse cursor
if (_mouseCursor) {
_mouseCursorWasVisible = _mouseCursor->getSurface()->getVisible();
_mouseCursor->getSurface()->setVisible(false);
}
break;
case 0x101E:
// Show the mouse cursor
if (_mouseCursorWasVisible && _mouseCursor) {
_mouseCursor->getSurface()->setVisible(true);
}
break;
case 0x1022:
// Set the sender's surface priority
setSurfacePriority(((Sprite*)sender)->getSurface(), param.asInteger());
break;
}
return 0;
}
示例6:
uint32 Scene1202::hmSolved(int messageNum, const MessageParam ¶m, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
case NM_MOUSE_CLICK:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620)
leaveScene(0);
break;
}
return 0;
}
示例7: if
uint32 AsScene1308Mouse::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
case 0x100D:
if (param.asInteger() == 0x66382026)
playSound(0, 0x0CD84468);
else if (param.asInteger() == 0x6E28061C)
playSound(0, 0x78C8402C);
else if (param.asInteger() == 0x462F0410)
playSound(0, 0x60984E28);
break;
}
return messageResult;
}
示例8:
uint32 AsScene3009Symbol::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
case NM_KLAYMEN_CLIMB_LADDER:
if (param.asInteger()) {
if (_symbolIndex == 11)
_symbolIndex = 0;
else
_symbolIndex++;
} else {
if (_symbolIndex == 0)
_symbolIndex = 11;
else
_symbolIndex--;
}
startAnimation(kAsScene3009SymbolFileHashes[_symbolPosition / 3], _symbolIndex, -1);
_newStickFrameIndex = _symbolIndex;
setSubVar(VA_CURR_CANNON_SYMBOLS, _symbolPosition, _symbolIndex);
if (_symbolPosition / 3 == 0) {
sendMessage(_parentScene, 0x2001, 0);
} else {
sendMessage(_parentScene, 0x2003, 0);
}
messageResult = 1;
break;
}
return messageResult;
}
示例9: if
uint32 Scene1608::hmLowerFloor(int messageNum, const MessageParam ¶m, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
case 0x100D:
if (param.asInteger() == 0x20250B1A) {
clearRectList();
_klaymen->setVisible(false);
showMouse(false);
_sprite1->setVisible(false);
//sendMessage(_asDoor, 0x4809, 0); // Play sound?
_countdown1 = 28;
}
break;
case 0x200D:
sendMessage(_parentModule, 0x200D, 0);
break;
case 0x4826:
if (sender == _asTape) {
sendEntityMessage(_kmScene1608, 0x1014, _asTape);
setMessageList(0x004B4770);
} else if (sender == _asKey)
setMessageList(0x004B46C8);
break;
}
return 0;
}
示例10:
uint32 AsScene2401FlowingWater::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
switch (messageNum) {
case 0x100D:
if (_isWaterFlowing && param.asInteger() == 0x02421405)
startAnimationByHash(0x10203116, 0x01084280, 0);
break;
case 0x2002:
if (!_isWaterFlowing) {
_vm->_soundMan->addSound(0x40F11C09, 0x980C1420);
_vm->_soundMan->playSoundLooping(0x980C1420);
startAnimation(0x10203116, 0, -1);
setVisible(true);
_isWaterFlowing = true;
}
break;
case 0x2003:
_vm->_soundMan->deleteSound(0x980C1420);
_isWaterFlowing = false;
break;
case 0x3002:
stopAnimation();
setVisible(false);
break;
}
return messageResult;
}
示例11: if
uint32 KmScene2401::hmSpit(int messageNum, const MessageParam ¶m, Entity *sender) {
uint32 messageResult = Klaymen::hmLowLevelAnimation(messageNum, param, sender);
switch (messageNum) {
case 0x100D:
if (param.asInteger() == 0x16401CA6) {
_canSpitPipe = true;
if (_contSpitPipe)
spitIntoPipe();
} else if (param.asInteger() == 0xC11C0008) {
_canSpitPipe = false;
_acceptInput = false;
_readyToSpit = false;
} else if (param.asInteger() == 0x018A0001) {
sendMessage(_parentScene, 0x2001, _spitDestPipeIndex);
}
break;
}
return messageResult;
}
示例12:
uint32 Scene2609::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
case 0x0001:
if ((param.asPoint().x <= 20 || param.asPoint().x >= 620) && !_isBusy)
leaveScene(0);
break;
case 0x2000:
_isBusy = true;
break;
case 0x2001:
_isBusy = false;
sendMessage(_asWater, 0x2001, 0);
break;
case 0x2002:
_isBusy = false;
sendMessage(_asWater, 0x2002, 0);
break;
}
return 0;
}
示例13:
uint32 Scene2609::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
case NM_MOUSE_CLICK:
if ((param.asPoint().x <= 20 || param.asPoint().x >= 620) && !_isBusy)
leaveScene(0);
break;
case NM_ANIMATION_UPDATE:
_isBusy = true;
break;
case 0x2001:
_isBusy = false;
sendMessage(_asWater, 0x2001, 0);
break;
case NM_POSITION_CHANGE:
_isBusy = false;
sendMessage(_asWater, NM_POSITION_CHANGE, 0);
break;
}
return 0;
}
示例14: handleMessage
uint32 DiskplayerScene::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
if (!_inputDisabled) {
switch (messageNum) {
case 0x0001:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620) {
sendMessage(_parentModule, 0x1009, 0);
} else if (!_dropKey &&
param.asPoint().x > 38 && param.asPoint().x < 598 &&
param.asPoint().y > 400 && param.asPoint().y < 460) {
_diskSlots[_diskIndex]->stop();
_diskIndex = (param.asPoint().x - 38) / 28;
_diskSlots[_diskIndex]->activate();
if (_updateStatus == kUSPlaying) {
if (_diskAvailable[_diskIndex])
playDisk();
else
playStatic();
}
}
break;
case 0x2000:
tuneIn();
break;
case 0x2001:
stop();
break;
}
}
return 0;
}
示例15:
uint32 Scene2901::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
case 0x0001:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620)
leaveScene((uint32)-1);
break;
case 0x2000:
if (_currLocationButtonNum != _selectedButtonNum)
leaveScene(_selectedButtonNum);
break;
case 0x2001:
if (_currLocationButtonNum == _selectedButtonNum)
_selectedButtonNum = _currWhirlButtonNum;
_ssLocationButtonLights[_selectedButtonNum]->hide();
_selectedButtonNum = param.asInteger();
if (!getSubVar(V_TELEPORTER_DEST_AVAILABLE, _selectedButtonNum))
_selectedButtonNum = _currLocationButtonNum;
break;
}
return 0;
}