本文整理汇总了C++中MessageParam::asPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ MessageParam::asPoint方法的具体用法?C++ MessageParam::asPoint怎么用?C++ MessageParam::asPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MessageParam
的用法示例。
在下文中一共展示了MessageParam::asPoint方法的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: handleMessage
uint32 StaticScene::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;
}
return 0;
}
示例3:
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;
}
示例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: if
uint32 KmScene1304::xHandleMessage(int messageNum, const MessageParam ¶m) {
switch (messageNum) {
case 0x4001:
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
case 0x4004:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4812:
if (param.asInteger() == 2)
GotoState(&Klaymen::stPickUpNeedle);
else if (param.asInteger() == 1)
GotoState(&Klaymen::stPickUpTube);
else
GotoState(&Klaymen::stPickUpGeneric);
break;
case 0x4817:
setDoDeltaX(param.asInteger());
gotoNextStateExt();
break;
case 0x481B:
if (param.asPoint().y != 0)
startWalkToXDistance(param.asPoint().y, param.asPoint().x);
else
startWalkToAttachedSpriteXDistance(param.asPoint().x);
break;
case 0x481F:
if (param.asInteger() == 1)
GotoState(&Klaymen::stTurnAwayFromUse);
else if (param.asInteger() == 0)
GotoState(&Klaymen::stTurnToUseHalf);
else
GotoState(&Klaymen::stWonderAbout);
break;
case 0x483F:
startSpecialWalkRight(param.asInteger());
break;
case 0x4840:
startSpecialWalkLeft(param.asInteger());
break;
}
return 0;
}
示例6:
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;
}
示例7:
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;
}
示例8: 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;
}
示例9:
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;
}
示例10:
uint32 Scene1907::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) &&
!_hasPlugInFailed && _moveDownCountdown == 0 && _moveUpCountdown == 0 && _countdown3 == 0) {
leaveScene(0);
}
break;
case NM_ANIMATION_UPDATE:
if (getGlobalVar(V_STAIRS_DOWN)) {
playSound(0);
for (int i = 0; i < 9; i++)
_asSymbols[i]->moveUp();
_ssUpDownButton->setToUpPosition();
setGlobalVar(V_STAIRS_DOWN, 0);
} else {
if (!getGlobalVar(V_WALL_BROKEN)) {
playSound(2);
_countdown3 = 5;
} else {
playSound(1);
_ssUpDownButton->setToDownPosition();
setGlobalVar(V_STAIRS_DOWN, 1);
}
_moveDownCountdown = 1;
_currMovingSymbolIndex = 8;
}
break;
case 0x2001:
playSound(3);
setGlobalVar(V_STAIRS_PUZZLE_SOLVED, 1);
break;
}
return 0;
}
示例11:
uint32 KmScene1305::xHandleMessage(int messageNum, const MessageParam ¶m) {
switch (messageNum) {
case 0x4001:
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
case 0x4004:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x4804:
GotoState(&KmScene1305::stCrashDown);
break;
case 0x4817:
setDoDeltaX(param.asInteger());
gotoNextStateExt();
break;
}
return 0;
}
示例12: handleMessage
uint32 NavigationScene::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
switch (messageNum) {
case 0x0000:
if (_interactive)
sendMessage(_mouseCursor, 0x4002, param);
break;
case 0x0001:
if (_interactive)
handleNavigation(param.asPoint());
break;
case 0x0009:
if (!_interactive)
_smackerDone = true;
break;
case 0x3002:
_smackerDone = true;
break;
}
return 0;
}
示例13: if
uint32 KmScene2403::xHandleMessage(int messageNum, const MessageParam ¶m) {
uint32 messageResult = 0;
switch (messageNum) {
case 0x4001:
case 0x4800:
startWalkToX(param.asPoint().x, false);
break;
case 0x4004:
GotoState(&Klaymen::stTryStandIdle);
break;
case 0x480D:
GotoState(&Klaymen::stPullCord);
break;
case 0x4812:
GotoState(&Klaymen::stPickUpGeneric);
break;
case 0x4816:
if (param.asInteger() == 1)
GotoState(&Klaymen::stPressButton);
else if (param.asInteger() == 2)
GotoState(&Klaymen::stPressFloorButton);
else
GotoState(&Klaymen::stPressButtonSide);
break;
case 0x4817:
setDoDeltaX(param.asInteger());
gotoNextStateExt();
break;
case 0x481B:
if (param.asPoint().y != 0)
startWalkToXDistance(param.asPoint().y, param.asPoint().x);
else
startWalkToAttachedSpriteXDistance(param.asPoint().x);
break;
case 0x481F:
if (param.asInteger() == 0)
GotoState(&Klaymen::stWonderAboutHalf);
else if (param.asInteger() == 1)
GotoState(&Klaymen::stWonderAboutAfter);
else if (param.asInteger() == 3)
GotoState(&Klaymen::stTurnToUseHalf);
else if (param.asInteger() == 4)
GotoState(&Klaymen::stTurnAwayFromUse);
else
GotoState(&Klaymen::stWonderAbout);
break;
case 0x4820:
sendMessage(_parentScene, 0x2000, 0);
GotoState(&Klaymen::stContinueClimbLadderUp);
break;
case 0x4821:
sendMessage(_parentScene, 0x2000, 0);
_destY = param.asInteger();
GotoState(&Klaymen::stStartClimbLadderDown);
break;
case 0x4822:
sendMessage(_parentScene, 0x2000, 0);
_destY = param.asInteger();
GotoState(&Klaymen::stStartClimbLadderUp);
break;
case 0x4823:
sendMessage(_parentScene, 0x2001, 0);
GotoState(&Klaymen::stClimbLadderHalf);
break;
case 0x482D:
setDoDeltaX(_x > (int16)param.asInteger() ? 1 : 0);
gotoNextStateExt();
break;
case 0x483F:
startSpecialWalkRight(param.asInteger());
break;
case 0x4840:
startSpecialWalkLeft(param.asInteger());
break;
}
return messageResult;
}
示例14: if
uint32 KmScene2101::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 0x4811:
GotoState(&KmScene2101::stHitByDoor);
break;
case NM_KLAYMEN_PICKUP:
if (param.asInteger() == 2)
GotoState(&Klaymen::stPickUpNeedle);
else if (param.asInteger() == 1)
GotoState(&Klaymen::stPickUpTube);
else
GotoState(&Klaymen::stPickUpGeneric);
break;
case NM_KLAYMEN_PRESS_BUTTON:
if (param.asInteger() == 1)
GotoState(&Klaymen::stPressButton);
else if (param.asInteger() == 2)
GotoState(&Klaymen::stPressFloorButton);
else
GotoState(&Klaymen::stPressButtonSide);
break;
case 0x4817:
setDoDeltaX(param.asInteger());
gotoNextStateExt();
break;
case 0x481B:
if (param.asPoint().y != 0)
startWalkToXDistance(param.asPoint().y, param.asPoint().x);
else
startWalkToAttachedSpriteXDistance(param.asPoint().x);
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(0xFF290E30);
break;
case 0x483E:
teleporterDisappear(0x9A28CA1C);
break;
}
return messageResult;
}
示例15: getSubVar
uint32 Scene1105::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) {
uint32 messageResult = 0;
Scene::handleMessage(messageNum, param, sender);
switch (messageNum) {
case 0x0001:
if (param.asPoint().x <= 20 || param.asPoint().x >= 620) {
if (!_isActionButtonClicked && _backgroundIndex == 0) {
if (_isPanelOpen) {
_isPanelOpen = false;
_backgroundIndex = 15;
SetUpdateHandler(&Scene1105::upClosePanel);
} else
_isClosePanelDone = true;
_leaveResult = 0;
}
}
break;
case 0x2001:
showMouse(false);
_backgroundIndex = 24;
SetUpdateHandler(&Scene1105::upOpenPanel);
break;
case 0x2003:
_backgroundIndex = 24;
_leaveResult = 1;
SetUpdateHandler(&Scene1105::upClosePanel);
break;
case 0x4807:
if (sender == _ssActionButton) {
if (getSubVar(VA_GOOD_DICE_NUMBERS, 0) == getSubVar(VA_CURR_DICE_NUMBERS, 0) &&
getSubVar(VA_GOOD_DICE_NUMBERS, 1) == getSubVar(VA_CURR_DICE_NUMBERS, 1) &&
getSubVar(VA_GOOD_DICE_NUMBERS, 2) == getSubVar(VA_CURR_DICE_NUMBERS, 2)) {
setGlobalVar(V_ROBOT_TARGET, 1);
playSound(2);
_doMoveTeddy = true;
} else {
sendMessage(_asTeddyBear, 0x2002, 0);
}
showMouse(false);
_isActionButtonClicked = true;
}
break;
case 0x4826:
if (_isPanelOpen) {
if (sender == _ssActionButton) {
sendMessage(_ssActionButton, 0x480B, 0);
_isPanelOpen = false;
} else if (!getGlobalVar(V_ROBOT_TARGET)) {
if (sender == _ssSymbol1UpButton) {
if (getSubVar(VA_CURR_DICE_NUMBERS, 0) < 9) {
incSubVar(VA_CURR_DICE_NUMBERS, 0, +1);
sendMessage(_ssSymbol1UpButton, 0x480B, 0);
sendMessage(_ssSymbolDice[0], 0x2000, 0);
}
} else if (sender == _ssSymbol1DownButton) {
if (getSubVar(VA_CURR_DICE_NUMBERS, 0) > 1) {
incSubVar(VA_CURR_DICE_NUMBERS, 0, -1);
sendMessage(_ssSymbol1DownButton, 0x480B, 0);
sendMessage(_ssSymbolDice[0], 0x2000, 0);
}
} else if (sender == _ssSymbol2UpButton) {
if (getSubVar(VA_CURR_DICE_NUMBERS, 1) < 9) {
incSubVar(VA_CURR_DICE_NUMBERS, 1, +1);
sendMessage(_ssSymbol2UpButton, 0x480B, 0);
sendMessage(_ssSymbolDice[1], 0x2000, 0);
}
} else if (sender == _ssSymbol2DownButton) {
if (getSubVar(VA_CURR_DICE_NUMBERS, 1) > 1) {
incSubVar(VA_CURR_DICE_NUMBERS, 1, -1);
sendMessage(_ssSymbol2DownButton, 0x480B, 0);
sendMessage(_ssSymbolDice[1], 0x2000, 0);
}
} else if (sender == _ssSymbol3UpButton) {
if (getSubVar(VA_CURR_DICE_NUMBERS, 2) < 9) {
incSubVar(VA_CURR_DICE_NUMBERS, 2, +1);
sendMessage(_ssSymbol3UpButton, 0x480B, 0);
sendMessage(_ssSymbolDice[2], 0x2000, 0);
}
} else if (sender == _ssSymbol3DownButton) {
if (getSubVar(VA_CURR_DICE_NUMBERS, 2) > 1) {
incSubVar(VA_CURR_DICE_NUMBERS, 2, -1);
sendMessage(_ssSymbol3DownButton, 0x480B, 0);
sendMessage(_ssSymbolDice[2], 0x2000, 0);
}
}
}
}
break;
}
return messageResult;
}