DM: Finish the renaming of class members

This commit is contained in:
Strangerke 2016-08-25 22:38:03 +02:00 committed by Bendegúz Nagy
parent 52170d39ae
commit 42fea91d5d
19 changed files with 458 additions and 459 deletions

View File

@ -217,7 +217,7 @@ bool ChampionMan::isObjectThrown(uint16 champIndex, int16 slotIndex, int16 side)
return false;
}
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
decrementStamina(champIndex, getThrowingStaminaCost(curThing));
disableAction(champIndex, 4);
int16 experience = 8;
@ -263,10 +263,10 @@ int16 ChampionMan::getDecodedValue(char *string, uint16 characterCount) {
void ChampionMan::drawHealthOrStaminaOrManaValue(int16 posY, int16 currVal, int16 maxVal) {
Common::String tmp = getStringFromInteger(currVal, true, 3);
_vm->_textMan->f52_printToViewport(55, posY, k13_ColorLightestGray, tmp.c_str());
_vm->_textMan->f52_printToViewport(73, posY, k13_ColorLightestGray, "/");
_vm->_textMan->printToViewport(55, posY, k13_ColorLightestGray, tmp.c_str());
_vm->_textMan->printToViewport(73, posY, k13_ColorLightestGray, "/");
tmp = getStringFromInteger(maxVal, true, 3);
_vm->_textMan->f52_printToViewport(79, posY, k13_ColorLightestGray, tmp.c_str());
_vm->_textMan->printToViewport(79, posY, k13_ColorLightestGray, tmp.c_str());
}
uint16 ChampionMan::getHandSlotIndex(uint16 slotBoxIndex) {
@ -931,19 +931,19 @@ void ChampionMan::disableAction(uint16 champIndex, uint16 ticks) {
int16 eventIndex = curChampion->_enableActionEventIndex;
if (eventIndex >= 0) {
int32 currentEnableActionEventTime = filterTime(_vm->_timeline->_g370_events[eventIndex]._mapTime);
int32 currentEnableActionEventTime = filterTime(_vm->_timeline->_events[eventIndex]._mapTime);
if (updatedEnableActionEventTime >= currentEnableActionEventTime) {
updatedEnableActionEventTime += (currentEnableActionEventTime - _vm->_gameTime) >> 1;
} else {
updatedEnableActionEventTime = currentEnableActionEventTime + (ticks >> 1);
}
_vm->_timeline->f237_deleteEvent(eventIndex);
_vm->_timeline->deleteEvent(eventIndex);
} else {
setFlag(curChampion->_attributes, k0x8000_ChampionAttributeActionHand | k0x0008_ChampionAttributeDisableAction);
drawChampionState((ChampionIndex)champIndex);
}
setMapAndTime(curEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, updatedEnableActionEventTime);
curChampion->_enableActionEventIndex = _vm->_timeline->f238_addEventGetEventIndex(&curEvent);
curChampion->_enableActionEventIndex = _vm->_timeline->addEventGetEventIndex(&curEvent);
}
void ChampionMan::addSkillExperience(uint16 champIndex, uint16 skillIndex, uint16 exp) {
@ -1031,24 +1031,24 @@ void ChampionMan::addSkillExperience(uint16 champIndex, uint16 skillIndex, uint1
setFlag(curChampion->_attributes, k0x0100_ChampionAttributeStatistics);
drawChampionState((ChampionIndex)champIndex);
_vm->_textMan->f51_messageAreaPrintLineFeed();
_vm->_textMan->printLineFeed();
Color curChampionColor = _championColor[champIndex];
_vm->_textMan->f47_messageAreaPrintMessage(curChampionColor, curChampion->_name);
_vm->_textMan->printMessage(curChampionColor, curChampion->_name);
switch (_vm->getGameLanguage()) { // localized
default:
case Common::EN_ANY: _vm->_textMan->f47_messageAreaPrintMessage(curChampionColor, " JUST GAINED A "); break;
case Common::DE_DEU: _vm->_textMan->f47_messageAreaPrintMessage(curChampionColor, " HAT SOEBEN STUFE"); break;
case Common::FR_FRA: _vm->_textMan->f47_messageAreaPrintMessage(curChampionColor, " VIENT DE DEVENIR "); break;
case Common::EN_ANY: _vm->_textMan->printMessage(curChampionColor, " JUST GAINED A "); break;
case Common::DE_DEU: _vm->_textMan->printMessage(curChampionColor, " HAT SOEBEN STUFE"); break;
case Common::FR_FRA: _vm->_textMan->printMessage(curChampionColor, " VIENT DE DEVENIR "); break;
}
_vm->_textMan->f47_messageAreaPrintMessage(curChampionColor, _baseSkillName[baseSkillIndex]);
_vm->_textMan->printMessage(curChampionColor, _baseSkillName[baseSkillIndex]);
switch (_vm->getGameLanguage()) { // localized
default:
case Common::EN_ANY: _vm->_textMan->f47_messageAreaPrintMessage(curChampionColor, "!"); break;
case Common::DE_DEU: _vm->_textMan->f47_messageAreaPrintMessage(curChampionColor, " LEVEL!"); break;
case Common::FR_FRA: _vm->_textMan->f47_messageAreaPrintMessage(curChampionColor, " ERREICHT!"); break;
case Common::EN_ANY: _vm->_textMan->printMessage(curChampionColor, "!"); break;
case Common::DE_DEU: _vm->_textMan->printMessage(curChampionColor, " LEVEL!"); break;
case Common::FR_FRA: _vm->_textMan->printMessage(curChampionColor, " ERREICHT!"); break;
}
}
}
@ -1119,7 +1119,7 @@ void ChampionMan::championPoison(int16 champIndex, uint16 attack) {
newEvent._priority = champIndex;
setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 36);
newEvent._B._attack = attack;
_vm->_timeline->f238_addEventGetEventIndex(&newEvent);
_vm->_timeline->addEventGetEventIndex(&newEvent);
}
drawChampionState((ChampionIndex)champIndex);
@ -1426,7 +1426,7 @@ void ChampionMan::applyAndDrawPendingDamageAndWounds() {
textPosY = 5;
}
_vm->_textMan->f53_printToLogicalScreen(textPosX, textPosY, k15_ColorWhite, k8_ColorRed, getStringFromInteger(pendingDamage, false, 3).c_str());
_vm->_textMan->printToLogicalScreen(textPosX, textPosY, k15_ColorWhite, k8_ColorRed, getStringFromInteger(pendingDamage, false, 3).c_str());
int16 eventIndex = championPtr->_hideDamageReceivedIndex;
if (eventIndex == -1) {
@ -1434,11 +1434,11 @@ void ChampionMan::applyAndDrawPendingDamageAndWounds() {
newEvent._type = k12_TMEventTypeHideDamageReceived;
setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 5);
newEvent._priority = championIndex;
championPtr->_hideDamageReceivedIndex = _vm->_timeline->f238_addEventGetEventIndex(&newEvent);
championPtr->_hideDamageReceivedIndex = _vm->_timeline->addEventGetEventIndex(&newEvent);
} else {
TimelineEvent *curEvent = &_vm->_timeline->_g370_events[eventIndex];
TimelineEvent *curEvent = &_vm->_timeline->_events[eventIndex];
setMapAndTime(curEvent->_mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 5);
_vm->_timeline->f236_fixChronology(_vm->_timeline->f235_getIndex(eventIndex));
_vm->_timeline->fixChronology(_vm->_timeline->getIndex(eventIndex));
}
drawChampionState((ChampionIndex)championIndex);
_vm->_eventMan->hideMouse();
@ -1561,10 +1561,10 @@ void ChampionMan::unpoison(int16 champIndex) {
if (champIndex == kM1_ChampionNone)
return;
TimelineEvent *eventPtr = _vm->_timeline->_g370_events;
for (uint16 eventIndex = 0; eventIndex < _vm->_timeline->_g369_eventMaxCount; eventPtr++, eventIndex++) {
TimelineEvent *eventPtr = _vm->_timeline->_events;
for (uint16 eventIndex = 0; eventIndex < _vm->_timeline->_eventMaxCount; eventPtr++, eventIndex++) {
if ((eventPtr->_type == k75_TMEventTypePoisonChampion) && (eventPtr->_priority == champIndex))
_vm->_timeline->f237_deleteEvent(eventIndex);
_vm->_timeline->deleteEvent(eventIndex);
}
_champions[champIndex]._poisonEventCount = 0;
}
@ -2154,7 +2154,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
setFlag(championAttributes, k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x2000_ChampionAttributeWounds | k0x8000_ChampionAttributeActionHand);
} else {
_vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(k8_StatusBoxDeadChampion), &box, k40_byteWidth, kM1_ColorNoTransparency, 29);
_vm->_textMan->f53_printToLogicalScreen(championStatusBoxX + 1, 5, k13_ColorLightestGray, k1_ColorDarkGary, curChampion->_name);
_vm->_textMan->printToLogicalScreen(championStatusBoxX + 1, 5, k13_ColorLightestGray, k1_ColorDarkGary, curChampion->_name);
_vm->_menuMan->drawActionIcon(champIndex);
clearFlag(curChampion->_attributes, k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x0200_ChampionAttributeLoad | k0x0400_ChampionAttributeIcon | k0x0800_ChampionAttributePanel | k0x1000_ChampionAttributeStatusBox | k0x2000_ChampionAttributeWounds | k0x4000_ChampionAttributeViewport | k0x8000_ChampionAttributeActionHand);
@ -2172,13 +2172,13 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
Color nameColor = (champIndex == _leaderIndex) ? k9_ColorGold : k13_ColorLightestGray;
if (isInventoryChampion) {
char *championName = curChampion->_name;
_vm->_textMan->f52_printToViewport(3, 7, nameColor, championName);
_vm->_textMan->printToViewport(3, 7, nameColor, championName);
int16 championTitleX = 6 * strlen(championName) + 3;
char titleFirstCharacter = curChampion->_title[0];
if ((titleFirstCharacter != ',') && (titleFirstCharacter != ';') && (titleFirstCharacter != '-'))
championTitleX += 6;
_vm->_textMan->f52_printToViewport(championTitleX, 7, nameColor, curChampion->_title);
_vm->_textMan->printToViewport(championTitleX, 7, nameColor, curChampion->_title);
setFlag(championAttributes, k0x4000_ChampionAttributeViewport);
} else {
Box box;
@ -2187,7 +2187,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
box._x1 = championStatusBoxX;
box._x2 = box._x1 + 42;
_vm->_displayMan->fillScreenBox(box, k1_ColorDarkGary);
_vm->_textMan->f53_printToLogicalScreen(championStatusBoxX + 1, 5, nameColor, k1_ColorDarkGary, curChampion->_name);
_vm->_textMan->printToLogicalScreen(championStatusBoxX + 1, 5, nameColor, k1_ColorDarkGary, curChampion->_name);
}
}
if (getFlag(championAttributes, k0x0100_ChampionAttributeStatistics)) {
@ -2231,9 +2231,9 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
switch (_vm->getGameLanguage()) { // localized
default:
case Common::EN_ANY: _vm->_textMan->f52_printToViewport(104, 132, loadColor, "LOAD "); break;
case Common::DE_DEU: _vm->_textMan->f52_printToViewport(104, 132, loadColor, "LAST "); break;
case Common::FR_FRA: _vm->_textMan->f52_printToViewport(104, 132, loadColor, "CHARGE "); break;
case Common::EN_ANY: _vm->_textMan->printToViewport(104, 132, loadColor, "LOAD "); break;
case Common::DE_DEU: _vm->_textMan->printToViewport(104, 132, loadColor, "LAST "); break;
case Common::FR_FRA: _vm->_textMan->printToViewport(104, 132, loadColor, "CHARGE "); break;
}
maxLoad = curChampion->_load / 10;
@ -2252,7 +2252,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
maxLoad = (getMaximumLoad(curChampion) + 5) / 10;
strcat(_vm->_stringBuildBuffer, getStringFromInteger(maxLoad, true, 3).c_str());
strcat(_vm->_stringBuildBuffer, " KG");
_vm->_textMan->f52_printToViewport(148, 132, loadColor, _vm->_stringBuildBuffer);
_vm->_textMan->printToViewport(148, 132, loadColor, _vm->_stringBuildBuffer);
setFlag(championAttributes, k0x4000_ChampionAttributeViewport);
}
uint16 championIconIndex = getChampionIconIndex(curChampion->_cell, _vm->_dungeonMan->_partyDir);
@ -2389,8 +2389,8 @@ void ChampionMan::renameChampion(Champion* champ) {
_vm->_displayMan->fillBoxBitmap(_vm->_displayMan->_bitmapViewport, displayBox, k12_ColorDarkestGray, k112_byteWidthViewport, k136_heightViewport);
_vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k27_PanelRenameChampionIndice), _vm->_inventoryMan->_boxPanel, k72_byteWidth, k4_ColorCyan, 73);
_vm->_textMan->f52_printToViewport(177, 58, k13_ColorLightestGray, "_______");
_vm->_textMan->f52_printToViewport(105, 76, k13_ColorLightestGray, "___________________");
_vm->_textMan->printToViewport(177, 58, k13_ColorLightestGray, "_______");
_vm->_textMan->printToViewport(105, 76, k13_ColorLightestGray, "___________________");
_vm->_eventMan->showMouse();
_vm->_displayMan->drawViewport(k0_viewportNotDungeonView);
_vm->_eventMan->setMousePointerToNormal(k0_pointerArrow);
@ -2407,7 +2407,7 @@ void ChampionMan::renameChampion(Champion* champ) {
bool championTitleIsFull = ((renamedChampionStringMode == k2_RENAME_CHAMPION_TITLE) && (curCharacterIndex == 19));
if (!championTitleIsFull) {
_vm->_eventMan->showMouse();
_vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, k9_ColorGold, k12_ColorDarkestGray, underscoreCharacterString, k200_heightScreen);
_vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, k9_ColorGold, k12_ColorDarkestGray, underscoreCharacterString, k200_heightScreen);
_vm->_eventMan->hideMouse();
}
@ -2492,7 +2492,7 @@ void ChampionMan::renameChampion(Champion* champ) {
if (!championTitleIsFull) {
renameChampionInputCharacterString[0] = curCharacter;
_vm->_eventMan->showMouse();
_vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, k13_ColorLightestGray, k12_ColorDarkestGray, renameChampionInputCharacterString, k200_heightScreen);
_vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, k13_ColorLightestGray, k12_ColorDarkestGray, renameChampionInputCharacterString, k200_heightScreen);
_vm->_eventMan->hideMouse();
renamedChampionString[curCharacterIndex++] = curCharacter;
renamedChampionString[curCharacterIndex] = '\0';
@ -2509,7 +2509,7 @@ void ChampionMan::renameChampion(Champion* champ) {
} else if (curCharacter == '\r') { // Carriage return
if ((renamedChampionStringMode == k1_RENAME_CHAMPION_NAME) && (curCharacterIndex > 0)) {
_vm->_eventMan->showMouse();
_vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, k13_ColorLightestGray, k12_ColorDarkestGray, underscoreCharacterString, k200_heightScreen);
_vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, k13_ColorLightestGray, k12_ColorDarkestGray, underscoreCharacterString, k200_heightScreen);
_vm->_eventMan->hideMouse();
renamedChampionStringMode = k2_RENAME_CHAMPION_TITLE;
renamedChampionString = champ->_title;
@ -2523,7 +2523,7 @@ void ChampionMan::renameChampion(Champion* champ) {
if (!championTitleIsFull) {
_vm->_eventMan->showMouse();
_vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, k13_ColorLightestGray, k12_ColorDarkestGray, underscoreCharacterString, k200_heightScreen);
_vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, k13_ColorLightestGray, k12_ColorDarkestGray, underscoreCharacterString, k200_heightScreen);
_vm->_eventMan->hideMouse();
}
if (curCharacterIndex == 0) {

View File

@ -47,7 +47,7 @@ void DialogMan::dialogDraw(const char *msg1, const char *msg2, const char *choic
_vm->_displayMan->loadIntoBitmap(k0_dialogBoxGraphicIndice, _vm->_displayMan->_bitmapViewport);
//Strangerke: the version should be replaced by a ScummVM/RogueVM (?) string
// TODO: replace with ScummVM version string
_vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 192, 7, k2_ColorLightGray, k1_ColorDarkGary, "V2.2", k136_heightViewport);
_vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 192, 7, k2_ColorLightGray, k1_ColorDarkGary, "V2.2", k136_heightViewport);
int16 choiceCount = 1;
if (choice2)
choiceCount++;
@ -94,14 +94,14 @@ void DialogMan::dialogDraw(const char *msg1, const char *msg2, const char *choic
if (isMessageOnTwoLines(msg1, L1312_ac_StringPart1, L1313_ac_StringPart2)) {
textPosY = 21;
textPosX = 113 - ((strlen(L1312_ac_StringPart1) * 6) >> 1);
_vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k11_ColorYellow, k5_ColorLightBrown, L1312_ac_StringPart1, k136_heightViewport);
_vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k11_ColorYellow, k5_ColorLightBrown, L1312_ac_StringPart1, k136_heightViewport);
textPosY += 8;
textPosX = 113 - ((strlen(L1313_ac_StringPart2) * 6) >> 1);
_vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k11_ColorYellow, k5_ColorLightBrown, L1313_ac_StringPart2, k136_heightViewport);
_vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k11_ColorYellow, k5_ColorLightBrown, L1313_ac_StringPart2, k136_heightViewport);
textPosY += 8;
} else {
textPosX = 113 - ((strlen(msg1) * 6) >> 1);
_vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k11_ColorYellow, k5_ColorLightBrown, msg1, k136_heightViewport);
_vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k11_ColorYellow, k5_ColorLightBrown, msg1, k136_heightViewport);
textPosY += 8;
}
}
@ -110,13 +110,13 @@ void DialogMan::dialogDraw(const char *msg1, const char *msg2, const char *choic
char L1313_ac_StringPart2[70];
if (isMessageOnTwoLines(msg2, L1312_ac_StringPart1, L1313_ac_StringPart2)) {
textPosX = 113 - ((strlen(L1312_ac_StringPart1) * 6) >> 1);
_vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k9_ColorGold, k5_ColorLightBrown, L1312_ac_StringPart1, k136_heightViewport);
_vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k9_ColorGold, k5_ColorLightBrown, L1312_ac_StringPart1, k136_heightViewport);
textPosY += 8;
textPosX = 113 - ((strlen(L1313_ac_StringPart2) * 6) >> 1);
_vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k9_ColorGold, k5_ColorLightBrown, L1313_ac_StringPart2, k136_heightViewport);
_vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k9_ColorGold, k5_ColorLightBrown, L1313_ac_StringPart2, k136_heightViewport);
} else {
textPosX = 113 - ((strlen(msg2) * 6) >> 1);
_vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k9_ColorGold, k5_ColorLightBrown, msg2, k136_heightViewport);
_vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k9_ColorGold, k5_ColorLightBrown, msg2, k136_heightViewport);
}
}
if (screenDialog) {
@ -143,7 +143,7 @@ void DialogMan::dialogDraw(const char *msg1, const char *msg2, const char *choic
void DialogMan::printCenteredChoice(byte *bitmap, const char *str, int16 posX, int16 posY) {
if (str) {
posX -= (strlen(str) * 6) >> 1;
_vm->_textMan->f40_printTextToBitmap(bitmap, k112_byteWidthViewport, posX, posY, k9_ColorGold, k5_ColorLightBrown, str, k136_heightViewport);
_vm->_textMan->printTextToBitmap(bitmap, k112_byteWidthViewport, posX, posY, k9_ColorGold, k5_ColorLightBrown, str, k136_heightViewport);
}
}

View File

@ -272,12 +272,12 @@ void DMEngine::initializeGame() {
_displayMan->loadFloorSet(k0_FloorSetStone);
_displayMan->loadWallSet(k0_WallSetStone);
_sound->f503_loadSounds(); // @ F0506_AMIGA_AllocateData
_sound->loadSounds(); // @ F0506_AMIGA_AllocateData
if (!ConfMan.hasKey("save_slot")) // skip drawing title if loading from launcher
drawTittle();
_textMan->f54_textInitialize();
_textMan->initialize();
_objectMan->loadObjectNames();
_eventMan->initMouse();
@ -443,7 +443,7 @@ void DMEngine::gameloop() {
_newPartyMapIndex = kM1_mapIndexNone;
_eventMan->discardAllInput();
}
_timeline->f261_processTimeline();
_timeline->processTimeline();
if (_newPartyMapIndex == kM1_mapIndexNone)
break;
@ -468,7 +468,7 @@ void DMEngine::gameloop() {
}
}
_eventMan->highlightBoxDisable();
_sound->f65_playPendingSound();
_sound->playPendingSound();
_championMan->applyAndDrawPendingDamageAndWounds();
if (_championMan->_partyDead)
break;
@ -492,7 +492,7 @@ void DMEngine::gameloop() {
if (_projectileDisableMovementTicks)
_projectileDisableMovementTicks--;
_textMan->f44_messageAreaClearExpiredRows();
_textMan->clearExpiredRows();
_stopWaitingForPlayerInput = false;
uint16 vblankCounter = 0;
do {
@ -581,7 +581,7 @@ void DMEngine::processEntrance() {
} while (_newGameFl == k202_CommandEntranceDrawCredits);
//Strangerke: CHECKME: Earlier versions were using G0566_puc_Graphic534_Sound01Switch
_sound->f060_SOUND_Play(k01_soundSWITCH, 112, 0x40, 0x40);
_sound->play(k01_soundSWITCH, 112, 0x40, 0x40);
delay(20);
_eventMan->showMouse();
if (_newGameFl)
@ -634,7 +634,7 @@ void DMEngine::endGame(bool doNotDrawCreditsOnly) {
_eventMan->_primaryKeyboardInput = nullptr;
_eventMan->_secondaryKeyboardInput = nullptr;
if (doNotDrawCreditsOnly && !_gameWon) {
_sound->f064_SOUND_RequestPlay_CPSD(k06_soundSCREAM, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY, k0_soundModePlayImmediately);
_sound->requestPlay(k06_soundSCREAM, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY, k0_soundModePlayImmediately);
delay(240);
}
@ -666,13 +666,13 @@ void DMEngine::endGame(bool doNotDrawCreditsOnly) {
Champion *curChampion = &_championMan->_champions[championIndex];
_displayMan->blitToScreen(_displayMan->getNativeBitmapOrGraphic(k208_wallOrn_43_champMirror), &championMirrorBox, k32_byteWidth, k10_ColorFlesh, 43);
_displayMan->blitToScreen(curChampion->_portrait, &championPortraitBox, k16_byteWidth, k1_ColorDarkGary, 29);
_textMan->f443_endgamePrintString(87, textPosY += 14, k9_ColorGold, curChampion->_name);
_textMan->printEndGameString(87, textPosY += 14, k9_ColorGold, curChampion->_name);
int textPosX = (6 * strlen(curChampion->_name)) + 87;
char championTitleFirstCharacter = curChampion->_title[0];
if ((championTitleFirstCharacter != ',') && (championTitleFirstCharacter != ';') && (championTitleFirstCharacter != '-'))
textPosX += 6;
_textMan->f443_endgamePrintString(textPosX, textPosY++, k9_ColorGold, curChampion->_title);
_textMan->printEndGameString(textPosX, textPosY++, k9_ColorGold, curChampion->_title);
for (int16 idx = k0_ChampionSkillFighter; idx <= k3_ChampionSkillWizard; idx++) {
uint16 skillLevel = MIN<uint16>(16, _championMan->getSkillLevel(championIndex, idx | (k0x4000_IgnoreObjectModifiers | k0x8000_IgnoreTemporaryExperience)));
if (skillLevel == 1)
@ -682,7 +682,7 @@ void DMEngine::endGame(bool doNotDrawCreditsOnly) {
strcpy(displStr, _inventoryMan->_skillLevelNames[skillLevel - 2]);
strcat(displStr, " ");
strcat(displStr, _championMan->_baseSkillName[idx]);
_textMan->f443_endgamePrintString(105, textPosY = textPosY + 8, k13_ColorLightestGray, displStr);
_textMan->printEndGameString(105, textPosY = textPosY + 8, k13_ColorLightestGray, displStr);
}
championMirrorBox._y1 += 48;
championMirrorBox._y2 += 48;
@ -714,9 +714,9 @@ T0444017:
switch (getGameLanguage()) { // localized
default:
case Common::EN_ANY: _textMan->f53_printToLogicalScreen(110, 154, k4_ColorCyan, k0_ColorBlack, "RESTART THIS GAME"); break;
case Common::DE_DEU: _textMan->f53_printToLogicalScreen(110, 154, k4_ColorCyan, k0_ColorBlack, "DIESES SPIEL NEU STARTEN"); break;
case Common::FR_FRA: _textMan->f53_printToLogicalScreen(110, 154, k4_ColorCyan, k0_ColorBlack, "RECOMMENCER CE JEU"); break;
case Common::EN_ANY: _textMan->printToLogicalScreen(110, 154, k4_ColorCyan, k0_ColorBlack, "RESTART THIS GAME"); break;
case Common::DE_DEU: _textMan->printToLogicalScreen(110, 154, k4_ColorCyan, k0_ColorBlack, "DIESES SPIEL NEU STARTEN"); break;
case Common::FR_FRA: _textMan->printToLogicalScreen(110, 154, k4_ColorCyan, k0_ColorBlack, "RECOMMENCER CE JEU"); break;
}
curPalette[1] = D03_RGB_PINK;
@ -822,7 +822,7 @@ void DMEngine::openEntranceDoors() {
for (uint16 animStep = 1; animStep < 32; ++animStep) {
if ((animStep % 3) == 1) {
// Strangerke: CHECKME: Earlier versions of the game were using G0565_puc_Graphic535_Sound02DoorRattle instead of k02_soundDOOR_RATTLE 2
_sound->f060_SOUND_Play(k02_soundDOOR_RATTLE, 145, 0x40, 0x40);
_sound->play(k02_soundDOOR_RATTLE, 145, 0x40, 0x40);
}
_displayMan->blitToScreen(_savedScreenForOpenEntranceDoors, &screenBox, 160, kM1_ColorNoTransparency, 200);
@ -967,7 +967,7 @@ void DMEngine::fuseSequnce() {
_championMan->_party._magicalLightAmount = 200;
_inventoryMan->setDungeonViewPalette();
_championMan->_party._fireShieldDefense = _championMan->_party._spellShieldDefense = _championMan->_party._shieldDefense = 100;
_timeline->f260_timelineRefreshAllChampionStatusBoxes();
_timeline->refreshAllChampionStatusBoxes();
fuseSequenceUpdate();
L1431_i_LordChaosMapX = _dungeonMan->_partyMapX;
L1432_i_LordChaosMapY = _dungeonMan->_partyMapY;
@ -1005,7 +1005,7 @@ T0446002:
_projexpl->createExplosion(Thing::_explFireBall, AL1424_i_Attack, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k255_CreatureTypeSingleCenteredCreature);
fuseSequenceUpdate();
}
_sound->f064_SOUND_RequestPlay_CPSD(k17_soundBUZZ, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k1_soundModePlayIfPrioritized);
_sound->requestPlay(k17_soundBUZZ, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k1_soundModePlayIfPrioritized);
L1428_ps_Group->_type = k25_CreatureTypeLordOrder;
fuseSequenceUpdate();
for (AL1424_i_Attack = 55; AL1424_i_Attack <= 255; AL1424_i_Attack += 40) {
@ -1014,7 +1014,7 @@ T0446002:
}
for (AL1425_i_CycleCount = 4; --AL1425_i_CycleCount; ) {
for (AL1424_i_CreatureTypeSwitchCount = 5; --AL1424_i_CreatureTypeSwitchCount; ) {
_sound->f064_SOUND_RequestPlay_CPSD(k17_soundBUZZ, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k1_soundModePlayIfPrioritized);
_sound->requestPlay(k17_soundBUZZ, L1431_i_LordChaosMapX, L1432_i_LordChaosMapY, k1_soundModePlayIfPrioritized);
L1428_ps_Group->_type = (AL1424_i_CreatureTypeSwitchCount & 0x0001) ? k25_CreatureTypeLordOrder : k23_CreatureTypeLordChaos;
for (AL1426_i_FuseSequenceUpdateCount = AL1425_i_CycleCount; AL1426_i_FuseSequenceUpdateCount--; fuseSequenceUpdate());
}
@ -1049,9 +1049,9 @@ T0446002:
for (AL1425_i_TextStringThingIndex = 0; AL1425_i_TextStringThingIndex < AL1426_i_TextStringThingCount; AL1425_i_TextStringThingIndex++) {
_dungeonMan->decodeText(L1436_ac_String, L1435_aT_TextStringThings[AL1425_i_TextStringThingIndex], (TextType)(k1_TextTypeMessage | k0x8000_DecodeEvenIfInvisible));
if (L1436_ac_String[1] == L1434_c_TextFirstCharacter) {
_textMan->f43_messageAreaClearAllRows();
_textMan->clearAllRows();
L1436_ac_String[1] = '\n'; /* New line */
_textMan->f47_messageAreaPrintMessage(k15_ColorWhite, &L1436_ac_String[1]);
_textMan->printMessage(k15_ColorWhite, &L1436_ac_String[1]);
fuseSequenceUpdate();
delay(780);
L1434_c_TextFirstCharacter++;
@ -1071,9 +1071,9 @@ T0446002:
}
void DMEngine::fuseSequenceUpdate() {
_timeline->f261_processTimeline();
_timeline->processTimeline();
_displayMan->drawDungeon(_dungeonMan->_partyDir, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY);
_sound->f65_playPendingSound();
_sound->playPendingSound();
_eventMan->discardAllInput();
_displayMan->updateScreen();
delay(2);

View File

@ -672,7 +672,7 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
_dungeonTextData[i] = dunDataStream->readUint16BE();
if (_vm->_newGameFl)
_vm->_timeline->_g369_eventMaxCount = 100;
_vm->_timeline->_eventMaxCount = 100;
// load things
for (uint16 thingType = k0_DoorThingType; thingType < k16_ThingTypeTotal; ++thingType) {
@ -710,7 +710,7 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
if (_vm->_newGameFl) {
if ((thingType == k4_GroupThingType) || thingType >= k14_ProjectileThingType)
_vm->_timeline->_g369_eventMaxCount += _dungeonFileHeader._thingCounts[thingType];
_vm->_timeline->_eventMaxCount += _dungeonFileHeader._thingCounts[thingType];
for (uint16 i = 0; i < additionalThingCounts[thingType]; ++i)
(_thingData[thingType] + (thingCount + i) * thingStoreWordCount)[0] = Thing::_none.toUint16();

View File

@ -867,15 +867,15 @@ void EventManager::processCommandQueue() {
switch (_vm->getGameLanguage()) { // localized
default:
case Common::EN_ANY:
_vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 81, 69, k4_ColorCyan, k0_ColorBlack,
_vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 81, 69, k4_ColorCyan, k0_ColorBlack,
"GAME FROZEN", k136_heightViewport);
break;
case Common::DE_DEU:
_vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 66, 69, k4_ColorCyan, k0_ColorBlack,
_vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 66, 69, k4_ColorCyan, k0_ColorBlack,
"SPIEL ANGEHALTEN", k136_heightViewport);
break;
case Common::FR_FRA:
_vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 84, 69, k4_ColorCyan, k0_ColorBlack,
_vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 84, 69, k4_ColorCyan, k0_ColorBlack,
"JEU BLOQUE", k136_heightViewport);
break;
}
@ -1014,7 +1014,7 @@ void EventManager::commandMoveParty(CommandType cmdType) {
damage |= _vm->_championMan->addPendingDamageAndWounds_getDamage(L1125_i_SecondDamagedChampionIndex, 1, k0x0008_ChampionWoundTorso | k0x0010_ChampionWoundLegs, k2_attackType_SELF);
if (damage)
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k18_soundPARTY_DAMAGED, partyMapX, partyMapY, k0_soundModePlayImmediately);
_vm->_sound->requestPlay(k18_soundPARTY_DAMAGED, partyMapX, partyMapY, k0_soundModePlayImmediately);
} else {
isMovementBlocked = (_vm->_groupMan->groupGetThing(partyMapX, partyMapY) != Thing::_endOfList);
if (isMovementBlocked)
@ -1160,7 +1160,7 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY
Junk *junkPtr = (Junk*)_vm->_dungeonMan->getSquareFirstThingData(L1155_i_MapX, L1156_i_MapY);
if ((((Door*)junkPtr)->hasButton()) && _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn].isPointInside(posX, posY - 33)) {
_vm->_stopWaitingForPlayerInput = true;
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k01_soundSWITCH, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(k01_soundSWITCH, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
_vm->_moveSens->addEvent(k10_TMEventTypeDoor, L1155_i_MapX, L1156_i_MapY, 0, k2_SensorEffToggle, _vm->_gameTime + 1);
return;
}
@ -1292,20 +1292,20 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
} else
_vm->_menuMan->drawSpellAreaControls(champMan._magicCasterChampionIndex);
_vm->_textMan->f51_messageAreaPrintLineFeed();
_vm->_textMan->printLineFeed();
Color champColor = _vm->_championMan->_championColor[championIndex];
_vm->_textMan->f47_messageAreaPrintMessage(champColor, champ->_name);
_vm->_textMan->printMessage(champColor, champ->_name);
switch (_vm->getGameLanguage()) { // localized
default:
case Common::EN_ANY:
_vm->_textMan->f47_messageAreaPrintMessage(champColor, (commandType == k160_CommandClickInPanelResurrect) ? " RESURRECTED." : " REINCARNATED.");
_vm->_textMan->printMessage(champColor, (commandType == k160_CommandClickInPanelResurrect) ? " RESURRECTED." : " REINCARNATED.");
break;
case Common::DE_DEU:
_vm->_textMan->f47_messageAreaPrintMessage(champColor, (commandType == k160_CommandClickInPanelResurrect) ? " VOM TODE ERWECKT." : " REINKARNIERT.");
_vm->_textMan->printMessage(champColor, (commandType == k160_CommandClickInPanelResurrect) ? " VOM TODE ERWECKT." : " REINKARNIERT.");
break;
case Common::FR_FRA:
_vm->_textMan->f47_messageAreaPrintMessage(champColor, (commandType == k160_CommandClickInPanelResurrect) ? " RESSUSCITE." : " REINCARNE.");
_vm->_textMan->printMessage(champColor, (commandType == k160_CommandClickInPanelResurrect) ? " RESSUSCITE." : " REINCARNE.");
break;
}
@ -1390,7 +1390,7 @@ void EventManager::processType80_clickInDungeonViewDropLeaderHandObject(uint16 v
newEvent._B._location._mapY = mapY;
newEvent._C.A._cell = currCell;
newEvent._C.A._effect = k2_SensorEffToggle;
_vm->_timeline->f238_addEventGetEventIndex(&newEvent);
_vm->_timeline->addEventGetEventIndex(&newEvent);
}
_vm->_stopWaitingForPlayerInput = true;
}
@ -1407,13 +1407,13 @@ void EventManager::drawSleepScreen() {
switch (_vm->getGameLanguage()) { // localized
default:
case Common::EN_ANY:
_vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 93, 69, k4_ColorCyan, k0_ColorBlack, "WAKE UP", k136_heightViewport);
_vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 93, 69, k4_ColorCyan, k0_ColorBlack, "WAKE UP", k136_heightViewport);
break;
case Common::DE_DEU:
_vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 96, 69, k4_ColorCyan, k0_ColorBlack, "WECKEN", k136_heightViewport);
_vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 96, 69, k4_ColorCyan, k0_ColorBlack, "WECKEN", k136_heightViewport);
break;
case Common::FR_FRA:
_vm->_textMan->f40_printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 72, 69, k4_ColorCyan, k0_ColorBlack, "REVEILLEZ-VOUS", k136_heightViewport);
_vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 72, 69, k4_ColorCyan, k0_ColorBlack, "REVEILLEZ-VOUS", k136_heightViewport);
break;
}
}

View File

@ -3511,7 +3511,7 @@ T0115129_DrawProjectiles:
if (projectileAspectType == k3_ProjectileAspectHasNone) {
projectileBitmapIndexDelta = 0;
flipVertical = flipHorizontal = false;
} else if (isOrientedWestEast(Direction(projectileDirection = _vm->_timeline->_g370_events[projectile->_eventIndex]._C._projectile.getDir())) != isOrientedWestEast(directionParam)) {
} else if (isOrientedWestEast(Direction(projectileDirection = _vm->_timeline->_events[projectile->_eventIndex]._C._projectile.getDir())) != isOrientedWestEast(directionParam)) {
if (projectileAspectType == k2_ProjectileAspectHasRotation)
projectileBitmapIndexDelta = 1;
else

View File

@ -159,7 +159,7 @@ void GroupMan::dropGroupPossessions(int16 mapX, int16 mapY, Thing groupThing, in
} while ((currentThing = nextThing) != Thing::_endOfList);
if (mode >= k0_soundModePlayImmediately)
_vm->_sound->f064_SOUND_RequestPlay_CPSD(L0371_B_WeaponDropped ? k00_soundMETALLIC_THUD : k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, mapX, mapY, mode);
_vm->_sound->requestPlay(L0371_B_WeaponDropped ? k00_soundMETALLIC_THUD : k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, mapX, mapY, mode);
}
}
@ -287,7 +287,7 @@ void GroupMan::dropCreatureFixedPossessions(uint16 creatureType, int16 mapX, int
_vm->_moveSens->getMoveResult(nextUnusedThing, kM1_MapXNotOnASquare, 0, mapX, mapY);
currFixedPossession = *fixedPossessions++;
}
_vm->_sound->f064_SOUND_RequestPlay_CPSD(weaponDropped ? k00_soundMETALLIC_THUD : k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, mapX, mapY, mode);
_vm->_sound->requestPlay(weaponDropped ? k00_soundMETALLIC_THUD : k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, mapX, mapY, mode);
}
int16 GroupMan::getDirsWhereDestIsVisibleFromSource(int16 srcMapX, int16 srcMapY, int16 destMapX, int16 destMapY) {
@ -374,7 +374,7 @@ bool GroupMan::groupIsDoorDestoryedByAttack(uint16 mapX, uint16 mapY, int16 atta
L0575_s_Event._priority = 0;
L0575_s_Event._B._location._mapX = mapX;
L0575_s_Event._B._location._mapY = mapY;
_vm->_timeline->f238_addEventGetEventIndex(&L0575_s_Event);
_vm->_timeline->addEventGetEventIndex(&L0575_s_Event);
} else {
((Square *)L0574_puc_Square)->setDoorState(k5_doorState_DESTROYED);
}
@ -443,8 +443,8 @@ int16 GroupMan::groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex
L0378_ps_ActiveGroup = &_activeGroups[group->getActiveGroupIndex()];
if (group->getBehaviour() == k6_behavior_ATTACK) {
L0377_ps_Event = _vm->_timeline->_g370_events;
for (AL0374_ui_EventIndex = 0; AL0374_ui_EventIndex < _vm->_timeline->_g369_eventMaxCount; AL0374_ui_EventIndex++) {
L0377_ps_Event = _vm->_timeline->_events;
for (AL0374_ui_EventIndex = 0; AL0374_ui_EventIndex < _vm->_timeline->_eventMaxCount; AL0374_ui_EventIndex++) {
if ((getMap(L0377_ps_Event->_mapTime) == _vm->_dungeonMan->_currMapIndex) &&
(L0377_ps_Event->_B._location._mapX == mapX) &&
(L0377_ps_Event->_B._location._mapY == mapY) &&
@ -456,11 +456,11 @@ int16 GroupMan::groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex
AL0375_ui_EventType -= k38_TMEventTypeUpdateBehaviour_0; /* Get creature index for events 38 to 41 */
}
if (AL0375_ui_NextCreatureIndex == creatureIndex) {
_vm->_timeline->f237_deleteEvent(AL0374_ui_EventIndex);
_vm->_timeline->deleteEvent(AL0374_ui_EventIndex);
} else {
if (AL0375_ui_NextCreatureIndex > creatureIndex) {
L0377_ps_Event->_type -= 1;
_vm->_timeline->f236_fixChronology(_vm->_timeline->f235_getIndex(AL0374_ui_EventIndex));
_vm->_timeline->fixChronology(_vm->_timeline->getIndex(AL0374_ui_EventIndex));
}
}
}
@ -531,12 +531,12 @@ void GroupMan::groupDeleteEvents(int16 mapX, int16 mapY) {
TimelineEvent *L0336_ps_Event;
L0336_ps_Event = _vm->_timeline->_g370_events;
for (L0334_i_EventIndex = 0; L0334_i_EventIndex < _vm->_timeline->_g369_eventMaxCount; L0334_i_EventIndex++) {
L0336_ps_Event = _vm->_timeline->_events;
for (L0334_i_EventIndex = 0; L0334_i_EventIndex < _vm->_timeline->_eventMaxCount; L0334_i_EventIndex++) {
if ((getMap(L0336_ps_Event->_mapTime) == _vm->_dungeonMan->_currMapIndex) &&
((L0335_ui_EventType = L0336_ps_Event->_type) > k29_TMEventTypeGroupReactionDangerOnSquare - 1) && (L0335_ui_EventType < k41_TMEventTypeUpdateBehaviour_3 + 1) &&
(L0336_ps_Event->_B._location._mapX == mapX) && (L0336_ps_Event->_B._location._mapY == mapY)) {
_vm->_timeline->f237_deleteEvent(L0334_i_EventIndex);
_vm->_timeline->deleteEvent(L0334_i_EventIndex);
}
L0336_ps_Event++;
}
@ -664,7 +664,7 @@ void GroupMan::processEvents29to41(int16 eventMapX, int16 eventMapY, int16 event
/* BUG0_68 A group moves or acts with a wrong timing. Event is added below but L0465_s_NextEvent.C.Ticks has not been initialized. No consequence while the group is not on the party map. When the party enters the group map the first group event may have a wrong timing */
T0209005_AddEventAndReturn:
L0465_s_NextEvent._mapTime += AL0446_i_Ticks;
_vm->_timeline->f238_addEventGetEventIndex(&L0465_s_NextEvent);
_vm->_timeline->addEventGetEventIndex(&L0465_s_NextEvent);
goto T0209139_Return;
}
/* If the creature is Lord Chaos then ignore the event if the game is won. Initialize data to analyze Fluxcages */
@ -928,7 +928,7 @@ T0209089_DoubleSquareMove:
AL0450_i_DestinationMapX = eventMapX;
AL0451_i_DestinationMapY = eventMapY;
AL0450_i_DestinationMapX += _vm->_dirIntoStepCountEast[AL0446_i_Direction] * 2, AL0451_i_DestinationMapY += _vm->_dirIntoStepCountNorth[AL0446_i_Direction] * 2;
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k17_soundBUZZ, AL0450_i_DestinationMapX, AL0451_i_DestinationMapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(k17_soundBUZZ, AL0450_i_DestinationMapX, AL0451_i_DestinationMapY, k1_soundModePlayIfPrioritized);
goto T0209061_MoveGroup;
}
}
@ -1319,7 +1319,7 @@ int32 GroupMan::getCreatureAspectUpdateTime(ActiveGroup *activeGroup, int16 crea
if (getFlag(AL0326_ui_Aspect, k0x0080_MaskActiveGroupIsAttacking) && (L0331_ui_CreatureType == k18_CreatureTypeAnimatedArmourDethKnight)) {
if (_vm->getRandomNumber(2)) {
toggleFlag(AL0326_ui_Aspect, k0x0040_MaskActiveGroupFlipBitmap);
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _currentGroupMapX, _currentGroupMapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _currentGroupMapX, _currentGroupMapY, k1_soundModePlayIfPrioritized);
}
} else if (!getFlag(AL0326_ui_Aspect, k0x0080_MaskActiveGroupIsAttacking) || !getFlag(L0327_ui_CreatureGraphicInfo, k0x0400_CreatureInfoGraphicMaskFlipDuringAttack)) {
if (_vm->getRandomNumber(2))
@ -1338,7 +1338,7 @@ int32 GroupMan::getCreatureAspectUpdateTime(ActiveGroup *activeGroup, int16 crea
toggleFlag(AL0326_ui_Aspect, k0x0040_MaskActiveGroupFlipBitmap);
L1635_ui_SoundIndex = _vm->_moveSens->getSound(k13_CreatureTypeCouatl);
if (L1635_ui_SoundIndex <= k34_D13_soundCount)
_vm->_sound->f064_SOUND_RequestPlay_CPSD(L1635_ui_SoundIndex, _currentGroupMapX, _currentGroupMapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(L1635_ui_SoundIndex, _currentGroupMapX, _currentGroupMapY, k1_soundModePlayIfPrioritized);
}
} else if (_vm->getRandomNumber(2))
setFlag(AL0326_ui_Aspect, k0x0040_MaskActiveGroupFlipBitmap);
@ -1386,7 +1386,7 @@ void GroupMan::addGroupEvent(TimelineEvent *event, uint32 time) {
} else {
event->_C._ticks = time - filterTime(event->_mapTime);
}
_vm->_timeline->f238_addEventGetEventIndex(event);
_vm->_timeline->addEventGetEventIndex(event);
}
int16 GroupMan::getSmelledPartyPrimaryDirOrdinal(CreatureInfo *creatureInfo, int16 mapY, int16 mapX) {
@ -1526,7 +1526,7 @@ bool GroupMan::isCreatureAttacking(Group *group, int16 mapX, int16 mapY, uint16
AL0440_i_KineticEnergy = (L0441_ps_CreatureInfo->_attack >> 2) + 1;
AL0440_i_KineticEnergy += _vm->getRandomNumber(AL0440_i_KineticEnergy);
AL0440_i_KineticEnergy += _vm->getRandomNumber(AL0440_i_KineticEnergy);
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k13_soundSPELL, mapX, mapY, k0_soundModePlayImmediately);
_vm->_sound->requestPlay(k13_soundSPELL, mapX, mapY, k0_soundModePlayImmediately);
_vm->_projexpl->createProjectile(Thing(AL0437_T_Thing), mapX, mapY, AL0439_i_TargetCell, (Direction)_currGroupPrimaryDirToParty, getBoundedValue((int16)20, AL0440_i_KineticEnergy, (int16)255), L0441_ps_CreatureInfo->_dexterity, 8);
} else {
if (getFlag(L0441_ps_CreatureInfo->_attributes, k0x0010_MaskCreatureInfo_attackAnyChamp)) {
@ -1555,7 +1555,7 @@ bool GroupMan::isCreatureAttacking(Group *group, int16 mapX, int16 mapY, uint16
}
AL0440_i_AttackSoundOrdinal = L0441_ps_CreatureInfo->_attackSoundOrdinal;
if (AL0440_i_AttackSoundOrdinal)
_vm->_sound->f064_SOUND_RequestPlay_CPSD(G0244_auc_Graphic559_CreatureAttackSounds[--AL0440_i_AttackSoundOrdinal], mapX, mapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(G0244_auc_Graphic559_CreatureAttackSounds[--AL0440_i_AttackSoundOrdinal], mapX, mapY, k1_soundModePlayIfPrioritized);
return true;
}
@ -1679,7 +1679,7 @@ int16 GroupMan::getChampionDamage(Group *group, uint16 champIndex) {
AL0558_i_Damage = _vm->_championMan->addPendingDamageAndWounds_getDamage(champIndex, AL0558_i_Attack, AL0561_ui_AllowedWound, L0564_s_CreatureInfo._attackType);
if (AL0558_i_Damage) {
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k09_soundCHAMPION_0_DAMAGED + champIndex, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k2_soundModePlayOneTickLater);
_vm->_sound->requestPlay(k09_soundCHAMPION_0_DAMAGED + champIndex, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k2_soundModePlayOneTickLater);
AL0559_ui_PoisonAttack = L0564_s_CreatureInfo._poisonAttack;
if (AL0559_ui_PoisonAttack && _vm->getRandomNumber(2)) {
@ -1723,7 +1723,7 @@ void GroupMan::startWanedring(int16 mapX, int16 mapY) {
L0333_s_Event._C._ticks = 0;
L0333_s_Event._B._location._mapX = mapX;
L0333_s_Event._B._location._mapY = mapY;
_vm->_timeline->f238_addEventGetEventIndex(&L0333_s_Event);
_vm->_timeline->addEventGetEventIndex(&L0333_s_Event);
}
void GroupMan::addActiveGroup(Thing thing, int16 mapX, int16 mapY) {
@ -1853,7 +1853,7 @@ Thing GroupMan::groupGetGenerated(int16 creatureType, int16 healthMultiplier, ui
if (_vm->_moveSens->getMoveResult(L0349_T_GroupThing, kM1_MapXNotOnASquare, 0, mapX, mapY)) { /* If F0267_MOVE_GetMoveResult_CPSCE returns true then the group was either killed by a projectile impact (in which case the thing data was marked as unused) or the party is on the destination square and an event is created to move the creature into the dungeon later (in which case the thing is referenced in the event) */
return Thing::_none;
}
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k17_soundBUZZ, mapX, mapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(k17_soundBUZZ, mapX, mapY, k1_soundModePlayIfPrioritized);
return L0349_T_GroupThing;
}
@ -1995,7 +1995,7 @@ void GroupMan::fluxCageAction(int16 mapX, int16 mapY) {
L0547_s_Event._B._location._mapX = mapX;
L0547_s_Event._B._location._mapY = mapY;
L0547_s_Event._B._location._mapY = mapY;
_vm->_timeline->f238_addEventGetEventIndex(&L0547_s_Event);
_vm->_timeline->addEventGetEventIndex(&L0547_s_Event);
if (isLordChaosOnSquare(mapX, mapY - 1)) {
mapY--;
AL0546_i_FluxcageCount = isFluxcageOnSquare(mapX + 1, mapY);

View File

@ -142,20 +142,20 @@ void InventoryMan::toggleInventory(ChampionIndex championIndex) {
switch (_vm->getGameLanguage()) { // localized
default:
case Common::EN_ANY:
_vm->_textMan->f52_printToViewport(5, 116, k13_ColorLightestGray, "HEALTH");
_vm->_textMan->f52_printToViewport(5, 124, k13_ColorLightestGray, "STAMINA");
_vm->_textMan->printToViewport(5, 116, k13_ColorLightestGray, "HEALTH");
_vm->_textMan->printToViewport(5, 124, k13_ColorLightestGray, "STAMINA");
break;
case Common::DE_DEU:
_vm->_textMan->f52_printToViewport(5, 116, k13_ColorLightestGray, "GESUND");
_vm->_textMan->f52_printToViewport(5, 124, k13_ColorLightestGray, "KRAFT");
_vm->_textMan->printToViewport(5, 116, k13_ColorLightestGray, "GESUND");
_vm->_textMan->printToViewport(5, 124, k13_ColorLightestGray, "KRAFT");
break;
case Common::FR_FRA:
_vm->_textMan->f52_printToViewport(5, 116, k13_ColorLightestGray, "SANTE");
_vm->_textMan->f52_printToViewport(5, 124, k13_ColorLightestGray, "VIGUEUR");
_vm->_textMan->printToViewport(5, 116, k13_ColorLightestGray, "SANTE");
_vm->_textMan->printToViewport(5, 124, k13_ColorLightestGray, "VIGUEUR");
break;
}
_vm->_textMan->f52_printToViewport(5, 132, k13_ColorLightestGray, "MANA");
_vm->_textMan->printToViewport(5, 132, k13_ColorLightestGray, "MANA");
for (AL1102_ui_SlotIndex = k0_ChampionSlotReadyHand; AL1102_ui_SlotIndex < k30_ChampionSlotChest_1; AL1102_ui_SlotIndex++) {
_vm->_championMan->drawSlot(championIndex, AL1102_ui_SlotIndex);
}
@ -310,7 +310,7 @@ void InventoryMan::drawPanelScrollTextLine(int16 yPos, char* text) {
*iter -= 96;
}
}
_vm->_textMan->f52_printToViewport(162 - (6 * strlen(text) / 2), yPos, k0_ColorBlack, text, k15_ColorWhite);
_vm->_textMan->printToViewport(162 - (6 * strlen(text) / 2), yPos, k0_ColorBlack, text, k15_ColorWhite);
}
void InventoryMan::drawPanelScroll(Scroll* scroll) {
@ -464,7 +464,7 @@ void InventoryMan::drawPanelObjectDescriptionString(const char *descString) {
severalLines = true;
}
_vm->_textMan->f52_printToViewport(_objDescTextXpos, _objDescTextYpos, k13_ColorLightestGray, stringLine);
_vm->_textMan->printToViewport(_objDescTextXpos, _objDescTextYpos, k13_ColorLightestGray, stringLine);
_objDescTextYpos += 7;
if (severalLines) {
severalLines = false;
@ -547,7 +547,7 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {
descString = objMan._objectNames[iconIndex];
}
textMan.f52_printToViewport(134, 68, k13_ColorLightestGray, descString);
textMan.printToViewport(134, 68, k13_ColorLightestGray, descString);
drawIconToViewport(iconIndex, 111, 59);
@ -847,12 +847,12 @@ void InventoryMan::drawChampionSkillsAndStatistics() {
strcpy(L1097_ac_String, _skillLevelNames[AL1092_i_SkillLevel - 2]);
break;
}
_vm->_textMan->f52_printToViewport(108, L1091_i_Y, k13_ColorLightestGray, L1097_ac_String);
_vm->_textMan->printToViewport(108, L1091_i_Y, k13_ColorLightestGray, L1097_ac_String);
L1091_i_Y += 7;
}
L1091_i_Y = 86;
for (AL1090_ui_StatisticIndex = k1_ChampionStatStrength; AL1090_ui_StatisticIndex <= k6_ChampionStatAntifire; AL1090_ui_StatisticIndex++) {
_vm->_textMan->f52_printToViewport(108, L1091_i_Y, k13_ColorLightestGray, G0431_apc_StatisticNames[AL1090_ui_StatisticIndex]);
_vm->_textMan->printToViewport(108, L1091_i_Y, k13_ColorLightestGray, G0431_apc_StatisticNames[AL1090_ui_StatisticIndex]);
AL1092_i_StatisticCurrentValue = L1094_ps_Champion->_statistics[AL1090_ui_StatisticIndex][k1_ChampionStatCurrent];
L1096_ui_StatisticMaximumValue = L1094_ps_Champion->_statistics[AL1090_ui_StatisticIndex][k0_ChampionStatMaximum];
if (AL1092_i_StatisticCurrentValue < L1096_ui_StatisticMaximumValue) {
@ -864,10 +864,10 @@ void InventoryMan::drawChampionSkillsAndStatistics() {
L1095_i_StatisticColor = k13_ColorLightestGray;
}
}
_vm->_textMan->f52_printToViewport(174, L1091_i_Y, (Color)L1095_i_StatisticColor, _vm->_championMan->getStringFromInteger(AL1092_i_StatisticCurrentValue, true, 3).c_str());
_vm->_textMan->printToViewport(174, L1091_i_Y, (Color)L1095_i_StatisticColor, _vm->_championMan->getStringFromInteger(AL1092_i_StatisticCurrentValue, true, 3).c_str());
strcpy(L1097_ac_String, "/");
strcat(L1097_ac_String, _vm->_championMan->getStringFromInteger(L1096_ui_StatisticMaximumValue, true, 3).c_str());
_vm->_textMan->f52_printToViewport(192, L1091_i_Y, k13_ColorLightestGray, L1097_ac_String);
_vm->_textMan->printToViewport(192, L1091_i_Y, k13_ColorLightestGray, L1097_ac_String);
L1091_i_Y += 7;
}
}
@ -1007,7 +1007,7 @@ void InventoryMan::clickOnMouth() {
setMapAndTime(L1084_s_Event._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + (AL1085_ui_AdjustedPotionPower * AL1085_ui_AdjustedPotionPower));
L1084_s_Event._priority = L1080_ui_ChampionIndex;
L1084_s_Event._B._defense = AL1085_ui_AdjustedPotionPower;
_vm->_timeline->f238_addEventGetEventIndex(&L1084_s_Event);
_vm->_timeline->addEventGetEventIndex(&L1084_s_Event);
setFlag(L1083_ps_Champion->_attributes, k0x1000_ChampionAttributeStatusBox);
break;
case k13_PotionTypeEe:
@ -1062,7 +1062,7 @@ void InventoryMan::clickOnMouth() {
_vm->_championMan->_champions[_vm->_championMan->_leaderIndex]._load += _vm->_dungeonMan->getObjectWeight(L1078_T_Thing) - L1089_ui_Weight;
setFlag(_vm->_championMan->_champions[_vm->_championMan->_leaderIndex]._attributes, k0x0200_ChampionAttributeLoad);
}
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k08_soundSWALLOW, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k0_soundModePlayImmediately);
_vm->_sound->requestPlay(k08_soundSWALLOW, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k0_soundModePlayImmediately);
setFlag(L1083_ps_Champion->_attributes, k0x0100_ChampionAttributeStatistics);
if (_panelContent == k0_PanelContentFoodWaterPoisoned) {
setFlag(L1083_ps_Champion->_attributes, k0x0800_ChampionAttributePanel);

View File

@ -99,9 +99,9 @@ LoadgameResponse DMEngine::loadgame(int16 slot) {
_dungeonMan->_partyMapIndex = file->readByte();
_championMan->_leaderIndex = (ChampionIndex)file->readSint16BE();
_championMan->_magicCasterChampionIndex = (ChampionIndex)file->readSint16BE();
_timeline->_g372_eventCount = file->readUint16BE();
_timeline->_g373_firstUnusedEventIndex = file->readUint16BE();
_timeline->_g369_eventMaxCount = file->readUint16BE();
_timeline->_eventCount = file->readUint16BE();
_timeline->_firstUnusedEventIndex = file->readUint16BE();
_timeline->_eventMaxCount = file->readUint16BE();
_groupMan->_currActiveGroupCount = file->readUint16BE();
_projexpl->_lastCreatureAttackTime = file->readSint32BE();
_projexpl->_lastPartyMovementTime = file->readSint32BE();
@ -111,14 +111,14 @@ LoadgameResponse DMEngine::loadgame(int16 slot) {
_championMan->_leaderHandObject = Thing(file->readUint16BE());
_groupMan->_maxActiveGroupCount = file->readUint16BE();
if (!_restartGameRequest) {
_timeline->f233_initTimeline();
_timeline->initTimeline();
_groupMan->initActiveGroups();
}
_groupMan->loadActiveGroupPart(file);
_championMan->loadPartyPart2(file);
_timeline->load3_eventsPart(file);
_timeline->load4_timelinePart(file);
_timeline->loadEventsPart(file);
_timeline->loadTimelinePart(file);
// read sentinel
uint32 sentinel = file->readUint32BE();
@ -129,7 +129,7 @@ LoadgameResponse DMEngine::loadgame(int16 slot) {
delete file;
if (_newGameFl) {
_timeline->f233_initTimeline();
_timeline->initTimeline();
_groupMan->initActiveGroups();
if (L1366_B_FadePalette) {
@ -315,9 +315,9 @@ bool DMEngine::writeCompleteSaveFile(int16 saveSlot, Common::String& saveDescrip
file->writeByte(_dungeonMan->_partyMapIndex);
file->writeSint16BE(_championMan->_leaderIndex);
file->writeSint16BE(_championMan->_magicCasterChampionIndex);
file->writeUint16BE(_timeline->_g372_eventCount);
file->writeUint16BE(_timeline->_g373_firstUnusedEventIndex);
file->writeUint16BE(_timeline->_g369_eventMaxCount);
file->writeUint16BE(_timeline->_eventCount);
file->writeUint16BE(_timeline->_firstUnusedEventIndex);
file->writeUint16BE(_timeline->_eventMaxCount);
file->writeUint16BE(_groupMan->_currActiveGroupCount);
file->writeSint32BE(_projexpl->_lastCreatureAttackTime);
file->writeSint32BE(_projexpl->_lastPartyMovementTime);
@ -332,9 +332,9 @@ bool DMEngine::writeCompleteSaveFile(int16 saveSlot, Common::String& saveDescrip
// write C2_SAVE_PART_PARTY part
_championMan->savePartyPart2(file);
// write C3_SAVE_PART_EVENTS part
_timeline->save3_eventsPart(file);
_timeline->saveEventsPart(file);
// write C4_SAVE_PART_TIMELINE part
_timeline->save4_timelinePart(file);
_timeline->saveTimelinePart(file);
// write sentinel
file->writeUint32BE(0x6f85e3d3);

View File

@ -269,11 +269,11 @@ void MenuMan::drawActionArea() {
box = _boxActionArea1ActionMenu;
dispMan.blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(k10_MenuActionAreaIndice),
&box, k48_byteWidth, kM1_ColorNoTransparency, 45);
textMan.f41_printWithTrailingSpaces(dispMan._bitmapScreen, k160_byteWidthScreen,
textMan.printWithTrailingSpaces(dispMan._bitmapScreen, k160_byteWidthScreen,
235, 83, k0_ColorBlack, k4_ColorCyan, champMan._champions[_vm->ordinalToIndex(champMan._actingChampionOrdinal)]._name,
k7_ChampionNameMaximumLength, k200_heightScreen);
for (uint16 actionListIndex = 0; actionListIndex < 3; actionListIndex++) {
textMan.f41_printWithTrailingSpaces(dispMan._bitmapScreen, k160_byteWidthScreen, 241, 93 + actionListIndex * 12, k4_ColorCyan, k0_ColorBlack,
textMan.printWithTrailingSpaces(dispMan._bitmapScreen, k160_byteWidthScreen, 241, 93 + actionListIndex * 12, k4_ColorCyan, k0_ColorBlack,
getActionName(_actionList._actionIndices[actionListIndex]),
k12_ActionNameMaximumLength, k200_heightScreen);
}
@ -311,7 +311,7 @@ void MenuMan::drawSpellAreaControls(ChampionIndex champIndex) {
switch (champIndex) {
case 0:
_vm->_eventMan->highlightScreenBox(233, 277, 42, 49);
_vm->_textMan->f53_printToLogicalScreen(235, 48, k0_ColorBlack, k4_ColorCyan, champ->_name);
_vm->_textMan->printToLogicalScreen(235, 48, k0_ColorBlack, k4_ColorCyan, champ->_name);
if (_vm->_championMan->_partyChampionCount > 1) {
if (champHP1) {
_vm->_eventMan->highlightScreenBox(280, 291, 42, 48);
@ -335,7 +335,7 @@ T0393003:
_vm->_eventMan->highlightScreenBox(233, 244, 42, 48);
}
_vm->_eventMan->highlightScreenBox(247, 291, 42, 49);
_vm->_textMan->f53_printToLogicalScreen(249, 48, k0_ColorBlack, k4_ColorCyan, champ->_name);
_vm->_textMan->printToLogicalScreen(249, 48, k0_ColorBlack, k4_ColorCyan, champ->_name);
goto T0393002;
case 2:
if (champHP0) {
@ -345,7 +345,7 @@ T0393003:
_vm->_eventMan->highlightScreenBox(247, 258, 42, 48);
}
_vm->_eventMan->highlightScreenBox(261, 305, 42, 49);
_vm->_textMan->f53_printToLogicalScreen(263, 48, k0_ColorBlack, k4_ColorCyan, champ->_name);
_vm->_textMan->printToLogicalScreen(263, 48, k0_ColorBlack, k4_ColorCyan, champ->_name);
goto T0393003;
case 3:
if (champHP0) {
@ -358,7 +358,7 @@ T0393003:
_vm->_eventMan->highlightScreenBox(261, 272, 42, 48);
}
_vm->_eventMan->highlightScreenBox(275, 319, 42, 49);
_vm->_textMan->f53_printToLogicalScreen(277, 48, k0_ColorBlack, k4_ColorCyan, champ->_name);
_vm->_textMan->printToLogicalScreen(277, 48, k0_ColorBlack, k4_ColorCyan, champ->_name);
break;
default:
break;
@ -381,7 +381,7 @@ void MenuMan::buildSpellAreaLine(int16 spellAreaBitmapLine) {
char character = 96 + (6 * L1203_ps_Champion->_symbolStep);
for (uint16 symbolIndex = 0; symbolIndex < 6; symbolIndex++) {
L1204_ac_SpellSymbolString[0] = character++;
_vm->_textMan->f40_printTextToBitmap(_bitmapSpellAreaLine, 48, x += 14, 8, k4_ColorCyan, k0_ColorBlack, L1204_ac_SpellSymbolString, 12);
_vm->_textMan->printTextToBitmap(_bitmapSpellAreaLine, 48, x += 14, 8, k4_ColorCyan, k0_ColorBlack, L1204_ac_SpellSymbolString, 12);
}
} else if (spellAreaBitmapLine == k3_SpellAreaChampionSymbols) {
_vm->_displayMan->_useByteBoxCoordinates = false;
@ -390,7 +390,7 @@ void MenuMan::buildSpellAreaLine(int16 spellAreaBitmapLine) {
for (uint16 symbolIndex = 0; symbolIndex < 4; symbolIndex++) {
if ((L1204_ac_SpellSymbolString[0] = L1203_ps_Champion->_symbols[symbolIndex]) == '\0')
break;
_vm->_textMan->f40_printTextToBitmap(_bitmapSpellAreaLine, 48, x += 9, 8, k4_ColorCyan, k0_ColorBlack, L1204_ac_SpellSymbolString, 12);
_vm->_textMan->printTextToBitmap(_bitmapSpellAreaLine, 48, x += 9, 8, k4_ColorCyan, k0_ColorBlack, L1204_ac_SpellSymbolString, 12);
}
}
}
@ -587,7 +587,7 @@ T0412019:
L1276_s_Event._B._defense >>= 2;
}
_vm->_championMan->_party._shieldDefense += L1276_s_Event._B._defense;
_vm->_timeline->f260_timelineRefreshAllChampionStatusBoxes();
_vm->_timeline->refreshAllChampionStatusBoxes();
goto T0412032;
case k6_spellType_otherFootprints:
L1276_s_Event._type = k79_TMEventTypeFootprints;
@ -602,7 +602,7 @@ T0412032:
AL1267_ui_Ticks = AL1267_ui_SpellPower * AL1267_ui_SpellPower;
T0412033:
setMapAndTime(L1276_s_Event._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + AL1267_ui_Ticks);
_vm->_timeline->f238_addEventGetEventIndex(&L1276_s_Event);
_vm->_timeline->addEventGetEventIndex(&L1276_s_Event);
break;
case k7_spellType_otherZokathra:
if ((L1272_T_Object = _vm->_dungeonMan->getUnusedThing(k10_JunkThingType)) == Thing::_none)
@ -695,8 +695,8 @@ void MenuMan::menusPrintSpellFailureMessage(Champion* champ, uint16 failureType,
if (skillIndex > k3_ChampionSkillWizard)
skillIndex = (skillIndex - 4) / 4;
_vm->_textMan->f51_messageAreaPrintLineFeed();
_vm->_textMan->f47_messageAreaPrintMessage(k4_ColorCyan, champ->_name);
_vm->_textMan->printLineFeed();
_vm->_textMan->printMessage(k4_ColorCyan, champ->_name);
const char *messages_EN_ANY[4] = {" NEEDS MORE PRACTICE WITH THIS ", " SPELL.", " MUMBLES A MEANINGLESS SPELL."," NEEDS AN EMPTY FLASK IN HAND FOR POTION."};
const char *messages_DE_DEU[4] = {" BRAUCHT MEHR UEBUNG MIT DIESEM ", " ZAUBERSPRUCH.",
@ -716,8 +716,8 @@ void MenuMan::menusPrintSpellFailureMessage(Champion* champ, uint16 failureType,
switch (failureType) {
case k0_failureNeedsMorePractice:
_vm->_textMan->f47_messageAreaPrintMessage(k4_ColorCyan, messages[0]);
_vm->_textMan->f47_messageAreaPrintMessage(k4_ColorCyan, _vm->_championMan->_baseSkillName[skillIndex]);
_vm->_textMan->printMessage(k4_ColorCyan, messages[0]);
_vm->_textMan->printMessage(k4_ColorCyan, _vm->_championMan->_baseSkillName[skillIndex]);
if (_vm->getGameLanguage() != Common::FR_FRA || skillIndex == k3_ChampionSkillWizard)
L1264_pc_Message = messages[1];
else
@ -731,7 +731,7 @@ void MenuMan::menusPrintSpellFailureMessage(Champion* champ, uint16 failureType,
L1264_pc_Message = messages[3];
break;
}
_vm->_textMan->f47_messageAreaPrintMessage(k4_ColorCyan, L1264_pc_Message);
_vm->_textMan->printMessage(k4_ColorCyan, L1264_pc_Message);
}
Potion* MenuMan::getEmptyFlaskInHand(Champion* champ, Thing* potionThing) {
@ -754,7 +754,7 @@ void MenuMan::createEvent70_light(int16 lightPower, int16 ticks) {
L1241_s_Event._B._lightPower = lightPower;
setMapAndTime(L1241_s_Event._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + ticks);
L1241_s_Event._priority = 0;
_vm->_timeline->f238_addEventGetEventIndex(&L1241_s_Event);
_vm->_timeline->addEventGetEventIndex(&L1241_s_Event);
_vm->_inventoryMan->setDungeonViewPalette();
}
@ -792,8 +792,8 @@ bool MenuMan::isPartySpellOrFireShieldSuccessful(Champion* champ, bool spellShie
}
L1240_s_Event._priority = 0;
setMapAndTime(L1240_s_Event._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + ticks);
_vm->_timeline->f238_addEventGetEventIndex(&L1240_s_Event);
_vm->_timeline->f260_timelineRefreshAllChampionStatusBoxes();
_vm->_timeline->addEventGetEventIndex(&L1240_s_Event);
_vm->_timeline->refreshAllChampionStatusBoxes();
return L1239_B_IsPartySpellOrFireShieldSuccessful;
}
@ -808,7 +808,7 @@ void MenuMan::drawAvailableSymbols(uint16 symbolStep) {
L1215_i_X = 225;
for (L1214_ui_Counter = 0; L1214_ui_Counter < 6; L1214_ui_Counter++) {
L1217_ac_String[0] = L1216_c_Character++;
_vm->_textMan->f53_printToLogicalScreen(L1215_i_X += 14, 58, k4_ColorCyan, k0_ColorBlack, L1217_ac_String);
_vm->_textMan->printToLogicalScreen(L1215_i_X += 14, 58, k4_ColorCyan, k0_ColorBlack, L1217_ac_String);
}
}
@ -828,7 +828,7 @@ void MenuMan::drawChampionSymbols(Champion* champ) {
} else {
L1221_ac_String[0] = champ->_symbols[L1218_ui_SymbolIndex];
}
_vm->_textMan->f53_printToLogicalScreen(L1219_i_X += 9, 70, k4_ColorCyan, k0_ColorBlack, L1221_ac_String);
_vm->_textMan->printToLogicalScreen(L1219_i_X += 9, 70, k4_ColorCyan, k0_ColorBlack, L1221_ac_String);
}
}
@ -897,7 +897,7 @@ bool MenuMan::didClickTriggerAction(int16 actionListIndex) {
L1198_B_ClickTriggeredAction = true;
} else {
L1197_ui_ActionIndex = _actionList._actionIndices[actionListIndex];
L1199_ps_Champion->_actionDefense += g495_actionDefense[L1197_ui_ActionIndex]; /* BUG0_54 The defense modifier of an action is permanent.
L1199_ps_Champion->_actionDefense += _actionDefense[L1197_ui_ActionIndex]; /* BUG0_54 The defense modifier of an action is permanent.
Each action has an associated defense modifier value and a number of ticks while the champion cannot perform another action because the action icon is grayed out. If an action has a non zero defense modifier and a zero value for the number of ticks then the defense modifier is applied but it is never removed. This causes no issue in the original games because there are no actions in this case but it may occur in a version where data is customized. This statement should only be executed if the value for the action in G0491_auc_Graphic560_ActionDisabledTicks is not 0 otherwise the action is not disabled at the end of F0407_MENUS_IsActionPerformed and thus not enabled later in F0253_TIMELINE_ProcessEvent11Part1_EnableChampionAction where the defense modifier is also removed */
setFlag(L1199_ps_Champion->_attributes, k0x0100_ChampionAttributeStatistics);
L1198_B_ClickTriggeredAction = isActionPerformed(L1196_ui_ChampionIndex, L1197_ui_ActionIndex);
@ -1129,10 +1129,10 @@ T0407014:
case k13_ChampionActionSwing:
case k2_ChampionActionChop:
if ((Square(AL1244_ui_TargetSquare).getType() == k4_DoorElemType) && (Square(AL1244_ui_TargetSquare).getDoorState() == k4_doorState_CLOSED)) {
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
L1249_ui_ActionDisabledTicks = 6;
_vm->_groupMan->groupIsDoorDestoryedByAttack(L1251_i_MapX, L1252_i_MapY, _vm->_championMan->getStrength(champIndex, k1_ChampionSlotActionHand), false, 2);
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k2_soundModePlayOneTickLater);
_vm->_sound->requestPlay(k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k2_soundModePlayOneTickLater);
break;
}
case k24_ChampionActionDisrupt:
@ -1158,10 +1158,10 @@ T0407014:
case k41_ChampionActionBrandish:
case k4_ChampionActionBlowHorn:
if (actionIndex == k8_ChampionActionWarCry) {
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k28_soundWAR_CRY, L1251_i_MapX, L1252_i_MapY, k0_soundModePlayImmediately);
_vm->_sound->requestPlay(k28_soundWAR_CRY, L1251_i_MapX, L1252_i_MapY, k0_soundModePlayImmediately);
}
if (actionIndex == k4_ChampionActionBlowHorn) {
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k25_soundBLOW_HORN, L1251_i_MapX, L1252_i_MapY, k0_soundModePlayImmediately);
_vm->_sound->requestPlay(k25_soundBLOW_HORN, L1251_i_MapX, L1252_i_MapY, k0_soundModePlayImmediately);
}
AL1245_B_ActionPerformed = isGroupFrightenedByAction(champIndex, actionIndex, L1251_i_MapX, L1252_i_MapY);
break;
@ -1191,7 +1191,7 @@ T0407032:
setChampionDirectionToPartyDirection(L1247_ps_Champion);
{ // so gotos won't skip init
Thing AL1250_T_Object = _vm->_championMan->getObjectRemovedFromSlot(champIndex, k0_ChampionSlotReadyHand);
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
_vm->_championMan->championShootProjectile(L1247_ps_Champion, AL1250_T_Object, L1256_ps_WeaponInfoActionHand->_kineticEnergy + L1257_ps_WeaponInfoReadyHand->_kineticEnergy, (L1256_ps_WeaponInfoActionHand->getShootAttack() + _vm->_championMan->getSkillLevel(champIndex, k11_ChampionSkillShoot)) << 1, AL1246_i_StepEnergy);
}
break;
@ -1274,7 +1274,7 @@ T0407032:
L1258_s_Event._priority = 0;
L1258_s_Event._type = k73_TMEventTypeThievesEye;
setMapAndTime(L1258_s_Event._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + AL1246_i_Ticks);
_vm->_timeline->f238_addEventGetEventIndex(&L1258_s_Event);
_vm->_timeline->addEventGetEventIndex(&L1258_s_Event);
_vm->_championMan->_party._event73Count_ThievesEye++;
goto T0407076;
case k10_ChampionActionClimbDown:
@ -1318,7 +1318,7 @@ T0407076:
setChampionDirectionToPartyDirection(L1247_ps_Champion);
AL1245_B_ActionPerformed = _vm->_championMan->isObjectThrown(champIndex, k1_ChampionSlotActionHand, (L1247_ps_Champion->_cell == returnNextVal(_vm->_dungeonMan->_partyDir)) || (L1247_ps_Champion->_cell == (ViewCell)returnOppositeDir(_vm->_dungeonMan->_partyDir)));
if (AL1245_B_ActionPerformed) {
_vm->_timeline->_g370_events[L1247_ps_Champion->_enableActionEventIndex]._B._slotOrdinal = _vm->indexToOrdinal(k1_ChampionSlotActionHand);
_vm->_timeline->_events[L1247_ps_Champion->_enableActionEventIndex]._B._slotOrdinal = _vm->indexToOrdinal(k1_ChampionSlotActionHand);
}
}
if (L1249_ui_ActionDisabledTicks) {
@ -1469,7 +1469,7 @@ bool MenuMan::isMeleeActionPerformed(int16 champIndex, Champion* champ, int16 ac
#define AL1237_ui_ActionHitProbability L1237_ui_Multiple
int16 L1238_i_CreatureOrdinal;
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
if (_actionTargetGroupThing == Thing::_endOfList)
goto T0402010;
L1238_i_CreatureOrdinal = _vm->_groupMan->getMeleeTargetCreatureOrdinal(targetMapX, targetMapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, AL1236_ui_ChampionCell = champ->_cell);
@ -1582,7 +1582,7 @@ void MenuMan::printMessageAfterReplacements(const char* str) {
} while (*str++);
*L1164_pc_Character = '\0';
if (L1166_ac_OutputString[1]) { /* If the string is not empty (the first character is a new line \n) */
_vm->_textMan->f47_messageAreaPrintMessage(k4_ColorCyan, L1166_ac_OutputString);
_vm->_textMan->printMessage(k4_ColorCyan, L1166_ac_OutputString);
}
}
@ -1751,7 +1751,7 @@ void MenuMan::drawActionDamage(int16 damage) {
AL1176_i_X = pos[1];
AL1178_puc_String = (byte*)message[1];
}
_vm->_textMan->f53_printToLogicalScreen(AL1176_i_X, 100, k4_ColorCyan, k0_ColorBlack, (char *)AL1178_puc_String);
_vm->_textMan->printToLogicalScreen(AL1176_i_X, 100, k4_ColorCyan, k0_ColorBlack, (char *)AL1178_puc_String);
} else {
if (damage > 40) {
L1180_ps_Box = &_boxActionArea3ActionMenu;
@ -1789,7 +1789,7 @@ void MenuMan::drawActionDamage(int16 damage) {
L1179_ac_String[--AL1174_ui_CharacterIndex] = '0' + (damage % 10);
AL1176_i_X -= 3;
} while (damage /= 10);
_vm->_textMan->f53_printToLogicalScreen(AL1176_i_X, 100, k4_ColorCyan, k0_ColorBlack, &L1179_ac_String[AL1174_ui_CharacterIndex]);
_vm->_textMan->printToLogicalScreen(AL1176_i_X, 100, k4_ColorCyan, k0_ColorBlack, &L1179_ac_String[AL1174_ui_CharacterIndex]);
}
_vm->_eventMan->hideMouse();
}

View File

@ -182,7 +182,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16
if (!L0753_B_DoNotTriggerSensor) {
L0759_B_AtLeastOneSensorWasTriggered = true;
if (L0755_ps_Sensor->getAttrAudibleA()) {
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k01_soundSWITCH, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(k01_soundSWITCH, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k1_soundModePlayIfPrioritized);
}
if (!_vm->_championMan->_leaderEmptyHanded && ((L0757_ui_SensorType == k4_SensorWallOrnClickWithSpecObjRemoved) || (L0757_ui_SensorType == k11_SensorWallOrnClickWithSpecObjRemovedRotateSensors) || (L0757_ui_SensorType == k17_SensorWallOrnClickWithSpecObjRemovedSensor))) {
L0754_ps_Generic = (Thing *)_vm->_dungeonMan->getThingData(L0761_T_LeaderHandObject);
@ -279,7 +279,7 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM
}
if (L0710_i_ThingType == k14_ProjectileThingType) {
L0712_ps_Teleporter = (Teleporter *)_vm->_dungeonMan->getThingData(thing);
_moveResultDir = (_vm->_timeline->_g370_events[((Projectile *)L0712_ps_Teleporter)->_eventIndex])._C._projectile.getDir();
_moveResultDir = (_vm->_timeline->_events[((Projectile *)L0712_ps_Teleporter)->_eventIndex])._C._projectile.getDir();
}
for (L0728_i_ChainedMoveCount = 1000; --L0728_i_ChainedMoveCount; ) { /* No more than 1000 chained moves at once (in a chain of teleporters and pits for example) */
AL0708_i_DestinationSquare = _vm->_dungeonMan->_currMapData[destMapX][destMapY];
@ -300,7 +300,7 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM
_vm->_dungeonMan->_partyMapX = destMapX;
_vm->_dungeonMan->_partyMapY = destMapY;
if (L0712_ps_Teleporter->isAudible()) {
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k17_soundBUZZ, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k0_soundModePlayImmediately);
_vm->_sound->requestPlay(k17_soundBUZZ, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k0_soundModePlayImmediately);
}
L0723_B_DrawDungeonViewWhileFalling = true;
if (L0712_ps_Teleporter->getAbsoluteRotation()) {
@ -311,7 +311,7 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM
} else {
if (L0710_i_ThingType == k4_GroupThingType) {
if (L0712_ps_Teleporter->isAudible()) {
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k17_soundBUZZ, destMapX, destMapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(k17_soundBUZZ, destMapX, destMapY, k1_soundModePlayIfPrioritized);
}
L0720_ui_MoveGroupResult = getTeleporterRotatedGroupResult(L0712_ps_Teleporter, thing, L0714_ui_MapIndexSource);
} else {
@ -353,7 +353,7 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM
}
} else {
if (_vm->_championMan->getDamagedChampionCount(20, k0x0010_ChampionWoundLegs | k0x0020_ChampionWoundFeet, k2_attackType_SELF)) {
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k06_soundSCREAM, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k0_soundModePlayImmediately);
_vm->_sound->requestPlay(k06_soundSCREAM, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, k0_soundModePlayImmediately);
}
}
}
@ -482,7 +482,7 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM
}
L1638_ui_MovementSoundIndex = getSound(((Group *)_vm->_dungeonMan->_thingData[k4_GroupThingType])[thing.getIndex()]._type);
if (L1638_ui_MovementSoundIndex < k34_D13_soundCount) {
_vm->_sound->f064_SOUND_RequestPlay_CPSD(L1638_ui_MovementSoundIndex, destMapX, destMapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(L1638_ui_MovementSoundIndex, destMapX, destMapY, k1_soundModePlayIfPrioritized);
}
if (L0721_B_GroupOnPartyMap && (L0715_ui_MapIndexDestination != _vm->_dungeonMan->_partyMapIndex)) { /* If the group leaves the party map */
_vm->_groupMan->removeActiveGroup(AL0708_i_ActiveGroupIndex);
@ -611,7 +611,7 @@ T0266017_CheckProjectileImpacts:
L0697_T_Thing = _vm->_dungeonMan->getSquareFirstThing(L0704_ui_ProjectileMapX, L0705_ui_ProjectileMapY);
while (L0697_T_Thing != Thing::_endOfList) {
if (((L0697_T_Thing).getType() == k14_ProjectileThingType) &&
(_vm->_timeline->_g370_events[(((Projectile *)_vm->_dungeonMan->_thingData[k14_ProjectileThingType])[(L0697_T_Thing).getIndex()])._eventIndex]._type != k48_TMEventTypeMoveProjectileIgnoreImpacts) && (AL0699_ui_ChampionOrCreatureOrdinal = L0707_auc_ChampionOrCreatureOrdinalInCell[(L0697_T_Thing).getCell()]) &&
(_vm->_timeline->_events[(((Projectile *)_vm->_dungeonMan->_thingData[k14_ProjectileThingType])[(L0697_T_Thing).getIndex()])._eventIndex]._type != k48_TMEventTypeMoveProjectileIgnoreImpacts) && (AL0699_ui_ChampionOrCreatureOrdinal = L0707_auc_ChampionOrCreatureOrdinalInCell[(L0697_T_Thing).getCell()]) &&
_vm->_projexpl->hasProjectileImpactOccurred(L0702_i_ImpactType, srcMapX, srcMapY, _vm->ordinalToIndex(AL0699_ui_ChampionOrCreatureOrdinal), L0697_T_Thing)) {
_vm->_projexpl->projectileDeleteEvent(L0697_T_Thing);
if (_vm->_projexpl->_creatureDamageOutcome == k2_outcomeKilledAllCreaturesInGroup) {
@ -642,7 +642,7 @@ void MovesensMan::addEvent(byte type, byte mapX, byte mapY, byte cell, byte effe
L0729_s_Event._B._location._mapY = mapY;
L0729_s_Event._C.A._cell = cell;
L0729_s_Event._C.A._effect = effect;
_vm->_timeline->f238_addEventGetEventIndex(&L0729_s_Event);
_vm->_timeline->addEventGetEventIndex(&L0729_s_Event);
}
int16 MovesensMan::getSound(byte creatureType) {
@ -799,7 +799,7 @@ void MovesensMan::processThingAdditionOrRemoval(uint16 mapX, uint16 mapY, Thing
} else {
if ((L0771_ui_ThingType == k2_TextstringType) && (L0767_i_ThingType == kM1_PartyThingType) && addThing && !partySquare) {
_vm->_dungeonMan->decodeText(_vm->_stringBuildBuffer, L0766_T_Thing, k1_TextTypeMessage);
_vm->_textMan->f47_messageAreaPrintMessage(k15_ColorWhite, _vm->_stringBuildBuffer);
_vm->_textMan->printMessage(k15_ColorWhite, _vm->_stringBuildBuffer);
} else {
if ((L0771_ui_ThingType > k4_GroupThingType) && (L0771_ui_ThingType < k14_ProjectileThingType)) {
L0772_B_SquareContainsObject = true;
@ -912,7 +912,7 @@ void MovesensMan::processThingAdditionOrRemoval(uint16 mapX, uint16 mapY, Thing
goto T0276079;
if (L0769_ps_Sensor->getAttrAudibleA())
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k01_soundSWITCH, mapX, mapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(k01_soundSWITCH, mapX, mapY, k1_soundModePlayIfPrioritized);
triggerEffect(L0769_ps_Sensor, L0778_i_Effect, mapX, mapY, (uint16)kM1_CellAny); // this will wrap around
goto T0276079;
@ -1080,7 +1080,7 @@ void MovesensMan::createEventMoveGroup(Thing groupThing, int16 mapX, int16 mapY,
L0696_s_Event._B._location._mapX = mapX;
L0696_s_Event._B._location._mapY = mapY;
L0696_s_Event._C._slot = groupThing.toUint16();
_vm->_timeline->f238_addEventGetEventIndex(&L0696_s_Event);
_vm->_timeline->addEventGetEventIndex(&L0696_s_Event);
}
Thing MovesensMan::getObjectOfTypeInCell(int16 mapX, int16 mapY, int16 cell, int16 objectType) {

View File

@ -259,7 +259,7 @@ void ObjectMan::drawLeaderObjectName(Thing thing) {
} else {
objectName = _objectNames[L0007_i_IconIndex];
}
_vm->_textMan->f41_printWithTrailingSpaces(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, 233, 37, k4_ColorCyan, k0_ColorBlack, objectName, k14_ObjectNameMaximumLength, k200_heightScreen);
_vm->_textMan->printWithTrailingSpaces(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, 233, 37, k4_ColorCyan, k0_ColorBlack, objectName, k14_ObjectNameMaximumLength, k200_heightScreen);
}
IconIndice ObjectMan::getIconIndexInSlotBox(uint16 slotBoxIndex) {

View File

@ -73,7 +73,7 @@ void ProjExpl::createProjectile(Thing thing, int16 mapX, int16 mapY, uint16 cell
L0468_s_Event._C._projectile.setMapY(mapY);
L0468_s_Event._C._projectile.setStepEnergy(stepEnergy);
L0468_s_Event._C._projectile.setDir(dir);
L0467_ps_Projectile->_eventIndex = _vm->_timeline->f238_addEventGetEventIndex(&L0468_s_Event);
L0467_ps_Projectile->_eventIndex = _vm->_timeline->addEventGetEventIndex(&L0468_s_Event);
}
bool ProjExpl::hasProjectileImpactOccurred(int16 impactType, int16 mapXCombo, int16 mapYCombo, int16 cell, Thing projectileThing) {
@ -235,7 +235,7 @@ T0217004:
AL0507_ui_SoundIndex = k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM;
}
}
_vm->_sound->f064_SOUND_RequestPlay_CPSD(AL0507_ui_SoundIndex, L0499_i_ProjectileMapX, L0500_i_ProjectileMapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(AL0507_ui_SoundIndex, L0499_i_ProjectileMapX, L0500_i_ProjectileMapY, k1_soundModePlayIfPrioritized);
}
T0217044:
if (L0509_B_RemovePotion) {
@ -326,10 +326,10 @@ void ProjExpl::createExplosion(Thing explThing, uint16 attack, uint16 mapXCombo,
L0470_ps_Explosion->setType(explThing.toUint16() - Thing::_firstExplosion.toUint16());
L0470_ps_Explosion->setAttack(attack);
if (explThing.toUint16() < Thing::_explHarmNonMaterial.toUint16()) {
_vm->_sound->f064_SOUND_RequestPlay_CPSD((attack > 80) ? k05_soundSTRONG_EXPLOSION : k20_soundWEAK_EXPLOSION, AP0443_ui_ProjectileMapX, AP0444_ui_ProjectileMapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay((attack > 80) ? k05_soundSTRONG_EXPLOSION : k20_soundWEAK_EXPLOSION, AP0443_ui_ProjectileMapX, AP0444_ui_ProjectileMapY, k1_soundModePlayIfPrioritized);
} else {
if (explThing != Thing::_explSmoke) {
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k13_soundSPELL, AP0443_ui_ProjectileMapX, AP0444_ui_ProjectileMapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(k13_soundSPELL, AP0443_ui_ProjectileMapX, AP0444_ui_ProjectileMapY, k1_soundModePlayIfPrioritized);
}
}
_vm->_dungeonMan->linkThingToList(L0473_T_Thing, Thing(0), AP0443_ui_ProjectileMapX, AP0444_ui_ProjectileMapY);
@ -340,7 +340,7 @@ void ProjExpl::createExplosion(Thing explThing, uint16 attack, uint16 mapXCombo,
L0476_s_Event._C._slot = L0473_T_Thing.toUint16();
L0476_s_Event._B._location._mapX = AP0443_ui_ProjectileMapX;
L0476_s_Event._B._location._mapY = AP0444_ui_ProjectileMapY;
_vm->_timeline->f238_addEventGetEventIndex(&L0476_s_Event);
_vm->_timeline->addEventGetEventIndex(&L0476_s_Event);
if ((explThing == Thing::_explLightningBolt) || (explThing == Thing::_explFireBall)) {
AP0443_ui_ProjectileMapX = L0474_i_ProjectileTargetMapX;
AP0444_ui_ProjectileMapY = L0475_i_ProjectileTargetMapY;
@ -397,7 +397,7 @@ void ProjExpl::projectileDeleteEvent(Thing thing) {
L0477_ps_Projectile = (Projectile *)_vm->_dungeonMan->getThingData(thing);
_vm->_timeline->f237_deleteEvent(L0477_ps_Projectile->_eventIndex);
_vm->_timeline->deleteEvent(L0477_ps_Projectile->_eventIndex);
}
void ProjExpl::projectileDelete(Thing projectileThing, Thing* groupSlot, int16 mapX, int16 mapY) {
@ -508,7 +508,7 @@ void ProjExpl::processEvents48To49(TimelineEvent* event) {
L0519_ps_Event->Map_Time++;
#endif
L0519_ps_Event->_B._slot = L0515_T_ProjectileThingNewCell.toUint16();
L0520_ps_Projectile->_eventIndex = _vm->_timeline->f238_addEventGetEventIndex(L0519_ps_Event);
L0520_ps_Projectile->_eventIndex = _vm->_timeline->addEventGetEventIndex(L0519_ps_Event);
}
void ProjExpl::processEvent25(TimelineEvent* event) {
@ -574,7 +574,7 @@ void ProjExpl::processEvent25(TimelineEvent* event) {
break;
case 0xFFE4:
L0532_ps_Explosion->setType(L0532_ps_Explosion->getType() + 1);
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k05_soundSTRONG_EXPLOSION, L0528_ui_MapX, L0529_ui_MapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(k05_soundSTRONG_EXPLOSION, L0528_ui_MapX, L0529_ui_MapY, k1_soundModePlayIfPrioritized);
goto T0220026;
case 0xFFA8:
if (L0532_ps_Explosion->getAttack() > 55) {
@ -595,7 +595,7 @@ void ProjExpl::processEvent25(TimelineEvent* event) {
T0220026:
L0539_s_Event = *event;
L0539_s_Event._mapTime++;
_vm->_timeline->f238_addEventGetEventIndex(&L0539_s_Event);
_vm->_timeline->addEventGetEventIndex(&L0539_s_Event);
return;
}
}

View File

@ -85,7 +85,7 @@ void SoundMan::initConstants() {
Sound(574, 150, 22, 0, 4) /* k33_soundMOVE_SKELETON 33 Atari ST: not present */
};
for (int i = 0; i < k34_D13_soundCount; i++)
g60_sounds[i] = sounds[i];
_sounds[i] = sounds[i];
}
SoundMan::SoundMan(DMEngine* vm) : _vm(vm) {
@ -94,14 +94,14 @@ SoundMan::SoundMan(DMEngine* vm) : _vm(vm) {
SoundMan::~SoundMan() {
for (uint16 i = 0; i < k34_D13_soundCount; ++i)
delete[] _gK24_soundData[i]._firstSample;
delete[] _soundData[i]._firstSample;
}
void SoundMan::f503_loadSounds() {
void SoundMan::loadSounds() {
for (uint16 soundIndex = 0; soundIndex < k34_D13_soundCount; ++soundIndex) {
SoundData *soundData = _gK24_soundData + soundIndex;
SoundData *soundData = _soundData + soundIndex;
uint16 graphicIndex = g60_sounds[soundIndex]._graphicIndex;
uint16 graphicIndex = _sounds[soundIndex]._graphicIndex;
soundData->_byteCount = _vm->_displayMan->getCompressedDataSize(graphicIndex) - 2; // the header is 2 bytes long
soundData->_firstSample = new byte[soundData->_byteCount];
@ -111,8 +111,8 @@ void SoundMan::f503_loadSounds() {
}
}
void SoundMan::f060_SOUND_Play(uint16 soundIndex, uint16 period, uint8 leftVolume, uint8 rightVolume) {
SoundData *sound = &_gK24_soundData[soundIndex];
void SoundMan::play(uint16 soundIndex, uint16 period, uint8 leftVolume, uint8 rightVolume) {
SoundData *sound = &_soundData[soundIndex];
Audio::AudioStream *stream = Audio::makeRawStream(sound->_firstSample, sound->_byteCount, (72800 / period) * 8, 0, DisposeAfterUse::NO);
signed char balance = ((int16)rightVolume - (int16)leftVolume) / 2;
@ -121,14 +121,14 @@ void SoundMan::f060_SOUND_Play(uint16 soundIndex, uint16 period, uint8 leftVolum
_vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, &handle, stream, -1, 127, balance);
}
void SoundMan::f65_playPendingSound() {
void SoundMan::playPendingSound() {
while (!_pendingSounds.empty()) {
PendingSound pendingSound = _pendingSounds.pop();
f060_SOUND_Play(pendingSound._soundIndex, g60_sounds[pendingSound._soundIndex]._period, pendingSound._leftVolume, pendingSound._rightVolume);
play(pendingSound._soundIndex, _sounds[pendingSound._soundIndex]._period, pendingSound._leftVolume, pendingSound._rightVolume);
}
}
bool SoundMan::f505_soundGetVolume(int16 mapX, int16 mapY, uint8* leftVolume, uint8* rightVolume) {
bool SoundMan::soundGetVolume(int16 mapX, int16 mapY, uint8* leftVolume, uint8* rightVolume) {
static byte K0030_aauc_DistanceToSoundVolume[25][25] = {
{1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4},
{1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 5, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 4, 4, 4},
@ -193,14 +193,14 @@ bool SoundMan::f505_soundGetVolume(int16 mapX, int16 mapY, uint8* leftVolume, ui
return true;
}
void SoundMan::f064_SOUND_RequestPlay_CPSD(uint16 soundIndex, int16 mapX, int16 mapY, uint16 mode) {
void SoundMan::requestPlay(uint16 soundIndex, int16 mapX, int16 mapY, uint16 mode) {
Sound* sound;
uint8 leftVolume, rightVolume;
if (mode && (_vm->_dungeonMan->_currMapIndex != _vm->_dungeonMan->_partyMapIndex))
return;
sound = &g60_sounds[soundIndex];
sound = &_sounds[soundIndex];
if (mode > k1_soundModePlayIfPrioritized) { /* Add an event in the timeline to play the sound (mode - 1) ticks later */
TimelineEvent event;
setMapAndTime(event._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + mode - 1);
@ -209,15 +209,15 @@ void SoundMan::f064_SOUND_RequestPlay_CPSD(uint16 soundIndex, int16 mapX, int16
event._C._soundIndex = soundIndex;
event._B._location._mapX = mapX;
event._B._location._mapY = mapY;
_vm->_timeline->f238_addEventGetEventIndex(&event);
_vm->_timeline->addEventGetEventIndex(&event);
return;
}
if (!f505_soundGetVolume(mapX, mapY, &leftVolume, &rightVolume)) {
if (!soundGetVolume(mapX, mapY, &leftVolume, &rightVolume)) {
return;
}
if (!mode) { /* Play the sound immediately */
f060_SOUND_Play(soundIndex, sound->_period, leftVolume, rightVolume);
play(soundIndex, sound->_period, leftVolume, rightVolume);
return;
}
_pendingSounds.push(PendingSound(leftVolume, rightVolume, soundIndex));

View File

@ -60,7 +60,6 @@ public:
_leftVolume(leftVolume), _rightVolume(rightVolume), _soundIndex(soundIndex) {}
};
class SoundMan {
DMEngine *_vm;
@ -71,16 +70,16 @@ public:
static SoundMan *getSoundMan(DMEngine *vm, const DMADGameDescription *gameVersion);
SoundData _gK24_soundData[k34_D13_soundCount]; // @ K0024_as_SoundData
SoundData _soundData[k34_D13_soundCount]; // @ K0024_as_SoundData
Common::Queue<PendingSound> _pendingSounds;
virtual void f503_loadSounds(); // @ F0503_SOUND_LoadAll
virtual void f064_SOUND_RequestPlay_CPSD(uint16 P0088_ui_SoundIndex, int16 P0089_i_MapX, int16 P0090_i_MapY, uint16 P0091_ui_Mode); // @ F0064_SOUND_RequestPlay_CPSD
virtual void f060_SOUND_Play(uint16 P0921_ui_SoundIndex, uint16 P0085_i_Period, uint8 leftVol, uint8 rightVol); // @ F0060_SOUND_Play
void f65_playPendingSound(); // @ F0065_SOUND_PlayPendingSound_CPSD
bool f505_soundGetVolume(int16 mapX, int16 mapY, uint8 *leftVolume, uint8 *rightVolume); // @ F0505_SOUND_GetVolume
virtual void loadSounds(); // @ F0503_SOUND_LoadAll
virtual void requestPlay(uint16 P0088_ui_SoundIndex, int16 P0089_i_MapX, int16 P0090_i_MapY, uint16 P0091_ui_Mode); // @ F0064_SOUND_RequestPlay_CPSD
virtual void play(uint16 P0921_ui_SoundIndex, uint16 P0085_i_Period, uint8 leftVol, uint8 rightVol); // @ F0060_SOUND_Play
void playPendingSound(); // @ F0065_SOUND_PlayPendingSound_CPSD
bool soundGetVolume(int16 mapX, int16 mapY, uint8 *leftVolume, uint8 *rightVolume); // @ F0505_SOUND_GetVolume
Sound g60_sounds[k34_D13_soundCount];
Sound _sounds[k34_D13_soundCount];
void initConstants();
};
@ -89,9 +88,9 @@ class SoundMan_Atari: public SoundMan {
SoundMan_Atari(DMEngine* vm): SoundMan(vm) {};
public:
void f503_loadSounds() override {} // @ F0503_SOUND_LoadAll
void f064_SOUND_RequestPlay_CPSD(uint16 P0088_ui_SoundIndex, int16 P0089_i_MapX, int16 P0090_i_MapY, uint16 P0091_ui_Mode) override {} // @ F0064_SOUND_RequestPlay_CPSD
void f060_SOUND_Play(uint16 P0921_ui_SoundIndex, uint16 P0085_i_Period, uint8 leftVol, uint8 rightVol) override {} // @ F0060_SOUND_Play
void loadSounds() override {} // @ F0503_SOUND_LoadAll
void requestPlay(uint16 P0088_ui_SoundIndex, int16 P0089_i_MapX, int16 P0090_i_MapY, uint16 P0091_ui_Mode) override {} // @ F0064_SOUND_RequestPlay_CPSD
void play(uint16 P0921_ui_SoundIndex, uint16 P0085_i_Period, uint8 leftVol, uint8 rightVol) override {} // @ F0060_SOUND_Play
};
}

View File

@ -31,21 +31,21 @@
namespace DM {
TextMan::TextMan(DMEngine* vm) : _vm(vm) {
_g359_messageAreaCursorColumn = 0;
_g358_messageAreaCursorRow = 0;
_messageAreaCursorColumn = 0;
_messageAreaCursorRow = 0;
for (uint16 i = 0; i < 4; ++i)
_g360_messageAreaRowExpirationTime[i] = 0;
_g356_bitmapMessageAreaNewRow = new byte[320 * 7];
_messageAreaRowExpirationTime[i] = 0;
_bitmapMessageAreaNewRow = new byte[320 * 7];
}
TextMan::~TextMan() {
delete[] _g356_bitmapMessageAreaNewRow;
delete[] _bitmapMessageAreaNewRow;
}
#define k5_LetterWidth 5
#define k6_LetterHeight 6
void TextMan::f40_printTextToBitmap(byte* destBitmap, uint16 destByteWidth, int16 destX, int16 destY,
void TextMan::printTextToBitmap(byte* destBitmap, uint16 destByteWidth, int16 destX, int16 destY,
Color textColor, Color bgColor, const char* text, uint16 destHeight) {
if ((destX -= 1) < 0) // fixes missalignment, to be checked
destX = 0;
@ -82,27 +82,27 @@ void TextMan::f40_printTextToBitmap(byte* destBitmap, uint16 destByteWidth, int1
}
}
void TextMan::f53_printToLogicalScreen(uint16 destX, uint16 destY, Color textColor, Color bgColor, const char* text) {
f40_printTextToBitmap(_vm->_displayMan->_bitmapScreen, _vm->_displayMan->_screenWidth / 2, destX, destY, textColor, bgColor, text, _vm->_displayMan->_screenHeight);
void TextMan::printToLogicalScreen(uint16 destX, uint16 destY, Color textColor, Color bgColor, const char* text) {
printTextToBitmap(_vm->_displayMan->_bitmapScreen, _vm->_displayMan->_screenWidth / 2, destX, destY, textColor, bgColor, text, _vm->_displayMan->_screenHeight);
}
void TextMan::f52_printToViewport(int16 posX, int16 posY, Color textColor, const char* text, Color bgColor) {
f40_printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, posX, posY, textColor, bgColor, text, k136_heightViewport);
void TextMan::printToViewport(int16 posX, int16 posY, Color textColor, const char* text, Color bgColor) {
printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, posX, posY, textColor, bgColor, text, k136_heightViewport);
}
void TextMan::f41_printWithTrailingSpaces(byte* destBitmap, int16 destByteWidth, int16 destX, int16 destY, Color textColor,
void TextMan::printWithTrailingSpaces(byte* destBitmap, int16 destByteWidth, int16 destX, int16 destY, Color textColor,
Color bgColor, const char* text, int16 requiredTextLength, int16 destHeight) {
Common::String str = text;
for (int16 i = str.size(); i < requiredTextLength; ++i)
str += ' ';
f40_printTextToBitmap(destBitmap, destByteWidth, destX, destY, textColor, bgColor, str.c_str(), destHeight);
printTextToBitmap(destBitmap, destByteWidth, destX, destY, textColor, bgColor, str.c_str(), destHeight);
}
void TextMan::f51_messageAreaPrintLineFeed() {
f47_messageAreaPrintMessage(k0_ColorBlack, "\n");
void TextMan::printLineFeed() {
printMessage(k0_ColorBlack, "\n");
}
void TextMan::f47_messageAreaPrintMessage(Color color, const char* string) {
void TextMan::printMessage(Color color, const char* string) {
uint16 L0031_ui_CharacterIndex;
char L0033_ac_String[54];
@ -110,15 +110,15 @@ void TextMan::f47_messageAreaPrintMessage(Color color, const char* string) {
while (*string) {
if (*string == '\n') { /* New line */
string++;
if ((_g359_messageAreaCursorColumn != 0) || (_g358_messageAreaCursorRow != 0)) {
_g359_messageAreaCursorColumn = 0;
f45_messageAreaCreateNewRow();
if ((_messageAreaCursorColumn != 0) || (_messageAreaCursorRow != 0)) {
_messageAreaCursorColumn = 0;
createNewRow();
}
} else {
if (*string == ' ') {
string++;
if (_g359_messageAreaCursorColumn != 53) {
f46_messageAreaPrintString(color, " "); // TODO: I'm not sure this is like the original
if (_messageAreaCursorColumn != 53) {
printString(color, " "); // TODO: I'm not sure this is like the original
}
} else {
L0031_ui_CharacterIndex = 0;
@ -126,56 +126,56 @@ void TextMan::f47_messageAreaPrintMessage(Color color, const char* string) {
L0033_ac_String[L0031_ui_CharacterIndex++] = *string++;
} while (*string && (*string != ' ') && (*string != '\n')); /* End of string, space or New line */
L0033_ac_String[L0031_ui_CharacterIndex] = '\0';
if (_g359_messageAreaCursorColumn + L0031_ui_CharacterIndex > 53) {
_g359_messageAreaCursorColumn = 2;
f45_messageAreaCreateNewRow();
if (_messageAreaCursorColumn + L0031_ui_CharacterIndex > 53) {
_messageAreaCursorColumn = 2;
createNewRow();
}
f46_messageAreaPrintString(color, L0033_ac_String);
printString(color, L0033_ac_String);
}
}
}
}
void TextMan::f45_messageAreaCreateNewRow() {
void TextMan::createNewRow() {
uint16 L0029_ui_RowIndex;
if (_g358_messageAreaCursorRow == 3) {
f561_isTextScrolling(&_gK60_s_TextScroller, true);
memset(_g356_bitmapMessageAreaNewRow, k0_ColorBlack, 320 * 7);
f560_SCROLLER_setCommand(&_gK60_s_TextScroller, 1);
if (_messageAreaCursorRow == 3) {
isTextScrolling(&_textScroller, true);
memset(_bitmapMessageAreaNewRow, k0_ColorBlack, 320 * 7);
setScrollerCommand(&_textScroller, 1);
for (L0029_ui_RowIndex = 0; L0029_ui_RowIndex < 3; L0029_ui_RowIndex++) {
_g360_messageAreaRowExpirationTime[L0029_ui_RowIndex] = _g360_messageAreaRowExpirationTime[L0029_ui_RowIndex + 1];
_messageAreaRowExpirationTime[L0029_ui_RowIndex] = _messageAreaRowExpirationTime[L0029_ui_RowIndex + 1];
}
_g360_messageAreaRowExpirationTime[3] = -1;
_messageAreaRowExpirationTime[3] = -1;
} else {
_g358_messageAreaCursorRow++;
_messageAreaCursorRow++;
}
}
void TextMan::f46_messageAreaPrintString(Color color, const char* string) {
void TextMan::printString(Color color, const char* string) {
int16 L0030_i_StringLength;
L0030_i_StringLength = strlen(string);
if (f561_isTextScrolling(&_gK60_s_TextScroller, false)) {
f53_printToLogicalScreen(_g359_messageAreaCursorColumn * 6, (_g358_messageAreaCursorRow * 7 - 6) + 177, color, k0_ColorBlack, string);
if (isTextScrolling(&_textScroller, false)) {
printToLogicalScreen(_messageAreaCursorColumn * 6, (_messageAreaCursorRow * 7 - 6) + 177, color, k0_ColorBlack, string);
} else {
f40_printTextToBitmap(_g356_bitmapMessageAreaNewRow, k160_byteWidthScreen, _g359_messageAreaCursorColumn * 6, 5, color, k0_ColorBlack, string, 7);
if (f561_isTextScrolling(&_gK60_s_TextScroller, false))
f560_SCROLLER_setCommand(&_gK60_s_TextScroller, 1);
printTextToBitmap(_bitmapMessageAreaNewRow, k160_byteWidthScreen, _messageAreaCursorColumn * 6, 5, color, k0_ColorBlack, string, 7);
if (isTextScrolling(&_textScroller, false))
setScrollerCommand(&_textScroller, 1);
}
_g359_messageAreaCursorColumn += L0030_i_StringLength;
_g360_messageAreaRowExpirationTime[_g358_messageAreaCursorRow] = _vm->_gameTime + 200;
_messageAreaCursorColumn += L0030_i_StringLength;
_messageAreaRowExpirationTime[_messageAreaCursorRow] = _vm->_gameTime + 200;
}
void TextMan::f54_textInitialize() {
f42_messageAreaMoveCursor(0, 3);
void TextMan::initialize() {
moveCursor(0, 3);
for (uint16 i = 0; i < 4; ++i)
_g360_messageAreaRowExpirationTime[i] = -1;
_messageAreaRowExpirationTime[i] = -1;
}
void TextMan::f42_messageAreaMoveCursor(int16 column, int16 row) {
void TextMan::moveCursor(int16 column, int16 row) {
if (column < 0) {
column = 0;
} else {
@ -183,7 +183,7 @@ void TextMan::f42_messageAreaMoveCursor(int16 column, int16 row) {
column = 52;
}
}
_g359_messageAreaCursorColumn = column;
_messageAreaCursorColumn = column;
if (row < 0) {
row = 0;
} else {
@ -191,10 +191,10 @@ void TextMan::f42_messageAreaMoveCursor(int16 column, int16 row) {
row = 3;
}
}
_g358_messageAreaCursorRow = row;
_messageAreaCursorRow = row;
}
void TextMan::f44_messageAreaClearExpiredRows() {
void TextMan::clearExpiredRows() {
uint16 L0026_ui_RowIndex;
int32 L0027_l_ExpirationTime;
Box L0028_s_Box;
@ -203,17 +203,17 @@ void TextMan::f44_messageAreaClearExpiredRows() {
L0028_s_Box._x1 = 0;
L0028_s_Box._x2 = 319;
for (L0026_ui_RowIndex = 0; L0026_ui_RowIndex < 4; L0026_ui_RowIndex++) {
L0027_l_ExpirationTime = _g360_messageAreaRowExpirationTime[L0026_ui_RowIndex];
L0027_l_ExpirationTime = _messageAreaRowExpirationTime[L0026_ui_RowIndex];
if ((L0027_l_ExpirationTime == -1) || (L0027_l_ExpirationTime > _vm->_gameTime))
continue;
L0028_s_Box._y2 = (L0028_s_Box._y1 = 172 + (L0026_ui_RowIndex * 7)) + 6;
f561_isTextScrolling(&_gK60_s_TextScroller, true);
isTextScrolling(&_textScroller, true);
_vm->_displayMan->fillBoxBitmap(_vm->_displayMan->_bitmapScreen, L0028_s_Box, k0_ColorBlack, k160_byteWidthScreen, k200_heightScreen);
_g360_messageAreaRowExpirationTime[L0026_ui_RowIndex] = -1;
_messageAreaRowExpirationTime[L0026_ui_RowIndex] = -1;
}
}
void TextMan::f443_endgamePrintString(int16 x, int16 y, Color textColor, char* text) {
void TextMan::printEndGameString(int16 x, int16 y, Color textColor, char* text) {
char* L1407_pc_Character;
char L1408_ac_ModifiedString[50];
@ -226,21 +226,21 @@ void TextMan::f443_endgamePrintString(int16 x, int16 y, Color textColor, char* t
L1407_pc_Character++;
*L1407_pc_Character = *text++;
}
f53_printToLogicalScreen(x, y, textColor, k12_ColorDarkestGray, L1408_ac_ModifiedString);
printToLogicalScreen(x, y, textColor, k12_ColorDarkestGray, L1408_ac_ModifiedString);
}
void TextMan::f43_messageAreaClearAllRows() {
void TextMan::clearAllRows() {
int16 L0023_i_RowIndex;
f561_isTextScrolling(&_gK60_s_TextScroller, true);
isTextScrolling(&_textScroller, true);
Box tmpBox(0, 319, 169, 199);
_vm->_displayMan->fillScreenBox(tmpBox, k0_ColorBlack);
_g358_messageAreaCursorRow = 3;
_g359_messageAreaCursorColumn = 0;
_messageAreaCursorRow = 3;
_messageAreaCursorColumn = 0;
for (L0023_i_RowIndex = 0; L0023_i_RowIndex < 4; L0023_i_RowIndex++) {
_g360_messageAreaRowExpirationTime[L0023_i_RowIndex] = -1;
_messageAreaRowExpirationTime[L0023_i_RowIndex] = -1;
}
}
}

View File

@ -39,34 +39,35 @@ struct TextScroller {
class TextMan {
DMEngine *_vm;
int16 _g359_messageAreaCursorColumn; // @ G0359_i_MessageAreaCursorColumn
int16 _g358_messageAreaCursorRow; // @ G0358_i_MessageAreaCursorRow
int32 _g360_messageAreaRowExpirationTime[4]; // @ G0360_al_MessageAreaRowExpirationTime
byte *_g356_bitmapMessageAreaNewRow; // @ G0356_puc_Bitmap_MessageAreaNewRow
int16 _messageAreaCursorColumn; // @ G0359_i_MessageAreaCursorColumn
int16 _messageAreaCursorRow; // @ G0358_i_MessageAreaCursorRow
int32 _messageAreaRowExpirationTime[4]; // @ G0360_al_MessageAreaRowExpirationTime
byte *_bitmapMessageAreaNewRow; // @ G0356_puc_Bitmap_MessageAreaNewRow
public:
TextScroller _gK60_s_TextScroller;
TextScroller _textScroller;
explicit TextMan(DMEngine *vm);
~TextMan();
void f40_printTextToBitmap(byte *destBitmap, uint16 destByteWidth, int16 destX, int16 destY,
void printTextToBitmap(byte *destBitmap, uint16 destByteWidth, int16 destX, int16 destY,
Color textColor, Color bgColor, const char *text, uint16 destHeight); // @ F0040_TEXT_Print
void f53_printToLogicalScreen(uint16 destX, uint16 destY, Color textColor, Color bgColor, const char *text); // @ F0053_TEXT_PrintToLogicalScreen
void f52_printToViewport(int16 posX, int16 posY, Color textColor, const char *text, Color bgColor = k12_ColorDarkestGray); // @ F0052_TEXT_PrintToViewport
void f41_printWithTrailingSpaces(byte *destBitmap, int16 destByteWidth, int16 destX, int16 destY, Color textColor, Color bgColor,
void printToLogicalScreen(uint16 destX, uint16 destY, Color textColor, Color bgColor, const char *text); // @ F0053_TEXT_PrintToLogicalScreen
void printToViewport(int16 posX, int16 posY, Color textColor, const char *text, Color bgColor = k12_ColorDarkestGray); // @ F0052_TEXT_PrintToViewport
void printWithTrailingSpaces(byte *destBitmap, int16 destByteWidth, int16 destX, int16 destY, Color textColor, Color bgColor,
const char *text, int16 strLenght, int16 destHeight); // @ F0041_TEXT_PrintWithTrailingSpaces
void f51_messageAreaPrintLineFeed(); // @ F0051_TEXT_MESSAGEAREA_PrintLineFeed
void f47_messageAreaPrintMessage(Color color, const char *string); // @ F0047_TEXT_MESSAGEAREA_PrintMessage
void f45_messageAreaCreateNewRow(); // @ F0045_TEXT_MESSAGEAREA_CreateNewRow
void f46_messageAreaPrintString(Color color, const char* string);// @ F0046_TEXT_MESSAGEAREA_PrintString
void f54_textInitialize(); // @ F0054_TEXT_Initialize
void f42_messageAreaMoveCursor(int16 column, int16 row); // @ F0042_TEXT_MESSAGEAREA_MoveCursor
void f44_messageAreaClearExpiredRows(); // @ F0044_TEXT_MESSAGEAREA_ClearExpiredRows
void f443_endgamePrintString(int16 x, int16 y, Color textColor, char *text); // @ F0443_STARTEND_EndgamePrintString
bool f561_isTextScrolling(TextScroller *scroller, bool waitEndOfScrolling) {
warning(false, "STUB METHOD: f561_isTextScrolling"); return true;
void printLineFeed(); // @ F0051_TEXT_MESSAGEAREA_PrintLineFeed
void printMessage(Color color, const char *string); // @ F0047_TEXT_MESSAGEAREA_PrintMessage
void createNewRow(); // @ F0045_TEXT_MESSAGEAREA_CreateNewRow
void printString(Color color, const char* string);// @ F0046_TEXT_MESSAGEAREA_PrintString
void initialize(); // @ F0054_TEXT_Initialize
void moveCursor(int16 column, int16 row); // @ F0042_TEXT_MESSAGEAREA_MoveCursor
void clearExpiredRows(); // @ F0044_TEXT_MESSAGEAREA_ClearExpiredRows
void printEndGameString(int16 x, int16 y, Color textColor, char *text); // @ F0443_STARTEND_EndgamePrintString
bool isTextScrolling(TextScroller *scroller, bool waitEndOfScrolling) {
warning(false, "STUB METHOD: isTextScrolling"); return true;
} // @ F0561_SCROLLER_IsTextScrolling
void f560_SCROLLER_setCommand(TextScroller *scroller, int16 command) { warning(false, "STUB METHOD: f560_SCROLLER_setCommand"); } // @ F0560_SCROLLER_SetCommand
void f43_messageAreaClearAllRows(); // @ F0043_TEXT_MESSAGEAREA_ClearAllRows
void setScrollerCommand(TextScroller *scroller, int16 command) { warning(false, "STUB METHOD: f560_SCROLLER_setCommand"); } // @ F0560_SCROLLER_SetCommand
void clearAllRows(); // @ F0043_TEXT_MESSAGEAREA_ClearAllRows
};
}

View File

@ -40,7 +40,7 @@
namespace DM {
signed char g495_actionDefense[44] = { // @ G0495_ac_Graphic560_ActionDefense
signed char _actionDefense[44] = { // @ G0495_ac_Graphic560_ActionDefense
0, /* N */
36, /* BLOCK */
0, /* CHOP */
@ -87,51 +87,51 @@ signed char g495_actionDefense[44] = { // @ G0495_ac_Graphic560_ActionDefense
8}; /* FUSE */
Timeline::Timeline(DMEngine* vm) : _vm(vm) {
_g369_eventMaxCount = 0;
_g370_events = nullptr;
_g372_eventCount = 0;
_g371_timeline = nullptr;
_g373_firstUnusedEventIndex = 0;
_eventMaxCount = 0;
_events = nullptr;
_eventCount = 0;
_timeline = nullptr;
_firstUnusedEventIndex = 0;
}
Timeline::~Timeline() {
delete[] _g370_events;
delete[] _g371_timeline;
delete[] _events;
delete[] _timeline;
}
void Timeline::f233_initTimeline() {
_g370_events = new TimelineEvent[_g369_eventMaxCount];
_g371_timeline = new uint16[_g369_eventMaxCount];
void Timeline::initTimeline() {
_events = new TimelineEvent[_eventMaxCount];
_timeline = new uint16[_eventMaxCount];
if (_vm->_newGameFl) {
for (int16 i = 0; i < _g369_eventMaxCount; ++i)
_g370_events[i]._type = k0_TMEventTypeNone;
_g372_eventCount = 0;
_g373_firstUnusedEventIndex = 0;
for (int16 i = 0; i < _eventMaxCount; ++i)
_events[i]._type = k0_TMEventTypeNone;
_eventCount = 0;
_firstUnusedEventIndex = 0;
}
}
void Timeline::f237_deleteEvent(uint16 eventIndex) {
void Timeline::deleteEvent(uint16 eventIndex) {
uint16 L0586_ui_TimelineIndex;
uint16 L0587_ui_EventCount;
_g370_events[eventIndex]._type = k0_TMEventTypeNone;
if (eventIndex < _g373_firstUnusedEventIndex) {
_g373_firstUnusedEventIndex = eventIndex;
_events[eventIndex]._type = k0_TMEventTypeNone;
if (eventIndex < _firstUnusedEventIndex) {
_firstUnusedEventIndex = eventIndex;
}
_g372_eventCount--;
if ((L0587_ui_EventCount = _g372_eventCount) == 0) {
_eventCount--;
if ((L0587_ui_EventCount = _eventCount) == 0) {
return;
}
L0586_ui_TimelineIndex = f235_getIndex(eventIndex);
L0586_ui_TimelineIndex = getIndex(eventIndex);
if (L0586_ui_TimelineIndex == L0587_ui_EventCount) {
return;
}
_g371_timeline[L0586_ui_TimelineIndex] = _g371_timeline[L0587_ui_EventCount];
f236_fixChronology(L0586_ui_TimelineIndex);
_timeline[L0586_ui_TimelineIndex] = _timeline[L0587_ui_EventCount];
fixChronology(L0586_ui_TimelineIndex);
}
void Timeline::f236_fixChronology(uint16 timelineIndex) {
void Timeline::fixChronology(uint16 timelineIndex) {
uint16 L0581_ui_TimelineIndex;
uint16 L0582_ui_EventIndex;
uint16 L0583_ui_EventCount;
@ -139,16 +139,16 @@ void Timeline::f236_fixChronology(uint16 timelineIndex) {
bool L0585_B_ChronologyFixed;
if ((L0583_ui_EventCount = _g372_eventCount) == 1) {
if ((L0583_ui_EventCount = _eventCount) == 1) {
return;
}
L0584_ps_Event = &_g370_events[L0582_ui_EventIndex = _g371_timeline[timelineIndex]];
L0584_ps_Event = &_events[L0582_ui_EventIndex = _timeline[timelineIndex]];
L0585_B_ChronologyFixed = false;
while (timelineIndex > 0) { /* Check if the event should be moved earlier in the timeline */
L0581_ui_TimelineIndex = (timelineIndex - 1) >> 1;
if (f234_isEventABeforeB(L0584_ps_Event, &_g370_events[_g371_timeline[L0581_ui_TimelineIndex]])) {
_g371_timeline[timelineIndex] = _g371_timeline[L0581_ui_TimelineIndex];
if (isEventABeforeB(L0584_ps_Event, &_events[_timeline[L0581_ui_TimelineIndex]])) {
_timeline[timelineIndex] = _timeline[L0581_ui_TimelineIndex];
timelineIndex = L0581_ui_TimelineIndex;
L0585_B_ChronologyFixed = true;
} else {
@ -160,21 +160,21 @@ void Timeline::f236_fixChronology(uint16 timelineIndex) {
L0583_ui_EventCount = ((L0583_ui_EventCount - 1) - 1) >> 1;
while (timelineIndex <= L0583_ui_EventCount) { /* Check if the event should be moved later in the timeline */
L0581_ui_TimelineIndex = (timelineIndex << 1) + 1;
if (((L0581_ui_TimelineIndex + 1) < _g372_eventCount) && (f234_isEventABeforeB(&_g370_events[_g371_timeline[L0581_ui_TimelineIndex + 1]], &_g370_events[_g371_timeline[L0581_ui_TimelineIndex]]))) {
if (((L0581_ui_TimelineIndex + 1) < _eventCount) && (isEventABeforeB(&_events[_timeline[L0581_ui_TimelineIndex + 1]], &_events[_timeline[L0581_ui_TimelineIndex]]))) {
L0581_ui_TimelineIndex++;
}
if (f234_isEventABeforeB(&_g370_events[_g371_timeline[L0581_ui_TimelineIndex]], L0584_ps_Event)) {
_g371_timeline[timelineIndex] = _g371_timeline[L0581_ui_TimelineIndex];
if (isEventABeforeB(&_events[_timeline[L0581_ui_TimelineIndex]], L0584_ps_Event)) {
_timeline[timelineIndex] = _timeline[L0581_ui_TimelineIndex];
timelineIndex = L0581_ui_TimelineIndex;
} else {
break;
}
}
T0236011:
_g371_timeline[timelineIndex] = L0582_ui_EventIndex;
_timeline[timelineIndex] = L0582_ui_EventIndex;
}
bool Timeline::f234_isEventABeforeB(TimelineEvent* eventA, TimelineEvent* eventB) {
bool Timeline::isEventABeforeB(TimelineEvent* eventA, TimelineEvent* eventB) {
bool L0578_B_Simultaneous;
return (filterTime(eventA->_mapTime) < filterTime(eventB->_mapTime)) ||
@ -182,32 +182,32 @@ bool Timeline::f234_isEventABeforeB(TimelineEvent* eventA, TimelineEvent* eventB
(L0578_B_Simultaneous && (eventA->getTypePriority() == eventB->getTypePriority()) && (eventA <= eventB));
}
uint16 Timeline::f235_getIndex(uint16 eventIndex) {
uint16 Timeline::getIndex(uint16 eventIndex) {
uint16 L0579_ui_TimelineIndex;
uint16* L0580_pui_TimelineEntry;
for (L0579_ui_TimelineIndex = 0, L0580_pui_TimelineEntry = _g371_timeline; L0579_ui_TimelineIndex < _g369_eventMaxCount; L0579_ui_TimelineIndex++) {
for (L0579_ui_TimelineIndex = 0, L0580_pui_TimelineEntry = _timeline; L0579_ui_TimelineIndex < _eventMaxCount; L0579_ui_TimelineIndex++) {
if (*L0580_pui_TimelineEntry++ == eventIndex)
break;
}
if (L0579_ui_TimelineIndex >= _g369_eventMaxCount) { /* BUG0_00 Useless code. The function is always called with event indices that are in the timeline */
if (L0579_ui_TimelineIndex >= _eventMaxCount) { /* BUG0_00 Useless code. The function is always called with event indices that are in the timeline */
L0579_ui_TimelineIndex = 0; /* BUG0_01 Coding error without consequence. Wrong return value. If the specified event index is not found in the timeline the function returns 0 which is the same value that is returned if the event index is found in the first timeline entry. No consequence because this code is never executed */
}
return L0579_ui_TimelineIndex;
}
uint16 Timeline::f238_addEventGetEventIndex(TimelineEvent* event) {
uint16 Timeline::addEventGetEventIndex(TimelineEvent* event) {
uint16 L0588_ui_EventIndex;
uint16 L0590_ui_NewEventIndex;
TimelineEvent* L0591_ps_Event;
if (_g372_eventCount == _g369_eventMaxCount) {
if (_eventCount == _eventMaxCount) {
_vm->displayErrorAndStop(45);
}
if ((event->_type >= k5_TMEventTypeCorridor) && (event->_type <= k10_TMEventTypeDoor)) {
for (L0588_ui_EventIndex = 0, L0591_ps_Event = _g370_events; L0588_ui_EventIndex < _g369_eventMaxCount; L0588_ui_EventIndex++, L0591_ps_Event++) {
for (L0588_ui_EventIndex = 0, L0591_ps_Event = _events; L0588_ui_EventIndex < _eventMaxCount; L0588_ui_EventIndex++, L0591_ps_Event++) {
if ((L0591_ps_Event->_type >= k5_TMEventTypeCorridor) && (L0591_ps_Event->_type <= k10_TMEventTypeDoor)) {
if ((event->_mapTime == L0591_ps_Event->_mapTime) && (event->getMapXY() == L0591_ps_Event->getMapXY()) && ((L0591_ps_Event->_type != k6_TMEventTypeWall) || (L0591_ps_Event->_C.A._cell == event->_C.A._cell))) {
L0591_ps_Event->_C.A._effect = event->_C.A._effect;
@ -219,14 +219,14 @@ uint16 Timeline::f238_addEventGetEventIndex(TimelineEvent* event) {
if (event->_C.A._effect == k2_SensorEffToggle) {
event->_C.A._effect = 1 - L0591_ps_Event->_C.A._effect;
}
f237_deleteEvent(L0588_ui_EventIndex);
deleteEvent(L0588_ui_EventIndex);
break;
}
}
}
} else {
if (event->_type == k1_TMEventTypeDoorAnimation) {
for (L0588_ui_EventIndex = 0, L0591_ps_Event = _g370_events; L0588_ui_EventIndex < _g369_eventMaxCount; L0588_ui_EventIndex++, L0591_ps_Event++) {
for (L0588_ui_EventIndex = 0, L0591_ps_Event = _events; L0588_ui_EventIndex < _eventMaxCount; L0588_ui_EventIndex++, L0591_ps_Event++) {
if ((event->_mapTime == L0591_ps_Event->_mapTime) && (event->getMapXY() == L0591_ps_Event->getMapXY())) {
if (L0591_ps_Event->_type == k10_TMEventTypeDoor) {
if (L0591_ps_Event->_C.A._effect == k2_SensorEffToggle) {
@ -242,28 +242,28 @@ uint16 Timeline::f238_addEventGetEventIndex(TimelineEvent* event) {
}
} else {
if (event->_type == k2_TMEventTypeDoorDestruction) {
for (L0588_ui_EventIndex = 0, L0591_ps_Event = _g370_events; L0588_ui_EventIndex < _g369_eventMaxCount; L0588_ui_EventIndex++, L0591_ps_Event++) {
for (L0588_ui_EventIndex = 0, L0591_ps_Event = _events; L0588_ui_EventIndex < _eventMaxCount; L0588_ui_EventIndex++, L0591_ps_Event++) {
if ((event->getMapXY() == L0591_ps_Event->getMapXY()) && (getMap(event->_mapTime) == getMap(L0591_ps_Event->_mapTime))) {
if ((L0591_ps_Event->_type == k1_TMEventTypeDoorAnimation) || (L0591_ps_Event->_type == k10_TMEventTypeDoor)) {
f237_deleteEvent(L0588_ui_EventIndex);
deleteEvent(L0588_ui_EventIndex);
}
}
}
}
}
}
_g370_events[L0590_ui_NewEventIndex = _g373_firstUnusedEventIndex] = *event; /* Copy the event data (Megamax C can assign structures) */
_events[L0590_ui_NewEventIndex = _firstUnusedEventIndex] = *event; /* Copy the event data (Megamax C can assign structures) */
do {
if (_g373_firstUnusedEventIndex == _g369_eventMaxCount)
if (_firstUnusedEventIndex == _eventMaxCount)
break;
_g373_firstUnusedEventIndex++;
} while ((_g370_events[_g373_firstUnusedEventIndex])._type != k0_TMEventTypeNone);
_g371_timeline[_g372_eventCount] = L0590_ui_NewEventIndex;
f236_fixChronology(_g372_eventCount++);
_firstUnusedEventIndex++;
} while ((_events[_firstUnusedEventIndex])._type != k0_TMEventTypeNone);
_timeline[_eventCount] = L0590_ui_NewEventIndex;
fixChronology(_eventCount++);
return L0590_ui_NewEventIndex;
}
void Timeline::f261_processTimeline() {
void Timeline::processTimeline() {
uint16 L0680_ui_Multiple;
#define AL0680_ui_EventType L0680_ui_Multiple
#define AL0680_ui_ChampionIndex L0680_ui_Multiple
@ -271,9 +271,9 @@ void Timeline::f261_processTimeline() {
TimelineEvent L0682_s_Event;
while (f240_isFirstEventExpiered()) {
while (isFirstEventExpiered()) {
L0681_ps_Event = &L0682_s_Event;
f239_timelineExtractFirstEvent(L0681_ps_Event);
extractFirstEvent(L0681_ps_Event);
_vm->_dungeonMan->setCurrentMap(getMap(L0682_s_Event._mapTime));
AL0680_ui_EventType = L0682_s_Event._type;
if ((AL0680_ui_EventType > (k29_TMEventTypeGroupReactionDangerOnSquare - 1)) && (AL0680_ui_EventType < (k41_TMEventTypeUpdateBehaviour_3 + 1))) {
@ -285,41 +285,41 @@ void Timeline::f261_processTimeline() {
_vm->_projexpl->processEvents48To49(L0681_ps_Event);
break;
case k1_TMEventTypeDoorAnimation:
f241_timelineProcessEvent1_doorAnimation(L0681_ps_Event);
processEventDoorAnimation(L0681_ps_Event);
break;
case k25_TMEventTypeExplosion:
_vm->_projexpl->processEvent25(L0681_ps_Event);
break;
case k7_TMEventTypeFakeWall:
f242_timelineProcessEvent7_squareFakewall(L0681_ps_Event);
processEventSquareFakewall(L0681_ps_Event);
break;
case k2_TMEventTypeDoorDestruction:
f243_timelineProcessEvent2_doorDestruction(L0681_ps_Event);
processEventDoorDestruction(L0681_ps_Event);
break;
case k10_TMEventTypeDoor:
f244_timelineProcessEvent10_squareDoor(L0681_ps_Event);
processEventSquareDoor(L0681_ps_Event);
break;
case k9_TMEventTypePit:
f251_timelineProcessEvent9_squarePit(L0681_ps_Event);
processEventSquarePit(L0681_ps_Event);
break;
case k8_TMEventTypeTeleporter:
f250_timelineProcessEvent8_squareTeleporter(L0681_ps_Event);
processEventSquareTeleporter(L0681_ps_Event);
break;
case k6_TMEventTypeWall:
f248_timelineProcessEvent6_squareWall(L0681_ps_Event);
processEventSquareWall(L0681_ps_Event);
break;
case k5_TMEventTypeCorridor:
f245_timlineProcessEvent5_squareCorridor(L0681_ps_Event);
processEventSquareCorridor(L0681_ps_Event);
break;
case k60_TMEventTypeMoveGroupSilent:
case k61_TMEventTypeMoveGroupAudible:
f252_timelineProcessEvents60to61_moveGroup(L0681_ps_Event);
processEventsMoveGroup(L0681_ps_Event);
break;
case k65_TMEventTypeEnableGroupGenerator:
f246_timelineProcesEvent65_enableGroupGenerator(L0681_ps_Event);
procesEventEnableGroupGenerator(L0681_ps_Event);
break;
case k20_TMEventTypePlaySound:
_vm->_sound->f064_SOUND_RequestPlay_CPSD(L0682_s_Event._C._soundIndex, L0682_s_Event._B._location._mapX, L0682_s_Event._B._location._mapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(L0682_s_Event._C._soundIndex, L0682_s_Event._B._location._mapX, L0682_s_Event._B._location._mapY, k1_soundModePlayIfPrioritized);
break;
case k24_TMEventTypeRemoveFluxcage:
if (!_vm->_gameWon) {
@ -329,17 +329,17 @@ void Timeline::f261_processTimeline() {
}
break;
case k11_TMEventTypeEnableChampionAction:
f253_timelineProcessEvent11Part1_enableChampionAction(L0682_s_Event._priority);
processEventEnableChampionAction(L0682_s_Event._priority);
if (L0682_s_Event._B._slotOrdinal) {
f259_timelineProcessEvent11Part2_moveWeaponFromQuiverToSlot(L0682_s_Event._priority, _vm->ordinalToIndex(L0682_s_Event._B._slotOrdinal));
processEventMoveWeaponFromQuiverToSlot(L0682_s_Event._priority, _vm->ordinalToIndex(L0682_s_Event._B._slotOrdinal));
}
goto T0261048;
case k12_TMEventTypeHideDamageReceived:
f254_timelineProcessEvent12_hideDamageReceived(L0682_s_Event._priority);
processEventHideDamageReceived(L0682_s_Event._priority);
break;
case k70_TMEventTypeLight:
_vm->_dungeonMan->setCurrentMap(_vm->_dungeonMan->_partyMapIndex);
f257_timelineProcessEvent70_light(L0681_ps_Event);
processEventLight(L0681_ps_Event);
_vm->_inventoryMan->setDungeonViewPalette();
break;
case k71_TMEventTypeInvisibility:
@ -357,7 +357,7 @@ T0261048:
case k74_TMEventTypePartyShield:
_vm->_championMan->_party._shieldDefense -= L0682_s_Event._B._defense;
T0261053:
f260_timelineRefreshAllChampionStatusBoxes();
refreshAllChampionStatusBoxes();
break;
case k77_TMEventTypeSpellShield:
_vm->_championMan->_party._spellShieldDefense -= L0682_s_Event._B._defense;
@ -370,7 +370,7 @@ T0261053:
_vm->_championMan->championPoison(AL0680_ui_ChampionIndex, L0682_s_Event._B._attack);
break;
case k13_TMEventTypeViAltarRebirth:
f255_timelineProcessEvent13_ViAltarRebirth(L0681_ps_Event);
processEventViAltarRebirth(L0681_ps_Event);
break;
case k79_TMEventTypeFootprints:
_vm->_championMan->_party._event79Count_Footprints--;
@ -380,18 +380,18 @@ T0261053:
}
}
bool Timeline::f240_isFirstEventExpiered() {
return (_g372_eventCount && (filterTime(_g370_events[_g371_timeline[0]]._mapTime) <= _vm->_gameTime));
bool Timeline::isFirstEventExpiered() {
return (_eventCount && (filterTime(_events[_timeline[0]]._mapTime) <= _vm->_gameTime));
}
void Timeline::f239_timelineExtractFirstEvent(TimelineEvent* event) {
void Timeline::extractFirstEvent(TimelineEvent* event) {
uint16 L0592_ui_EventIndex;
*event = _g370_events[L0592_ui_EventIndex = _g371_timeline[0]];
f237_deleteEvent(L0592_ui_EventIndex);
*event = _events[L0592_ui_EventIndex = _timeline[0]];
deleteEvent(L0592_ui_EventIndex);
}
void Timeline::f241_timelineProcessEvent1_doorAnimation(TimelineEvent* event) {
void Timeline::processEventDoorAnimation(TimelineEvent* event) {
uint16 L0593_ui_MapX;
uint16 L0594_ui_MapY;
int16 L0595_i_Effect;
@ -421,11 +421,11 @@ void Timeline::f241_timelineProcessEvent1_doorAnimation(TimelineEvent* event) {
// Original bug fixed - A closing horizontal door wounds champions to the head instead of to the hands. Missing parenthesis in the condition cause all doors to wound the head in addition to the torso
// See BUG0_78
if (_vm->_championMan->getDamagedChampionCount(5, k0x0008_ChampionWoundTorso | (AL0602_ui_VerticalDoor ? k0x0004_ChampionWoundHead : k0x0001_ChampionWoundReadHand | k0x0002_ChampionWoundActionHand), k2_attackType_SELF)) {
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k18_soundPARTY_DAMAGED, L0593_ui_MapX, L0594_ui_MapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(k18_soundPARTY_DAMAGED, L0593_ui_MapX, L0594_ui_MapY, k1_soundModePlayIfPrioritized);
}
}
event->_mapTime++;
f238_addEventGetEventIndex(event);
addEventGetEventIndex(event);
return;
}
if (((L0599_T_GroupThing = _vm->_groupMan->groupGetThing(L0593_ui_MapX, L0594_ui_MapY)) != Thing::_endOfList) && !getFlag(L0600_ui_CreatureAttributes = _vm->_dungeonMan->getCreatureAttributes(L0599_T_GroupThing), k0x0040_MaskCreatureInfo_nonMaterial)) {
@ -435,9 +435,9 @@ void Timeline::f241_timelineProcessEvent1_doorAnimation(TimelineEvent* event) {
}
L0596_i_DoorState = (L0596_i_DoorState == k0_doorState_OPEN) ? k0_doorState_OPEN : (L0596_i_DoorState - 1);
L0597_puc_Square->setDoorState(L0596_i_DoorState);
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, L0593_ui_MapX, L0594_ui_MapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, L0593_ui_MapX, L0594_ui_MapY, k1_soundModePlayIfPrioritized);
event->_mapTime++;
f238_addEventGetEventIndex(event);
addEventGetEventIndex(event);
return;
}
}
@ -447,7 +447,7 @@ void Timeline::f241_timelineProcessEvent1_doorAnimation(TimelineEvent* event) {
}
L0596_i_DoorState += (L0595_i_Effect == k0_SensorEffSet) ? -1 : 1;
L0597_puc_Square->setDoorState(L0596_i_DoorState);
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k02_soundDOOR_RATTLE, L0593_ui_MapX, L0594_ui_MapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(k02_soundDOOR_RATTLE, L0593_ui_MapX, L0594_ui_MapY, k1_soundModePlayIfPrioritized);
if (L0595_i_Effect == k0_SensorEffSet) {
if (L0596_i_DoorState == k0_doorState_OPEN) {
@ -458,12 +458,12 @@ void Timeline::f241_timelineProcessEvent1_doorAnimation(TimelineEvent* event) {
return;
}
}
f238_addEventGetEventIndex(event);
addEventGetEventIndex(event);
T0241020_Return:
;
}
void Timeline::f242_timelineProcessEvent7_squareFakewall(TimelineEvent* event) {
void Timeline::processEventSquareFakewall(TimelineEvent* event) {
uint16 L0603_ui_MapX;
uint16 L0604_ui_MapY;
int16 L0605_i_Effect;
@ -479,11 +479,11 @@ void Timeline::f242_timelineProcessEvent7_squareFakewall(TimelineEvent* event) {
if (L0605_i_Effect == k1_SensorEffClear) {
if ((_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (L0603_ui_MapX == _vm->_dungeonMan->_partyMapX) && (L0604_ui_MapY == _vm->_dungeonMan->_partyMapY)) {
event->_mapTime++;
f238_addEventGetEventIndex(event);
addEventGetEventIndex(event);
} else {
if (((L0606_T_Thing = _vm->_groupMan->groupGetThing(L0603_ui_MapX, L0604_ui_MapY)) != Thing::_endOfList) && !getFlag(_vm->_dungeonMan->getCreatureAttributes(L0606_T_Thing), k0x0040_MaskCreatureInfo_nonMaterial)) {
event->_mapTime++;
f238_addEventGetEventIndex(event);
addEventGetEventIndex(event);
} else {
clearFlag(*L0607_puc_Square, k0x0004_FakeWallOpen);
}
@ -493,14 +493,14 @@ void Timeline::f242_timelineProcessEvent7_squareFakewall(TimelineEvent* event) {
}
}
void Timeline::f243_timelineProcessEvent2_doorDestruction(TimelineEvent* event) {
void Timeline::processEventDoorDestruction(TimelineEvent* event) {
Square* L0608_puc_Square;
L0608_puc_Square = (Square*)&_vm->_dungeonMan->_currMapData[event->_B._location._mapX][event->_B._location._mapY];
L0608_puc_Square->setDoorState(k5_doorState_DESTROYED);
}
void Timeline::f244_timelineProcessEvent10_squareDoor(TimelineEvent* event) {
void Timeline::processEventSquareDoor(TimelineEvent* event) {
int16 L0609_i_DoorState;
@ -521,10 +521,10 @@ void Timeline::f244_timelineProcessEvent10_squareDoor(TimelineEvent* event) {
}
}
event->_type = k1_TMEventTypeDoorAnimation;
f238_addEventGetEventIndex(event);
addEventGetEventIndex(event);
}
void Timeline::f251_timelineProcessEvent9_squarePit(TimelineEvent* event) {
void Timeline::processEventSquarePit(TimelineEvent* event) {
uint16 L0653_ui_MapX;
uint16 L0654_ui_MapY;
byte* L0655_puc_Square;
@ -536,13 +536,13 @@ void Timeline::f251_timelineProcessEvent9_squarePit(TimelineEvent* event) {
}
if (event->_C.A._effect == k0_SensorEffSet) {
setFlag(*L0655_puc_Square, k0x0008_PitOpen);
f249_moveTeleporterOrPitSquareThings(L0653_ui_MapX, L0654_ui_MapY);
moveTeleporterOrPitSquareThings(L0653_ui_MapX, L0654_ui_MapY);
} else {
clearFlag(*L0655_puc_Square, k0x0008_PitOpen);
}
}
void Timeline::f249_moveTeleporterOrPitSquareThings(uint16 mapX, uint16 mapY) {
void Timeline::moveTeleporterOrPitSquareThings(uint16 mapX, uint16 mapY) {
uint16 L0644_ui_Multiple;
#define AL0644_ui_ThingType L0644_ui_Multiple
#define AL0644_ui_EventIndex L0644_ui_Multiple
@ -579,7 +579,7 @@ void Timeline::f249_moveTeleporterOrPitSquareThings(uint16 mapX, uint16 mapY) {
}
if (AL0644_ui_ThingType == k14_ProjectileThingType) {
L0646_ps_Projectile = (Projectile*)_vm->_dungeonMan->getThingData(L0645_T_Thing);
L0647_ps_Event = &_g370_events[L0646_ps_Projectile->_eventIndex];
L0647_ps_Event = &_events[L0646_ps_Projectile->_eventIndex];
L0647_ps_Event->_C._projectile.setMapX(_vm->_moveSens->_moveResultMapX);
L0647_ps_Event->_C._projectile.setMapY(_vm->_moveSens->_moveResultMapY);
L0647_ps_Event->_C._projectile.setDir((Direction)_vm->_moveSens->_moveResultDir);
@ -587,7 +587,7 @@ void Timeline::f249_moveTeleporterOrPitSquareThings(uint16 mapX, uint16 mapY) {
M31_setMap(L0647_ps_Event->_mapTime, _vm->_moveSens->_moveResultMapIndex);
} else {
if (AL0644_ui_ThingType == k15_ExplosionThingType) {
for (AL0644_ui_EventIndex = 0, L0647_ps_Event = _g370_events; AL0644_ui_EventIndex < _g369_eventMaxCount; L0647_ps_Event++, AL0644_ui_EventIndex++) {
for (AL0644_ui_EventIndex = 0, L0647_ps_Event = _events; AL0644_ui_EventIndex < _eventMaxCount; L0647_ps_Event++, AL0644_ui_EventIndex++) {
if ((L0647_ps_Event->_type == k25_TMEventTypeExplosion) && (L0647_ps_Event->_C._slot == L0645_T_Thing.toUint16())) { /* BUG0_23 A Fluxcage explosion remains on a square forever. If you open a pit or teleporter on a square where there is a Fluxcage explosion, the Fluxcage explosion is moved but the associated event is not updated (because Fluxcage explosions do not use k25_TMEventTypeExplosion but rather k24_TMEventTypeRemoveFluxcage) causing the Fluxcage explosion to remain in the dungeon forever on its destination square. When the k24_TMEventTypeRemoveFluxcage expires the explosion thing is not removed, but it is marked as unused. Consequently, any objects placed on the Fluxcage square after it was moved but before it expires become orphans upon expiration. After expiration, any object placed on the fluxcage square is cloned when picked up */
L0647_ps_Event->_B._location._mapX = _vm->_moveSens->_moveResultMapX;
L0647_ps_Event->_B._location._mapY = _vm->_moveSens->_moveResultMapY;
@ -601,7 +601,7 @@ void Timeline::f249_moveTeleporterOrPitSquareThings(uint16 mapX, uint16 mapY) {
}
}
void Timeline::f250_timelineProcessEvent8_squareTeleporter(TimelineEvent* event) {
void Timeline::processEventSquareTeleporter(TimelineEvent* event) {
uint16 L0650_ui_MapX;
uint16 L0651_ui_MapY;
byte* L0652_puc_Square;
@ -613,13 +613,13 @@ void Timeline::f250_timelineProcessEvent8_squareTeleporter(TimelineEvent* event)
}
if (event->_C.A._effect == k0_SensorEffSet) {
setFlag(*L0652_puc_Square, k0x0008_TeleporterOpen);
f249_moveTeleporterOrPitSquareThings(L0650_ui_MapX, L0651_ui_MapY);
moveTeleporterOrPitSquareThings(L0650_ui_MapX, L0651_ui_MapY);
} else {
clearFlag(*L0652_puc_Square, k0x0008_TeleporterOpen);
}
}
void Timeline::f248_timelineProcessEvent6_squareWall(TimelineEvent* event) {
void Timeline::processEventSquareWall(TimelineEvent* event) {
Thing L0634_T_Thing;
int16 L0635_i_ThingType;
int16 L0636_i_Multiple;
@ -695,7 +695,7 @@ void Timeline::f248_timelineProcessEvent6_squareWall(TimelineEvent* event) {
}
} else {
if ((((L0640_ui_SensorType >= k7_SensorWallSingleProjLauncherNewObj) && (L0640_ui_SensorType <= k10_SensorWallDoubleProjLauncherExplosion)) || (L0640_ui_SensorType == k14_SensorWallSingleProjLauncherSquareObj) || (L0640_ui_SensorType == k15_SensorWallDoubleProjLauncherSquareObj)) && (L0634_T_Thing.getCell() == event->_C.A._cell)) {
f247_triggerProjectileLauncher(L0638_ps_Sensor, event);
triggerProjectileLauncher(L0638_ps_Sensor, event);
if (L0638_ps_Sensor->getAttrOnlyOnce()) {
L0638_ps_Sensor->setTypeDisabled();
}
@ -716,7 +716,7 @@ void Timeline::f248_timelineProcessEvent6_squareWall(TimelineEvent* event) {
_vm->_moveSens->processRotationEffect();
}
void Timeline::f247_triggerProjectileLauncher(Sensor* sensor, TimelineEvent* event) {
void Timeline::triggerProjectileLauncher(Sensor* sensor, TimelineEvent* event) {
Thing L0622_T_FirstProjectileAssociatedThing;
Thing L0623_T_SecondProjectileAssociatedThing;
uint16 L0624_ui_Cell;
@ -792,7 +792,7 @@ void Timeline::f247_triggerProjectileLauncher(Sensor* sensor, TimelineEvent* eve
_vm->_projexpl->_createLauncherProjectile = false;
}
void Timeline::f245_timlineProcessEvent5_squareCorridor(TimelineEvent* event) {
void Timeline::processEventSquareCorridor(TimelineEvent* event) {
#define k0x0008_randomizeGeneratedCreatureCount 0x0008 // @ MASK0x0008_RANDOMIZE_GENERATED_CREATURE_COUNT
#define k0x0007_generatedCreatureCount 0x0007 // @ MASK0x0007_GENERATED_CREATURE_COUNT
@ -822,7 +822,7 @@ void Timeline::f245_timlineProcessEvent5_squareCorridor(TimelineEvent* event) {
}
if (!L0611_B_TextCurrentlyVisible && L0615_ps_TextString->isVisible() && (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (L0616_ui_MapX == _vm->_dungeonMan->_partyMapX) && (L0617_ui_MapY == _vm->_dungeonMan->_partyMapY)) {
_vm->_dungeonMan->decodeText(_vm->_stringBuildBuffer, L0613_T_Thing, k1_TextTypeMessage);
_vm->_textMan->f47_messageAreaPrintMessage(k15_ColorWhite, _vm->_stringBuildBuffer);
_vm->_textMan->printMessage(k15_ColorWhite, _vm->_stringBuildBuffer);
}
} else {
if (L0610_i_ThingType == k3_SensorThingType) {
@ -840,7 +840,7 @@ void Timeline::f245_timlineProcessEvent5_squareCorridor(TimelineEvent* event) {
}
_vm->_groupMan->groupGetGenerated(L0614_ps_Sensor->getData(), AL0618_ui_HealthMultiplier, L0612_i_CreatureCount, (Direction)_vm->getRandomNumber(4), L0616_ui_MapX, L0617_ui_MapY);
if (L0614_ps_Sensor->getAttrAudibleA()) {
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k17_soundBUZZ, L0616_ui_MapX, L0617_ui_MapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(k17_soundBUZZ, L0616_ui_MapX, L0617_ui_MapY, k1_soundModePlayIfPrioritized);
}
if (L0614_ps_Sensor->getAttrOnlyOnce()) {
L0614_ps_Sensor->setTypeDisabled();
@ -857,7 +857,7 @@ void Timeline::f245_timlineProcessEvent5_squareCorridor(TimelineEvent* event) {
L0619_s_Event._B._location._mapX = L0616_ui_MapX;
L0619_s_Event._B._location._mapY = L0617_ui_MapY;
L0619_s_Event._B._location._mapY = L0617_ui_MapY;
f238_addEventGetEventIndex(&L0619_s_Event);
addEventGetEventIndex(&L0619_s_Event);
}
}
}
@ -867,7 +867,7 @@ void Timeline::f245_timlineProcessEvent5_squareCorridor(TimelineEvent* event) {
}
}
void Timeline::f252_timelineProcessEvents60to61_moveGroup(TimelineEvent* event) {
void Timeline::processEventsMoveGroup(TimelineEvent* event) {
uint16 L0656_ui_MapX;
uint16 L0657_ui_MapY;
Group* L0658_ps_Group;
@ -880,7 +880,7 @@ void Timeline::f252_timelineProcessEvents60to61_moveGroup(TimelineEvent* event)
T0252001:
if (((_vm->_dungeonMan->_currMapIndex != _vm->_dungeonMan->_partyMapIndex) || (L0656_ui_MapX != _vm->_dungeonMan->_partyMapX) || (L0657_ui_MapY != _vm->_dungeonMan->_partyMapY)) && (_vm->_groupMan->groupGetThing(L0656_ui_MapX, L0657_ui_MapY) == Thing::_endOfList)) { /* BUG0_24 Lord Chaos may teleport into one of the Black Flames and become invisible until the Black Flame is killed. In this case, _vm->_groupMan->f175_groupGetThing returns the Black Flame thing and the Lord Chaos thing is not moved into the dungeon until the Black Flame is killed */
if (event->_type == k61_TMEventTypeMoveGroupAudible) {
_vm->_sound->f064_SOUND_RequestPlay_CPSD(k17_soundBUZZ, L0656_ui_MapX, L0657_ui_MapY, k1_soundModePlayIfPrioritized);
_vm->_sound->requestPlay(k17_soundBUZZ, L0656_ui_MapX, L0657_ui_MapY, k1_soundModePlayIfPrioritized);
}
_vm->_moveSens->getMoveResult(Thing(event->_C._slot), kM1_MapXNotOnASquare, 0, L0656_ui_MapX, L0657_ui_MapY);
} else {
@ -906,11 +906,11 @@ T0252001:
}
}
event->_mapTime += 5;
f238_addEventGetEventIndex(event);
addEventGetEventIndex(event);
}
}
void Timeline::f246_timelineProcesEvent65_enableGroupGenerator(TimelineEvent* event) {
void Timeline::procesEventEnableGroupGenerator(TimelineEvent* event) {
Thing L0620_T_Thing;
Sensor* L0621_ps_Sensor;
@ -928,7 +928,7 @@ void Timeline::f246_timelineProcesEvent65_enableGroupGenerator(TimelineEvent* ev
}
}
void Timeline::f253_timelineProcessEvent11Part1_enableChampionAction(uint16 champIndex) {
void Timeline::processEventEnableChampionAction(uint16 champIndex) {
int16 L0660_i_SlotIndex;
int16 L0661_i_QuiverSlotIndex;
Champion* L0662_ps_Champion;
@ -937,7 +937,7 @@ void Timeline::f253_timelineProcessEvent11Part1_enableChampionAction(uint16 cham
L0662_ps_Champion->_enableActionEventIndex = -1;
clearFlag(L0662_ps_Champion->_attributes, k0x0008_ChampionAttributeDisableAction);
if (L0662_ps_Champion->_actionIndex != k255_ChampionActionNone) {
L0662_ps_Champion->_actionDefense -= g495_actionDefense[L0662_ps_Champion->_actionDefense];
L0662_ps_Champion->_actionDefense -= _actionDefense[L0662_ps_Champion->_actionDefense];
}
if (L0662_ps_Champion->_currHealth) {
if ((L0662_ps_Champion->_actionIndex == k32_ChampionActionShoot) && (L0662_ps_Champion->_slots[k0_ChampionSlotReadyHand] == Thing::_none)) {
@ -957,7 +957,7 @@ T0253002:
L0662_ps_Champion->_actionIndex = k255_ChampionActionNone;
}
void Timeline::f259_timelineProcessEvent11Part2_moveWeaponFromQuiverToSlot(uint16 champIndex, uint16 slotIndex) {
void Timeline::processEventMoveWeaponFromQuiverToSlot(uint16 champIndex, uint16 slotIndex) {
uint16 L0677_ui_SlotIndex;
Champion* L0678_ps_Champion;
@ -965,16 +965,16 @@ void Timeline::f259_timelineProcessEvent11Part2_moveWeaponFromQuiverToSlot(uint1
if (L0678_ps_Champion->_slots[slotIndex] != Thing::_none) {
return;
}
if (f258_timelineHasWeaponMovedSlot(champIndex, L0678_ps_Champion, k12_ChampionSlotQuiverLine_1_1, slotIndex)) {
if (hasWeaponMovedSlot(champIndex, L0678_ps_Champion, k12_ChampionSlotQuiverLine_1_1, slotIndex)) {
return;
}
for (L0677_ui_SlotIndex = k7_ChampionSlotQuiverLine_2_1; L0677_ui_SlotIndex <= k9_ChampionSlotQuiverLine_2_2; L0677_ui_SlotIndex++) {
if (f258_timelineHasWeaponMovedSlot(champIndex, L0678_ps_Champion, L0677_ui_SlotIndex, slotIndex))
if (hasWeaponMovedSlot(champIndex, L0678_ps_Champion, L0677_ui_SlotIndex, slotIndex))
break;
}
}
bool Timeline::f258_timelineHasWeaponMovedSlot(int16 champIndex, Champion* champ, uint16 sourceSlotIndex, int16 destSlotIndex) {
bool Timeline::hasWeaponMovedSlot(int16 champIndex, Champion* champ, uint16 sourceSlotIndex, int16 destSlotIndex) {
if (Thing(champ->_slots[sourceSlotIndex]).getType() == k5_WeaponThingType) {
_vm->_championMan->addObjectInSlot((ChampionIndex)champIndex, _vm->_championMan->getObjectRemovedFromSlot(champIndex, sourceSlotIndex),
(ChampionSlot)destSlotIndex);
@ -983,7 +983,7 @@ bool Timeline::f258_timelineHasWeaponMovedSlot(int16 champIndex, Champion* champ
return false;
}
void Timeline::f254_timelineProcessEvent12_hideDamageReceived(uint16 champIndex) {
void Timeline::processEventHideDamageReceived(uint16 champIndex) {
Champion* L0663_ps_Champion;
@ -1002,7 +1002,7 @@ void Timeline::f254_timelineProcessEvent12_hideDamageReceived(uint16 champIndex)
}
}
void Timeline::f257_timelineProcessEvent70_light(TimelineEvent* event) {
void Timeline::processEventLight(TimelineEvent* event) {
int16 L0673_i_WeakerLightPower;
int16 L0674_i_Multiple;
#define AL0674_i_LightPower L0674_i_Multiple
@ -1032,11 +1032,11 @@ void Timeline::f257_timelineProcessEvent70_light(TimelineEvent* event) {
L0676_s_Event._B._lightPower = L0673_i_WeakerLightPower;
setMapAndTime(L0676_s_Event._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 4);
L0676_s_Event._priority = 0;
f238_addEventGetEventIndex(&L0676_s_Event);
addEventGetEventIndex(&L0676_s_Event);
}
}
void Timeline::f260_timelineRefreshAllChampionStatusBoxes() {
void Timeline::refreshAllChampionStatusBoxes() {
uint16 L0679_ui_ChampionIndex;
for (L0679_ui_ChampionIndex = k0_ChampionFirst; L0679_ui_ChampionIndex < _vm->_championMan->_partyChampionCount; L0679_ui_ChampionIndex++) {
@ -1045,7 +1045,7 @@ void Timeline::f260_timelineRefreshAllChampionStatusBoxes() {
_vm->_championMan->drawAllChampionStates();
}
void Timeline::f255_timelineProcessEvent13_ViAltarRebirth(TimelineEvent* event) {
void Timeline::processEventViAltarRebirth(TimelineEvent* event) {
int16 L0664_i_MapX;
int16 L0665_i_MapY;
uint16 L0666_ui_Cell;
@ -1068,7 +1068,7 @@ void Timeline::f255_timelineProcessEvent13_ViAltarRebirth(TimelineEvent* event)
T0255002:
L0670_ui_Step--;
event->_C.A._effect = L0670_ui_Step;
f238_addEventGetEventIndex(event);
addEventGetEventIndex(event);
break;
case 1:
L0667_T_Thing = _vm->_dungeonMan->getSquareFirstThing(L0664_i_MapX, L0665_i_MapY);
@ -1093,9 +1093,9 @@ T0255002:
}
}
void Timeline::save3_eventsPart(Common::OutSaveFile* file) {
for (uint16 i = 0; i < _g369_eventMaxCount; ++i) {
TimelineEvent *event = &_g370_events[i];
void Timeline::saveEventsPart(Common::OutSaveFile* file) {
for (uint16 i = 0; i < _eventMaxCount; ++i) {
TimelineEvent *event = &_events[i];
file->writeSint32BE(event->_mapTime);
file->writeByte(event->_type);
file->writeByte(event->_priority);
@ -1106,14 +1106,14 @@ void Timeline::save3_eventsPart(Common::OutSaveFile* file) {
}
}
void Timeline::save4_timelinePart(Common::OutSaveFile* file) {
for (uint16 i = 0; i < _g369_eventMaxCount; ++i)
file->writeUint16BE(_g371_timeline[i]);
void Timeline::saveTimelinePart(Common::OutSaveFile* file) {
for (uint16 i = 0; i < _eventMaxCount; ++i)
file->writeUint16BE(_timeline[i]);
}
void Timeline::load3_eventsPart(Common::InSaveFile* file) {
for (uint16 i = 0; i < _g369_eventMaxCount; ++i) {
TimelineEvent *event = &_g370_events[i];
void Timeline::loadEventsPart(Common::InSaveFile* file) {
for (uint16 i = 0; i < _eventMaxCount; ++i) {
TimelineEvent *event = &_events[i];
event->_mapTime = file->readSint32BE();
event->_type = file->readByte();
event->_priority = file->readByte();
@ -1124,9 +1124,9 @@ void Timeline::load3_eventsPart(Common::InSaveFile* file) {
}
}
void Timeline::load4_timelinePart(Common::InSaveFile* file) {
for (uint16 i = 0; i < _g369_eventMaxCount; ++i)
_g371_timeline[i] = file->readUint16BE();
void Timeline::loadTimelinePart(Common::InSaveFile* file) {
for (uint16 i = 0; i < _eventMaxCount; ++i)
_timeline[i] = file->readUint16BE();
}
}

View File

@ -95,7 +95,7 @@ k82_TMEventTypeMagicMap_C82 = 82, // @ C82_EVENT_MAGIC_MAP
k83_TMEventTypeMagicMap_C83 = 83 // @ C83_EVENT_MAGIC_MAP
};
extern signed char g495_actionDefense[44]; // @ G0495_ac_Graphic560_ActionDefense
extern signed char _actionDefense[44]; // @ G0495_ac_Graphic560_ActionDefense
class TimelineEvent {
public:
@ -149,51 +149,50 @@ public:
class Timeline {
DMEngine *_vm;
public:
uint16 _g369_eventMaxCount; // @ G0369_ui_EventMaximumCount
TimelineEvent *_g370_events; // @ G0370_ps_Events
uint16 _g372_eventCount; // @ G0372_ui_EventCount
uint16 *_g371_timeline; // @ G0371_pui_Timeline
uint16 _g373_firstUnusedEventIndex; // @ G0373_ui_FirstUnusedEventIndex
uint16 _eventMaxCount; // @ G0369_ui_EventMaximumCount
TimelineEvent *_events; // @ G0370_ps_Events
uint16 _eventCount; // @ G0372_ui_EventCount
uint16 *_timeline; // @ G0371_pui_Timeline
uint16 _firstUnusedEventIndex; // @ G0373_ui_FirstUnusedEventIndex
explicit Timeline(DMEngine *vm);
~Timeline();
void f233_initTimeline(); // @ F0233_TIMELINE_Initialize
void f237_deleteEvent(uint16 eventIndex);// @ F0237_TIMELINE_DeleteEvent
void f236_fixChronology(uint16 timelineIndex); // @ F0236_TIMELINE_FixChronology
bool f234_isEventABeforeB(TimelineEvent *eventA, TimelineEvent *eventB); // @ F0234_TIMELINE_IsEventABeforeEventB
uint16 f235_getIndex(uint16 eventIndex); // @ F0235_TIMELINE_GetIndex
uint16 f238_addEventGetEventIndex(TimelineEvent *event); // @ F0238_TIMELINE_AddEvent_GetEventIndex_CPSE
void f261_processTimeline(); // @ F0261_TIMELINE_Process_CPSEF
bool f240_isFirstEventExpiered(); // @ F0240_TIMELINE_IsFirstEventExpired_CPSE
void f239_timelineExtractFirstEvent(TimelineEvent *event); // @ F0239_TIMELINE_ExtractFirstEvent
void f241_timelineProcessEvent1_doorAnimation(TimelineEvent *event); // @ F0241_TIMELINE_ProcessEvent1_DoorAnimation
void f242_timelineProcessEvent7_squareFakewall(TimelineEvent *event); // @ F0242_TIMELINE_ProcessEvent7_Square_FakeWall
void f243_timelineProcessEvent2_doorDestruction(TimelineEvent *event); // @ F0243_TIMELINE_ProcessEvent2_DoorDestruction
void f244_timelineProcessEvent10_squareDoor(TimelineEvent *event); // @ F0244_TIMELINE_ProcessEvent10_Square_Door
void f251_timelineProcessEvent9_squarePit(TimelineEvent *event); // @ F0251_TIMELINE_ProcessEvent9_Square_Pit
void f249_moveTeleporterOrPitSquareThings(uint16 mapX, uint16 mapY); // @ F0249_TIMELINE_MoveTeleporterOrPitSquareThings
void f250_timelineProcessEvent8_squareTeleporter(TimelineEvent *event); // @ F0250_TIMELINE_ProcessEvent8_Square_Teleporter
void f248_timelineProcessEvent6_squareWall(TimelineEvent *event); // @ F0248_TIMELINE_ProcessEvent6_Square_Wall
void f247_triggerProjectileLauncher(Sensor *sensor, TimelineEvent *event); // @ F0247_TIMELINE_TriggerProjectileLauncher
void f245_timlineProcessEvent5_squareCorridor(TimelineEvent *event); // @ F0245_TIMELINE_ProcessEvent5_Square_Corridor
void f252_timelineProcessEvents60to61_moveGroup(TimelineEvent *event); // @ F0252_TIMELINE_ProcessEvents60to61_MoveGroup
void f246_timelineProcesEvent65_enableGroupGenerator(TimelineEvent *event); // @ F0246_TIMELINE_ProcessEvent65_EnableGroupGenerator
void f253_timelineProcessEvent11Part1_enableChampionAction(uint16 champIndex); // @ F0253_TIMELINE_ProcessEvent11Part1_EnableChampionAction
void f259_timelineProcessEvent11Part2_moveWeaponFromQuiverToSlot(uint16 champIndex,
void initTimeline(); // @ F0233_TIMELINE_Initialize
void deleteEvent(uint16 eventIndex);// @ F0237_TIMELINE_DeleteEvent
void fixChronology(uint16 timelineIndex); // @ F0236_TIMELINE_FixChronology
bool isEventABeforeB(TimelineEvent *eventA, TimelineEvent *eventB); // @ F0234_TIMELINE_IsEventABeforeEventB
uint16 getIndex(uint16 eventIndex); // @ F0235_TIMELINE_GetIndex
uint16 addEventGetEventIndex(TimelineEvent *event); // @ F0238_TIMELINE_AddEvent_GetEventIndex_CPSE
void processTimeline(); // @ F0261_TIMELINE_Process_CPSEF
bool isFirstEventExpiered(); // @ F0240_TIMELINE_IsFirstEventExpired_CPSE
void extractFirstEvent(TimelineEvent *event); // @ F0239_TIMELINE_ExtractFirstEvent
void processEventDoorAnimation(TimelineEvent *event); // @ F0241_TIMELINE_ProcessEvent1_DoorAnimation
void processEventSquareFakewall(TimelineEvent *event); // @ F0242_TIMELINE_ProcessEvent7_Square_FakeWall
void processEventDoorDestruction(TimelineEvent *event); // @ F0243_TIMELINE_ProcessEvent2_DoorDestruction
void processEventSquareDoor(TimelineEvent *event); // @ F0244_TIMELINE_ProcessEvent10_Square_Door
void processEventSquarePit(TimelineEvent *event); // @ F0251_TIMELINE_ProcessEvent9_Square_Pit
void moveTeleporterOrPitSquareThings(uint16 mapX, uint16 mapY); // @ F0249_TIMELINE_MoveTeleporterOrPitSquareThings
void processEventSquareTeleporter(TimelineEvent *event); // @ F0250_TIMELINE_ProcessEvent8_Square_Teleporter
void processEventSquareWall(TimelineEvent *event); // @ F0248_TIMELINE_ProcessEvent6_Square_Wall
void triggerProjectileLauncher(Sensor *sensor, TimelineEvent *event); // @ F0247_TIMELINE_TriggerProjectileLauncher
void processEventSquareCorridor(TimelineEvent *event); // @ F0245_TIMELINE_ProcessEvent5_Square_Corridor
void processEventsMoveGroup(TimelineEvent *event); // @ F0252_TIMELINE_ProcessEvents60to61_MoveGroup
void procesEventEnableGroupGenerator(TimelineEvent *event); // @ F0246_TIMELINE_ProcessEvent65_EnableGroupGenerator
void processEventEnableChampionAction(uint16 champIndex); // @ F0253_TIMELINE_ProcessEvent11Part1_EnableChampionAction
void processEventMoveWeaponFromQuiverToSlot(uint16 champIndex,
uint16 slotIndex);// @ F0259_TIMELINE_ProcessEvent11Part2_MoveWeaponFromQuiverToSlot
bool f258_timelineHasWeaponMovedSlot(int16 champIndex, Champion *champ,
bool hasWeaponMovedSlot(int16 champIndex, Champion *champ,
uint16 sourceSlotIndex, int16 destSlotIndex); // @ F0258_TIMELINE_HasWeaponMovedToSlot
void f254_timelineProcessEvent12_hideDamageReceived(uint16 champIndex); // @ F0254_TIMELINE_ProcessEvent12_HideDamageReceived
void f257_timelineProcessEvent70_light(TimelineEvent *event); // @ F0257_TIMELINE_ProcessEvent70_Light
void f260_timelineRefreshAllChampionStatusBoxes(); // @ F0260_TIMELINE_RefreshAllChampionStatusBoxes
void f255_timelineProcessEvent13_ViAltarRebirth(TimelineEvent *event); // @ F0255_TIMELINE_ProcessEvent13_ViAltarRebirth
void save3_eventsPart(Common::OutSaveFile *file);
void save4_timelinePart(Common::OutSaveFile *file);
void load3_eventsPart(Common::InSaveFile* file);
void load4_timelinePart(Common::InSaveFile* file);
void processEventHideDamageReceived(uint16 champIndex); // @ F0254_TIMELINE_ProcessEvent12_HideDamageReceived
void processEventLight(TimelineEvent *event); // @ F0257_TIMELINE_ProcessEvent70_Light
void refreshAllChampionStatusBoxes(); // @ F0260_TIMELINE_RefreshAllChampionStatusBoxes
void processEventViAltarRebirth(TimelineEvent *event); // @ F0255_TIMELINE_ProcessEvent13_ViAltarRebirth
void saveEventsPart(Common::OutSaveFile *file);
void saveTimelinePart(Common::OutSaveFile *file);
void loadEventsPart(Common::InSaveFile* file);
void loadTimelinePart(Common::InSaveFile* file);
};
}
#endif