CHEWY: Renames for dialog closeup functionality

This commit is contained in:
Filippos Karapetis 2022-06-20 18:32:38 +03:00
parent e32fc10a38
commit 49d949de6b
25 changed files with 172 additions and 170 deletions

View File

@ -65,7 +65,7 @@ bool AadTxtHeader::load(const void *src) {
return true;
}
bool AdsTxtHeader::load(const void *src) {
bool DialogCloseupTxtHeader::load(const void *src) {
Common::MemoryReadStream rs((const byte *)src, 8);
_diaNr = rs.readSint16LE();
@ -80,10 +80,10 @@ Atdsys::Atdsys() {
_aadv._dialog = false;
_aadv._strNr = -1;
_aadv._silentCount = false;
_adsv._dialog = -1;
_adsv._autoDia = false;
_adsv._strNr = -1;
_adsv._silentCount = false;
_dialogCloseup._dialog = -1;
_dialogCloseup._autoDia = false;
_dialogCloseup._strNr = -1;
_dialogCloseup._silentCount = false;
_tmpDelay = 1;
_atdsv._delay = &_tmpDelay;
_atdsv._silent = false;
@ -98,9 +98,9 @@ Atdsys::Atdsys() {
_dialogResource = new DialogResource(ADS_TXT_STEUER);
_text = new Text();
_adsnb._blkNr = 0;
_adsnb._endNr = 0;
_adsStackPtr = 0;
_dialogCloseupNextBlock._blkNr = 0;
_dialogCloseupNextBlock._endNr = 0;
_dialogCloseupStackPtr = 0;
init();
initItemUseWith();
@ -129,7 +129,7 @@ void Atdsys::init() {
set_handle(ATDS_TXT, ATS_DATA, ATS_TAP_OFF, ATS_TAP_MAX);
set_handle(ATDS_TXT, INV_ATS_DATA, INV_TAP_OFF, INV_TAP_MAX);
set_handle(ATDS_TXT, AAD_DATA, AAD_TAP_OFF, AAD_TAP_MAX);
set_handle(ATDS_TXT, ADS_DATA, ADS_TAP_OFF, ADS_TAP_MAX);
set_handle(ATDS_TXT, DIALOG_CLOSEUP_DATA, ADS_TAP_OFF, ADS_TAP_MAX);
set_handle(ATDS_TXT, INV_USE_DATA, USE_TAP_OFF, USE_TAP_MAX);
_G(gameState).AadSilent = 10;
_G(gameState).DelaySpeed = 5;
@ -693,7 +693,7 @@ void Atdsys::print_aad(int16 scrX, int16 scrY) {
if (_atdsv.aad_str != 0)
_atdsv.aad_str(_atdsv._diaNr, _aadv._strNr, personId, AAD_STR_END);
_aadv._dialog = false;
_adsv._autoDia = false;
_dialogCloseup._autoDia = false;
_aadv._strNr = -1;
splitString._next = false;
} else {
@ -784,59 +784,59 @@ void Atdsys::aad_search_dia(int16 diaNr, char **ptr) {
}
}
bool Atdsys::ads_start(int16 diaNr) {
bool Atdsys::startDialogCloseup(int16 diaNr) {
bool ret = false;
load_atds(diaNr, ADS_DATA);
bool ende = false;
load_atds(diaNr, DIALOG_CLOSEUP_DATA);
bool end = false;
if (_atdsMem[ADS_HANDLE][0] == (char)BLOCKENDE &&
_atdsMem[ADS_HANDLE][1] == (char)BLOCKENDE &&
_atdsMem[ADS_HANDLE][2] == (char)BLOCKENDE)
ende = true;
end = true;
if (!ende) {
_adsv._ptr = _atdsMem[ADS_HANDLE];
_adsv._txtHeader.load(_adsv._ptr);
if (!end) {
_dialogCloseup._ptr = _atdsMem[ADS_HANDLE];
_dialogCloseup._txtHeader.load(_dialogCloseup._ptr);
if (_adsv._txtHeader._diaNr == diaNr) {
if (_dialogCloseup._txtHeader._diaNr == diaNr) {
ret = true;
_adsv._ptr += AdsTxtHeader::SIZE();
_adsv._person.load(_adsv._ptr, _adsv._txtHeader._perNr);
_adsv._ptr += _adsv._txtHeader._perNr * AadInfo::SIZE();
_adsv._dialog = diaNr;
_adsv._strNr = 0;
_adsStack[0] = 0;
_adsStackPtr = 1;
_dialogCloseup._ptr += DialogCloseupTxtHeader::SIZE();
_dialogCloseup._person.load(_dialogCloseup._ptr, _dialogCloseup._txtHeader._perNr);
_dialogCloseup._ptr += _dialogCloseup._txtHeader._perNr * AadInfo::SIZE();
_dialogCloseup._dialog = diaNr;
_dialogCloseup._strNr = 0;
_dialogCloseupStack[0] = 0;
_dialogCloseupStackPtr = 1;
}
}
return ret;
}
void Atdsys::stop_ads() {
_adsv._dialog = -1;
_adsv._autoDia = false;
void Atdsys::stopDialogCloseup() {
_dialogCloseup._dialog = -1;
_dialogCloseup._autoDia = false;
}
int16 Atdsys::ads_get_status() {
return _adsv._dialog;
int16 Atdsys::getDialogCloseupStatus() {
return _dialogCloseup._dialog;
}
char **Atdsys::ads_item_ptr(uint16 dialogNum, int16 blockNr, int16 *retNr) {
char **Atdsys::dialogCloseupItemPtr(uint16 dialogNum, int16 blockNr, int16 *retNr) {
*retNr = 0;
memset(_ePtr, 0, sizeof(char *) * ADS_MAX_BL_EIN);
if (_adsv._dialog != -1) {
_adsv._blkPtr = _adsv._ptr;
ads_search_block(blockNr, &_adsv._blkPtr);
if (_adsv._blkPtr) {
for (int16 i = 0; i < ADS_MAX_BL_EIN; i++) {
char *tmp_adr = _adsv._blkPtr;
ads_search_item(i, &tmp_adr);
if (tmp_adr) {
char nr = tmp_adr[-1];
tmp_adr += sizeof(AadStrHeader);
memset(_ePtr, 0, sizeof(char *) * DIALOG_CLOSEUP_MAX);
if (_dialogCloseup._dialog != -1) {
_dialogCloseup._blockPtr = _dialogCloseup._ptr;
dialogCloseupSearchBlock(blockNr, &_dialogCloseup._blockPtr);
if (_dialogCloseup._blockPtr) {
for (int16 i = 0; i < DIALOG_CLOSEUP_MAX; i++) {
char *itemPtr = _dialogCloseup._blockPtr;
dialogCloseupSearchItem(i, &itemPtr);
if (itemPtr) {
char nr = itemPtr[-1];
itemPtr += sizeof(AadStrHeader);
if (_dialogResource->isItemShown(dialogNum, blockNr, (int16)nr)) {
_ePtr[*retNr] = tmp_adr;
_ePtr[*retNr] = itemPtr;
_eNr[*retNr] = (int16)nr;
++(*retNr);
}
@ -848,120 +848,120 @@ char **Atdsys::ads_item_ptr(uint16 dialogNum, int16 blockNr, int16 *retNr) {
return _ePtr;
}
AdsNextBlk *Atdsys::ads_item_choice(uint16 dialogNum, int16 blockNr, int16 itemNr) {
_adsnb._blkNr = blockNr;
DialogCloseupNextBlock *Atdsys::dialogCloseupItemChoice(uint16 dialogNum, int16 blockNr, int16 itemNr) {
_dialogCloseupNextBlock._blkNr = blockNr;
if (!_aadv._dialog) {
if (!_adsv._autoDia) {
ads_search_item(_eNr[itemNr], &_adsv._blkPtr);
if (_adsv._blkPtr) {
if (start_ads_auto_dia(_adsv._blkPtr))
_adsv._autoDia = true;
if (!_dialogCloseup._autoDia) {
dialogCloseupSearchItem(_eNr[itemNr], &_dialogCloseup._blockPtr);
if (_dialogCloseup._blockPtr) {
if (startAutoDialogCloseup(_dialogCloseup._blockPtr))
_dialogCloseup._autoDia = true;
if (_dialogResource->hasExitBit(dialogNum, blockNr, _eNr[itemNr])) {
stop_ads();
_adsnb._endNr = _eNr[itemNr];
_adsnb._blkNr = -1;
stopDialogCloseup();
_dialogCloseupNextBlock._endNr = _eNr[itemNr];
_dialogCloseupNextBlock._blkNr = -1;
}
}
}
}
return &_adsnb;
return &_dialogCloseupNextBlock;
}
AdsNextBlk *Atdsys::calc_next_block(uint16 dialogNum, int16 blockNr, int16 itemNr) {
DialogCloseupNextBlock *Atdsys::calcNextDialogCloseupBlock(uint16 dialogNum, int16 blockNr, int16 itemNr) {
if (!_dialogResource->hasShowBit(dialogNum, blockNr, _eNr[itemNr]))
_dialogResource->setItemShown(dialogNum, blockNr, _eNr[itemNr], false);
_adsnb._endNr = _eNr[itemNr];
_dialogCloseupNextBlock._endNr = _eNr[itemNr];
if (_dialogResource->hasRestartBit(dialogNum, blockNr, _eNr[itemNr])) {
_adsnb._blkNr = 0;
_dialogCloseupNextBlock._blkNr = 0;
_adsStackPtr = 0;
_dialogCloseupStackPtr = 0;
} else {
const uint8 nextBlock = _dialogResource->getNextBlock(dialogNum, blockNr, _eNr[itemNr]);
if (nextBlock) {
_adsnb._blkNr = nextBlock;
_dialogCloseupNextBlock._blkNr = nextBlock;
int16 anzahl = 0;
while (!anzahl && _adsnb._blkNr != -1) {
int16 option = 0;
while (!option && _dialogCloseupNextBlock._blkNr != -1) {
anzahl = 0;
ads_item_ptr(dialogNum, _adsnb._blkNr, &anzahl);
if (!anzahl) {
_adsnb._blkNr = return_block(dialogNum);
option = 0;
dialogCloseupItemPtr(dialogNum, _dialogCloseupNextBlock._blkNr, &option);
if (!option) {
_dialogCloseupNextBlock._blkNr = getDialogCloseupBlock(dialogNum);
}
}
} else {
_adsnb._blkNr = return_block(dialogNum);
_dialogCloseupNextBlock._blkNr = getDialogCloseupBlock(dialogNum);
}
}
_adsStack[_adsStackPtr] = _adsnb._blkNr;
++_adsStackPtr;
_dialogCloseupStack[_dialogCloseupStackPtr] = _dialogCloseupNextBlock._blkNr;
++_dialogCloseupStackPtr;
return &_adsnb;
return &_dialogCloseupNextBlock;
}
int16 Atdsys::return_block(uint16 dialogNum) {
_adsStackPtr -= 1;
int16 Atdsys::getDialogCloseupBlock(uint16 dialogNum) {
_dialogCloseupStackPtr -= 1;
int16 ret = -1;
bool ende = false;
while (_adsStackPtr >= 0 && !ende) {
short blk_nr = _adsStack[_adsStackPtr];
int16 anz;
ads_item_ptr(dialogNum, blk_nr, &anz);
if (anz) {
bool end = false;
while (_dialogCloseupStackPtr >= 0 && !end) {
short blk_nr = _dialogCloseupStack[_dialogCloseupStackPtr];
int16 option;
dialogCloseupItemPtr(dialogNum, blk_nr, &option);
if (option) {
ret = blk_nr;
ende = true;
end = true;
} else {
--_adsStackPtr;
--_dialogCloseupStackPtr;
}
}
++_adsStackPtr;
++_dialogCloseupStackPtr;
return ret;
}
void Atdsys::ads_search_block(int16 blockNr, char **ptr) {
void Atdsys::dialogCloseupSearchBlock(int16 blockNr, char **ptr) {
char *start_ptr = *ptr;
bool ende = false;
while (!ende) {
bool end = false;
while (!end) {
if (*start_ptr == (char)blockNr) {
ende = true;
end = true;
*ptr = start_ptr;
} else {
start_ptr += 2 + sizeof(AadStrHeader);
while (*start_ptr++ != ATDS_END_BLOCK) {}
if (start_ptr[0] == ATDS_END &&
start_ptr[1] == ATDS_END) {
ende = true;
end = true;
*ptr = nullptr;
}
}
}
}
void Atdsys::ads_search_item(int16 itemNr, char **blkAdr) {
void Atdsys::dialogCloseupSearchItem(int16 itemNr, char **blkAdr) {
char *start_ptr = *blkAdr + 1;
bool ende = false;
while (!ende) {
bool end = false;
while (!end) {
if (*start_ptr == itemNr) {
ende = true;
end = true;
*blkAdr = start_ptr + 1;
} else {
start_ptr += 1 + sizeof(AadStrHeader);
while (*start_ptr++ != ATDS_END_ENTRY) {}
if (*start_ptr == ATDS_END_BLOCK) {
ende = true;
end = true;
*blkAdr = nullptr;
}
}
}
}
int16 Atdsys::start_ads_auto_dia(char *itemAdr) {
int16 Atdsys::startAutoDialogCloseup(char *itemAdr) {
_aadv._dialog = false;
if (itemAdr) {
_aadv._person = _adsv._person;
_aadv._person = _dialogCloseup._person;
_aadv._ptr = itemAdr;
_aadv._dialog = true;
_aadv._strNr = 0;
@ -970,7 +970,7 @@ int16 Atdsys::start_ads_auto_dia(char *itemAdr) {
int16 txt_len;
aad_get_zeilen(_aadv._ptr, &txt_len);
_aadv._delayCount = get_delay(txt_len);
_atdsv._diaNr = _adsv._txtHeader._diaNr + 10000;
_atdsv._diaNr = _dialogCloseup._txtHeader._diaNr + 10000;
if (_atdsv.aad_str != nullptr)
_atdsv.aad_str(_atdsv._diaNr, 0, _aadv._strHeader->_akPerson, AAD_STR_START);
@ -983,11 +983,11 @@ int16 Atdsys::start_ads_auto_dia(char *itemAdr) {
return _aadv._dialog;
}
void Atdsys::hide_item(int16 diaNr, int16 blockNr, int16 itemNr) {
void Atdsys::hideDialogCloseupItem(int16 diaNr, int16 blockNr, int16 itemNr) {
_dialogResource->setItemShown(diaNr, blockNr, itemNr, false);
}
void Atdsys::show_item(int16 diaNr, int16 blockNr, int16 itemNr) {
void Atdsys::showDialogCloseupItem(int16 diaNr, int16 blockNr, int16 itemNr) {
_dialogResource->setItemShown(diaNr, blockNr, itemNr, true);
}

View File

@ -37,7 +37,7 @@ namespace Chewy {
#define AAD_STR_END 1
#define AAD_DATA 0
#define ATS_DATA 1
#define ADS_DATA 2
#define DIALOG_CLOSEUP_DATA 2
#define INV_USE_DATA 4
#define INV_ATS_DATA 6
@ -74,9 +74,8 @@ namespace Chewy {
#define CONTROL_BYTE 0xff
#define MAX_ADS_DIALOG 500
#define ADS_MAX_BL_EIN 6
#define ADS_STACK_SIZE 50
#define DIALOG_CLOSEUP_MAX 6
#define DIALOG_CLOSEUP_STACK_SIZE 50
#define ADS_EXIT_BIT 1
#define ADS_SHOW_BIT 2
@ -150,7 +149,8 @@ struct AadVar {
int16 _silentCount;
};
struct AdsTxtHeader {
// ADS (dialog closeup) header
struct DialogCloseupTxtHeader {
int16 _diaNr;
int16 _perNr;
int16 _aMov;
@ -160,19 +160,19 @@ struct AdsTxtHeader {
static constexpr int SIZE() { return 8; }
};
struct AdsVar {
struct DialogCloseupVariables {
int16 _dialog;
int16 _autoDia;
AdsTxtHeader _txtHeader;
DialogCloseupTxtHeader _txtHeader;
AadInfoArray _person;
char *_ptr;
char *_blkPtr;
char *_blockPtr;
int16 _strNr;
int16 _delayCount;
int16 _silentCount;
};
struct AdsNextBlk {
struct DialogCloseupNextBlock {
int16 _blkNr;
int16 _endNr;
};
@ -251,18 +251,20 @@ public:
void set_string_end_func(void (*strFunc)(int16 diaNr, int16 strNr, int16 personNr, int16 mode));
void aad_search_dia(int16 diaNr, char **ptr);
int16 aad_get_zeilen(char *str, int16 *txtLen);
bool ads_start(int16 diaNr);
void stop_ads();
char **ads_item_ptr(uint16 dialogNum, int16 blockNr, int16 *retNr);
AdsNextBlk *ads_item_choice(uint16 dialogNum, int16 blockNr, int16 itemNr);
AdsNextBlk *calc_next_block(uint16 dialogNum, int16 blockNr, int16 itemNr);
int16 ads_get_status();
void hide_item(int16 diaNr, int16 blockNr, int16 itemNr);
void show_item(int16 diaNr, int16 blockNr, int16 itemNr);
int16 return_block(uint16 dialogNum);
void ads_search_block(int16 blockNr, char **ptr);
void ads_search_item(int16 itemNr, char **blkAdr);
int16 start_ads_auto_dia(char *itemAdr);
bool startDialogCloseup(int16 diaNr);
void stopDialogCloseup();
char **dialogCloseupItemPtr(uint16 dialogNum, int16 blockNr, int16 *retNr);
DialogCloseupNextBlock *dialogCloseupItemChoice(uint16 dialogNum, int16 blockNr, int16 itemNr);
DialogCloseupNextBlock *calcNextDialogCloseupBlock(uint16 dialogNum, int16 blockNr, int16 itemNr);
int16 getDialogCloseupStatus();
void hideDialogCloseupItem(int16 diaNr, int16 blockNr, int16 itemNr);
void showDialogCloseupItem(int16 diaNr, int16 blockNr, int16 itemNr);
int16 getDialogCloseupBlock(uint16 dialogNum);
void dialogCloseupSearchBlock(int16 blockNr, char **ptr);
void dialogCloseupSearchItem(int16 itemNr, char **blkAdr);
int16 startAutoDialogCloseup(char *itemAdr);
int16 calc_inv_no_use(int16 curInv, int16 testNr);
int8 getStereoPos(int16 x);
void enableEvents(bool nr) {
@ -289,13 +291,13 @@ private:
uint8 *_ats_sheader = nullptr;
AadVar _aadv;
AtsVar _atsv;
AdsVar _adsv;
DialogCloseupVariables _dialogCloseup;
AtdsVar _atdsv;
char *_ePtr[ADS_MAX_BL_EIN] = { nullptr };
int16 _eNr[ADS_MAX_BL_EIN] = { 0 };
AdsNextBlk _adsnb;
uint8 _adsStack[ADS_STACK_SIZE] = { 0 };
int16 _adsStackPtr;
char *_ePtr[DIALOG_CLOSEUP_MAX] = { nullptr };
int16 _eNr[DIALOG_CLOSEUP_MAX] = { 0 };
DialogCloseupNextBlock _dialogCloseupNextBlock;
uint8 _dialogCloseupStack[DIALOG_CLOSEUP_STACK_SIZE] = { 0 };
int16 _dialogCloseupStackPtr;
SplitStringInit _ssi[AAD_MAX_PERSON] = {
{ 0, 100, 0 },

View File

@ -130,7 +130,7 @@ public:
byte *_workpage = nullptr;
byte *_workptr = nullptr;
byte *_spblende = nullptr;
char **_ads_item_ptr = nullptr;
char **_dialogCloseupItemPtr = nullptr;
int16 _ads_dia_nr = 0;
int16 _ads_item_nr = 0;
@ -439,7 +439,7 @@ uint16 exit_flip_flop(int16 ani_nr, int16 eib_nr1, int16 eib_nr2,
int16 ats_nr1, int16 ats_nr2, int16 sib_nr,
int16 spr_nr1, int16 spr_nr2, int16 flag);
int16 loadAdsDia(int16 diaNr);
int16 loadDialogCloseup(int16 diaNr);
void setSsiPos();
@ -481,7 +481,7 @@ void startAadWait(int16 diaNr);
void start_aad(int16 diaNr);
void aadWait(int16 strNr);
void startAdsWait(int16 diaNr);
void startDialogCloseupWait(int16 diaNr);
void start_aad(int16 diaNr, int16 ssiNr);
void wait_auto_obj(int16 nr);

View File

@ -486,7 +486,7 @@ void setupScreen(SetupScreenMode mode) {
, _G(scr_width));
}
if (_G(flags).AdsDialog)
if (_G(flags).DialogCloseup)
adsMenu();
if (_G(mouseLeftClick)) {
if (_G(menu_item) == CUR_WALK) {
@ -1864,7 +1864,7 @@ bool is_chewy_busy() {
bool ret = true;
if (!_G(atds)->atsShown()) {
if (_G(atds)->aadGetStatus() == -1) {
if (_G(atds)->ads_get_status() == -1) {
if (_G(atds)->getDialogCloseupStatus() == -1) {
if (!_G(mov)->auto_go_status()) {
if (!_G(moveState)[P_CHEWY].Count) {
if (!_G(flags).ExitMov) {

View File

@ -252,7 +252,7 @@ void adsMenu() {
int16 curYStart;
int16 col;
if (_G(flags).AdsDialog) {
if (_G(flags).DialogCloseup) {
_G(flags).ShowAtsInvTxt = false;
_G(flags).MainInput = false;
if (_G(ads_item_nr) > 4)
@ -280,7 +280,7 @@ void adsMenu() {
col = 255;
else
col = 14;
_G(out)->printxy(4, curYStart - i * 10, col, 300, 0, _G(ads_item_ptr)[i]);
_G(out)->printxy(4, curYStart - i * 10, col, 300, 0, _G(dialogCloseupItemPtr)[i]);
}
}
@ -291,16 +291,16 @@ void adsMenu() {
_G(cur_display) = false;
_G(ads_push) = true;
g_events->_mousePos.y = 159;
AdsNextBlk *an_blk = _G(atds)->ads_item_choice(_G(ads_dia_nr), _G(ads_blk_nr), curY);
DialogCloseupNextBlock *an_blk = _G(atds)->dialogCloseupItemChoice(_G(ads_dia_nr), _G(ads_blk_nr), curY);
if (an_blk->_blkNr == -1) {
selectDialogOption(_G(ads_dia_nr), _G(ads_blk_nr), an_blk->_endNr);
ads_ende(_G(ads_dia_nr), _G(ads_blk_nr), an_blk->_endNr);
stop_ads_dialog();
} else {
an_blk = _G(atds)->calc_next_block(_G(ads_dia_nr), _G(ads_blk_nr), curY);
an_blk = _G(atds)->calcNextDialogCloseupBlock(_G(ads_dia_nr), _G(ads_blk_nr), curY);
selectDialogOption(_G(ads_dia_nr), _G(ads_blk_nr), an_blk->_endNr);
_G(ads_blk_nr) = an_blk->_blkNr;
_G(ads_item_ptr) = _G(atds)->ads_item_ptr(_G(ads_dia_nr), _G(ads_blk_nr), &_G(ads_item_nr));
_G(dialogCloseupItemPtr) = _G(atds)->dialogCloseupItemPtr(_G(ads_dia_nr), _G(ads_blk_nr), &_G(ads_item_nr));
}
_G(det)->stop_detail(_G(talk_start_ani));
_G(det)->showStaticSpr(_G(talk_hide_static));
@ -322,9 +322,9 @@ void stop_ads_dialog() {
_G(cur_display) = true;
_G(flags).ShowAtsInvTxt = true;
_G(flags).MainInput = true;
_G(flags).AdsDialog = false;
_G(flags).DialogCloseup = false;
_G(mouseLeftClick) = false;
_G(atds)->stop_ads();
_G(atds)->stopDialogCloseup();
if (_G(minfo).button)
_G(flags).mainMouseFlag = 1;
}

View File

@ -174,12 +174,12 @@ void Room8::talk_nimoy() {
int16 diaNr = _G(gameState).R8GipsWurf ? 2 : 1;
if (!_G(gameState).R8GTuer)
loadAdsDia(diaNr);
loadDialogCloseup(diaNr);
else
startAadWait(61);
} else {
startAadWait(603);
loadAdsDia(6);
loadDialogCloseup(6);
}
_G(flags).NoScroll = false;

View File

@ -107,7 +107,7 @@ void Room11::talk_debug() {
if (_G(gameState).R12ChewyBork) {
_G(flags).AutoAniPlay = true;
autoMove(8, P_CHEWY);
startAdsWait(5);
startDialogCloseupWait(5);
_G(menu_item) = CUR_WALK;
cursorChoice(CUR_WALK);
@ -156,7 +156,7 @@ int16 Room11::scanner() {
cursorChoice(_G(menu_item));
startAadWait(12);
showCur();
loadAdsDia(3);
loadDialogCloseup(3);
} else if (!_G(gameState).inv_cur) {
if (!_G(gameState).R11TerminalOk) {
actionFl = true;
@ -167,7 +167,7 @@ int16 Room11::scanner() {
startAadWait(12);
_G(menu_item) = CUR_TALK;
cursorChoice(_G(menu_item));
loadAdsDia(3);
loadDialogCloseup(3);
}
}
}

View File

@ -117,7 +117,7 @@ void Room14::talk_eremit() {
_G(flags).AutoAniPlay = true;
if (_G(gameState).R14Translator) {
loadAdsDia(0);
loadDialogCloseup(0);
_G(obj)->show_sib(46);
} else {
hideCur();

View File

@ -131,7 +131,7 @@ void Room35::talk_cat() {
_G(gameState)._personHide[P_CHEWY] = true;
switchRoom(36);
showCur();
startAdsWait(dia_nr);
startDialogCloseupWait(dia_nr);
_G(gameState)._personHide[P_CHEWY] = false;
switchRoom(35);

View File

@ -314,7 +314,7 @@ void Room37::hahn_dia() {
_G(gameState).scrollx = 0;
_G(gameState).scrolly = 0;
switchRoom(38);
startAdsWait(9);
startDialogCloseupWait(9);
_G(gameState)._personHide[P_CHEWY] = false;
_G(flags).LoadGame = true;
_G(gameState).scrollx = tmp_scrollx;

View File

@ -99,7 +99,7 @@ void Room41::talk_hoggy1() {
} else if (!_G(gameState).R41Einbruch) {
showCur();
startAdsWait(11);
startDialogCloseupWait(11);
} else if (_G(gameState).R41Einbruch) {
if (!_G(gameState).R41BruchInfo) {
@ -202,7 +202,7 @@ int16 Room41::use_lola() {
_G(atds)->delControlBit(267, ATS_ACTIVE_BIT);
_G(atds)->set_ats_str(267, 1, ATS_DATA);
_G(atds)->hide_item(11, 0, 3);
_G(atds)->hideDialogCloseupItem(11, 0, 3);
showCur();
}
@ -244,7 +244,7 @@ void Room41::sub_dia() {
if (_G(gameState).R41LolaOk) {
startAadWait(163);
_G(atds)->hide_item(11, 0, 2);
_G(atds)->hideDialogCloseupItem(11, 0, 2);
stop_ads_dialog();
autoMove(5, P_CHEWY);
new_invent_2_cur(PAPIER_INV);

View File

@ -172,7 +172,7 @@ void Room42::talkToStationEmployee() {
dia_nr = 14;
}
startAdsWait(dia_nr);
startDialogCloseupWait(dia_nr);
}
void Room42::dialogWithStationEmployee(int16 str_end_nr) {

View File

@ -280,7 +280,7 @@ void Room55::get_job() {
switchRoom(61);
showCur();
startAdsWait(15);
startDialogCloseupWait(15);
_G(gameState)._personHide[P_CHEWY] = false;
_G(flags).LoadGame = true;
_G(gameState).scrollx = oldScrollx;

View File

@ -239,7 +239,7 @@ int16 Room56::use_taxi() {
void Room56::talk_man() {
autoMove(3, P_CHEWY);
if (!_G(gameState).R56AbfahrtOk) {
startAdsWait(16);
startDialogCloseupWait(16);
} else if (!_G(gameState).R62Flucht) {
hideCur();
startAadWait(343);

View File

@ -255,7 +255,7 @@ void Room63::talk_girl() {
_G(det)->stop_detail(12);
startSetAILWait(13, 1, ANI_FRONT);
_G(det)->set_static_ani(14, -1);
startAdsWait(17);
startDialogCloseupWait(17);
_G(det)->del_static_ani(14);
_G(det)->startDetail(12, 255, ANI_FRONT);
}

View File

@ -51,7 +51,7 @@ void Room65::entry() {
startAadWait(_G(gameState).PersonDia[P_HOWARD]);
showCur();
} else {
startAdsWait(_G(gameState).PersonDia[P_HOWARD] - 10000);
startDialogCloseupWait(_G(gameState).PersonDia[P_HOWARD] - 10000);
}
_G(flags).LoadGame = true;
show_person();

View File

@ -146,7 +146,7 @@ int16 Room67::talk_papagei() {
showCur();
_G(atds)->set_split_win(2, 270 - _G(gameState).scrollx, 10);
startAdsWait(19);
startDialogCloseupWait(19);
_G(room)->set_timer_status(1, TIMER_START);
} else if (_G(menu_item) == CUR_NICHELLE) {
startAadWait(380);
@ -156,7 +156,7 @@ int16 Room67::talk_papagei() {
showCur();
_G(atds)->set_split_win(2, 270 - _G(gameState).scrollx, 10);
startAdsWait(18);
startDialogCloseupWait(18);
_G(room)->set_timer_status(1, TIMER_START);
} else if (_G(menu_item) == CUR_USE) {
hideCur();

View File

@ -230,7 +230,7 @@ void Room68::talk_keeper() {
int16 x = _G(moveState)[P_CHEWY].Xypos[0] - _G(gameState).scrollx + _G(spieler_mi)[P_CHEWY].HotX;
int16 y = _G(moveState)[P_CHEWY].Xypos[1] - _G(gameState).scrolly;
_G(atds)->set_split_win(3, x, y);
startAdsWait(20);
startDialogCloseupWait(20);
_G(cur_hide_flag) = false;
hideCur();
_G(det)->del_static_ani(16);
@ -416,7 +416,7 @@ void Room68::talk_papagei() {
showCur();
_G(atds)->set_split_win(2, 60, 80);
startAdsWait(18);
startDialogCloseupWait(18);
}
} // namespace Rooms

View File

@ -206,7 +206,7 @@ int Room76::proc7() {
startAadWait(427);
showCur();
startAdsWait(21);
startDialogCloseupWait(21);
hideCur();
startAadWait(428);
showCur();

View File

@ -176,7 +176,7 @@ void Room84::talk1() {
_G(flags).NoScroll = true;
setPersonSpr(P_LEFT, P_CHEWY);
auto_scroll(150, 0);
startAdsWait(22);
startDialogCloseupWait(22);
_G(flags).NoScroll = false;
}

View File

@ -40,7 +40,7 @@ void Room93::entry() {
_G(det)->del_static_ani(0);
startSetAILWait(3, 1, ANI_FRONT);
_G(det)->set_static_ani(1, -1);
startAdsWait(27);
startDialogCloseupWait(27);
if (!_G(gameState).flags37_40) {
_G(det)->del_static_ani(1);

View File

@ -571,12 +571,12 @@ void start_aad(int16 diaNr, int16 ssiNr) {
_G(atds)->start_aad(diaNr);
}
void startAdsWait(int16 diaNr) {
if (!_G(flags).AdsDialog) {
void startDialogCloseupWait(int16 diaNr) {
if (!_G(flags).DialogCloseup) {
_G(menu_item) = CUR_TALK;
cursorChoice(_G(menu_item));
loadAdsDia(diaNr);
while (_G(flags).AdsDialog && !SHOULD_QUIT) {
loadDialogCloseup(diaNr);
while (_G(flags).DialogCloseup && !SHOULD_QUIT) {
setupScreen(DO_SETUP);
}
}

View File

@ -29,16 +29,16 @@
namespace Chewy {
int16 loadAdsDia(int16 diaNr) {
int16 loadDialogCloseup(int16 diaNr) {
int16 ret = false;
if (_G(flags).AdsDialog == false) {
bool tmp = _G(atds)->ads_start(diaNr);
if (_G(flags).DialogCloseup == false) {
bool tmp = _G(atds)->startDialogCloseup(diaNr);
if (tmp == true) {
ret = true;
_G(ads_blk_nr) = 0;
_G(ads_item_ptr) = _G(atds)->ads_item_ptr(diaNr, _G(ads_blk_nr), &_G(ads_item_nr));
_G(flags).AdsDialog = true;
_G(dialogCloseupItemPtr) = _G(atds)->dialogCloseupItemPtr(diaNr, _G(ads_blk_nr), &_G(ads_item_nr));
_G(flags).DialogCloseup = true;
_G(ads_push) = true;
_G(ads_tmp_dsp) = _G(gameState).DispFlag;
_G(gameState).DispFlag = false;
@ -1185,7 +1185,7 @@ void selectDialogOption(int16 diaNr, int16 blkNr, int16 strEndNr) {
case 17:
if (blkNr == 0 && strEndNr == 2)
_G(atds)->show_item(17, 0, 1);
_G(atds)->showDialogCloseupItem(17, 0, 1);
break;
@ -2767,7 +2767,7 @@ void calc_person_dia(int16 p_nr) {
_G(stopAutoMove)[P_NICHELLE] = _G(gameState).PersonDiaRoom[P_NICHELLE];
showCur();
} else {
startAdsWait(_G(gameState).PersonDia[P_NICHELLE] - 10000);
startDialogCloseupWait(_G(gameState).PersonDia[P_NICHELLE] - 10000);
}
}
}

View File

@ -95,7 +95,7 @@ TextEntry *Text::getText(uint chunk, uint entry, int type, int subEntry) {
chunk += kADSTextMax;
isText = true;
break;
case ADS_DATA:
case DIALOG_CLOSEUP_DATA:
// No change - chunk starts from 0
break;
case INV_USE_DATA:

View File

@ -565,7 +565,7 @@ struct Flags {
uint16 AtsAction : 1;
uint16 AdsAction : 1;
uint16 AtsText : 1;
uint16 AdsDialog : 1;
uint16 DialogCloseup : 1;
uint16 ShowAtsInvTxt : 1;
uint16 MainInput : 1;
uint16 InventMenu : 1;