TONY: Rename variables and functions in adv.h

This commit is contained in:
Strangerke 2012-06-05 01:15:25 +02:00
parent a5cb751f7a
commit 93cba6d880
9 changed files with 102 additions and 105 deletions

View File

@ -64,23 +64,23 @@ enum RMTonyAction {
};
// Global Functions
uint32 MainLoadLocation(int nLoc, RMPoint pt, RMPoint start);
void MainUnloadLocation(CORO_PARAM, bool bDoOnExit, uint32 *result);
void MainLinkGraphicTask(RMGfxTask *task);
void MainFreeze(void);
void MainUnfreeze(void);
void MainWaitFrame(CORO_PARAM);
void MainShowMouse(void);
void MainHideMouse(void);
void MainEnableInput(void);
void MainDisableInput(void);
void MainPlayMusic(int nChannel, const char *filename, int nFX, bool bLoop, int nSync);
void MainInitWipe(int type);
void MainCloseWipe(void);
void MainWaitWipeEnd(CORO_PARAM);
void MainEnableGUI(void);
void MainDisableGUI(void);
void MainSetPalesati(bool bPalesati);
uint32 mainLoadLocation(int nLoc, RMPoint pt, RMPoint start);
void mainUnloadLocation(CORO_PARAM, bool bDoOnExit, uint32 *result);
void mainLinkGraphicTask(RMGfxTask *task);
void mainFreeze(void);
void mainUnfreeze(void);
void mainWaitFrame(CORO_PARAM);
void mainShowMouse(void);
void mainHideMouse(void);
void mainEnableInput(void);
void mainDisableInput(void);
void mainPlayMusic(int nChannel, const char *filename, int nFX, bool bLoop, int nSync);
void mainInitWipe(int type);
void mainCloseWipe(void);
void mainWaitWipeEnd(CORO_PARAM);
void mainEnableGUI(void);
void mainDisableGUI(void);
void mainSetPalesati(bool bPalesati);
} // End of namespace Tony

View File

@ -595,21 +595,18 @@ DECLARE_CUSTOM_FUNCTION(RestoreTonyPosition)(CORO_PARAM, uint32, uint32, uint32,
CORO_END_CODE;
}
DECLARE_CUSTOM_FUNCTION(DisableInput)(CORO_PARAM, uint32, uint32, uint32, uint32) {
MainDisableInput();
mainDisableInput();
}
DECLARE_CUSTOM_FUNCTION(EnableInput)(CORO_PARAM, uint32, uint32, uint32, uint32) {
MainEnableInput();
mainEnableInput();
}
DECLARE_CUSTOM_FUNCTION(StopTony)(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS.Tony->StopNoAction(coroParam);
}
DECLARE_CUSTOM_FUNCTION(CustEnableGUI)(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS.EnableGUI();
}
@ -2018,7 +2015,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr
// Draw the pointer
GLOBALS.Pointer->SetSpecialPointer(GLOBALS.Pointer->PTR_NONE);
MainShowMouse();
mainShowMouse();
while (!(GLOBALS.Input->mouseLeftClicked() && ((_ctx->sel = _ctx->dc.GetSelection()) != -1))) {
CORO_INVOKE_0(GLOBALS.WaitFrame);
@ -2028,7 +2025,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr
}
// Hide the pointer
MainHideMouse();
mainHideMouse();
CORO_INVOKE_0(_ctx->dc.Hide);
mpalQueryDialogSelectionDWORD(_ctx->nChoice, _ctx->sl[_ctx->sel]);
@ -2539,19 +2536,19 @@ void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation
GLOBALS.Inventory = inv;
GLOBALS.Input = input;
GLOBALS.LoadLocation = MainLoadLocation;
GLOBALS.UnloadLocation = MainUnloadLocation;
GLOBALS.LinkGraphicTask = MainLinkGraphicTask;
GLOBALS.Freeze = MainFreeze;
GLOBALS.Unfreeze = MainUnfreeze;
GLOBALS.WaitFrame = MainWaitFrame;
GLOBALS.PlayMusic = MainPlayMusic;
GLOBALS.InitWipe = MainInitWipe;
GLOBALS.CloseWipe = MainCloseWipe;
GLOBALS.WaitWipeEnd = MainWaitWipeEnd;
GLOBALS.DisableGUI = MainDisableGUI;
GLOBALS.EnableGUI = MainEnableGUI;
GLOBALS.SetPalesati = MainSetPalesati;
GLOBALS.LoadLocation = mainLoadLocation;
GLOBALS.UnloadLocation = mainUnloadLocation;
GLOBALS.LinkGraphicTask = mainLinkGraphicTask;
GLOBALS.Freeze = mainFreeze;
GLOBALS.Unfreeze = mainUnfreeze;
GLOBALS.WaitFrame = mainWaitFrame;
GLOBALS.PlayMusic = mainPlayMusic;
GLOBALS.InitWipe = mainInitWipe;
GLOBALS.CloseWipe = mainCloseWipe;
GLOBALS.WaitWipeEnd = mainWaitWipeEnd;
GLOBALS.DisableGUI = mainDisableGUI;
GLOBALS.EnableGUI = mainEnableGUI;
GLOBALS.SetPalesati = mainSetPalesati;
GLOBALS.bAlwaysDisplay = false;
int i;

View File

@ -71,7 +71,7 @@ void DebugChangeScene(CORO_PARAM, const void *param) {
GLOBALS.LoadLocation(details->sceneNumber, scenePos, RMPoint(-1, -1));
MainEnableGUI();
mainEnableGUI();
CORO_END_CODE;
}

View File

@ -2494,11 +2494,11 @@ void RMDialogChoice::Show(CORO_PARAM, RMGfxTargetBuffer *bigBuf) {
_ctx->elaps = 0;
while (_ctx->elaps < 700) {
CORO_INVOKE_0(MainWaitFrame);
MainFreeze();
CORO_INVOKE_0(mainWaitFrame);
mainFreeze();
_ctx->elaps = _vm->getTime() - _ctx->starttime;
m_ptDrawPos.y = 480 - ((_ctx->deltay * 100) / 700 * _ctx->elaps) / 100;
MainUnfreeze();
mainUnfreeze();
}
m_ptDrawPos.y = _ctx->destpt.y;
@ -2538,11 +2538,11 @@ void RMDialogChoice::Hide(CORO_PARAM) {
_ctx->deltay = 480 - m_ptDrawPos.y;
_ctx->elaps = 0;
while (_ctx->elaps < 700) {
CORO_INVOKE_0(MainWaitFrame);
MainFreeze();
CORO_INVOKE_0(mainWaitFrame);
mainFreeze();
_ctx->elaps = _vm->getTime() - _ctx->starttime;
m_ptDrawPos.y = 480 - ((_ctx->deltay * 100) / 700 * (700 - _ctx->elaps)) / 100;
MainUnfreeze();
mainUnfreeze();
}
}

View File

@ -46,75 +46,75 @@ using namespace MPAL;
/* Global functions */
/****************************************/
uint32 MainLoadLocation(int nLoc, RMPoint pt, RMPoint start) {
uint32 mainLoadLocation(int nLoc, RMPoint pt, RMPoint start) {
return _vm->getEngine()->loadLocation(nLoc, pt, start);
}
void MainUnloadLocation(CORO_PARAM, bool bDoOnExit, uint32 *result) {
void mainUnloadLocation(CORO_PARAM, bool bDoOnExit, uint32 *result) {
_vm->getEngine()->unloadLocation(coroParam, bDoOnExit, result);
}
void MainLinkGraphicTask(RMGfxTask *task) {
void mainLinkGraphicTask(RMGfxTask *task) {
_vm->getEngine()->linkGraphicTask(task);
}
void MainFreeze(void) {
void mainFreeze(void) {
_vm->getEngine()->freeze();
}
void MainUnfreeze(void) {
void mainUnfreeze(void) {
_vm->getEngine()->unfreeze();
}
void MainWaitFrame(CORO_PARAM) {
void mainWaitFrame(CORO_PARAM) {
CoroScheduler.waitForSingleObject(coroParam, _vm->_hEndOfFrame, CORO_INFINITE);
}
void MainShowMouse(void) {
void mainShowMouse(void) {
_vm->getEngine()->enableMouse();
}
void MainHideMouse(void) {
void mainHideMouse(void) {
_vm->getEngine()->disableMouse();
}
void MainPlayMusic(int nChannel, const char *filename, int nFX, bool bLoop, int nSync) {
void mainPlayMusic(int nChannel, const char *filename, int nFX, bool bLoop, int nSync) {
_vm->playMusic(nChannel, filename, nFX, bLoop, nSync);
}
void MainDisableInput(void) {
void mainDisableInput(void) {
_vm->getEngine()->disableInput();
}
void MainEnableInput(void) {
void mainEnableInput(void) {
_vm->getEngine()->enableInput();
}
void MainInitWipe(int type) {
void mainInitWipe(int type) {
_vm->getEngine()->initWipe(type);
}
void MainCloseWipe(void) {
void mainCloseWipe(void) {
_vm->getEngine()->closeWipe();
}
void MainWaitWipeEnd(CORO_PARAM) {
void mainWaitWipeEnd(CORO_PARAM) {
_vm->getEngine()->waitWipeEnd(coroParam);
}
void MainEnableGUI(void) {
void mainEnableGUI(void) {
_vm->getEngine()->_bGUIInterface = true;
_vm->getEngine()->_bGUIInventory = true;
_vm->getEngine()->_bGUIOption = true;
}
void MainDisableGUI(void) {
void mainDisableGUI(void) {
_vm->getEngine()->_bGUIInterface = false;
_vm->getEngine()->_bGUIInventory = false;
_vm->getEngine()->_bGUIOption = false;
}
void MainSetPalesati(bool bPalesati) {
void mainSetPalesati(bool bPalesati) {
_vm->getEngine()->setPalesati(bPalesati);
}

View File

@ -366,10 +366,10 @@ void RMGfxEngine::itemIrq(uint32 dwItem, int nPattern, int nStatus) {
if (item != NULL) {
if (nPattern != -1) {
if (GLOBALS.bPatIrqFreeze)
MainFreeze();
mainFreeze();
item->SetPattern(nPattern, true);
if (GLOBALS.bPatIrqFreeze)
MainUnfreeze();
mainUnfreeze();
}
if (nStatus != -1)
item->SetStatus(nStatus);
@ -450,7 +450,7 @@ void RMGfxEngine::unloadLocation(CORO_PARAM, bool bDoOnExit, uint32 *result) {
CORO_INVOKE_2(CoroScheduler.waitForSingleObject, _ctx->h, CORO_INFINITE);
}
MainFreeze();
mainFreeze();
_bLocationLoaded = false;
@ -814,7 +814,7 @@ void RMGfxEngine::loadState(CORO_PARAM, const Common::String &fn) {
CORO_INVOKE_2(unloadLocation, false, NULL);
loadLocation(_ctx->loc, _ctx->tp, RMPoint(-1, -1));
_tony.SetPattern(RMTony::PAT_STANDRIGHT);
MainUnfreeze();
mainUnfreeze();
// On older versions, need to an enter action
if (_ctx->ver < 5)

View File

@ -886,8 +886,8 @@ void RMWipe::WaitForFadeEnd(CORO_PARAM) {
m_bEndFade = true;
m_bFading = false;
CORO_INVOKE_0(MainWaitFrame);
CORO_INVOKE_0(MainWaitFrame);
CORO_INVOKE_0(mainWaitFrame);
CORO_INVOKE_0(mainWaitFrame);
CORO_END_CODE;
}

View File

@ -402,12 +402,12 @@ void TonyEngine::autoSave(CORO_PARAM) {
CORO_BEGIN_CODE(_ctx);
grabThumbnail();
CORO_INVOKE_0(MainWaitFrame);
CORO_INVOKE_0(MainWaitFrame);
MainFreeze();
CORO_INVOKE_0(mainWaitFrame);
CORO_INVOKE_0(mainWaitFrame);
mainFreeze();
_ctx->buf = getSaveStateFileName(0);
_theEngine.saveState(_ctx->buf, (byte *)_curThumbnail, "Autosave");
MainUnfreeze();
mainUnfreeze();
CORO_END_CODE;
}

View File

@ -596,7 +596,7 @@ bool RMTony::StartTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
if (m_bPastorella) {
// Talking whilst a shepherdess
MainFreeze();
mainFreeze();
switch (m_TalkDirection) {
case UP:
SetPattern(PAT_PAST_TALKUP);
@ -614,7 +614,7 @@ bool RMTony::StartTalkCalculate(TALKTYPE nTalkType, int &headStartPat, int &body
SetPattern(PAT_PAST_TALKRIGHT);
break;
}
MainUnfreeze();
mainUnfreeze();
return false;
}
@ -1127,10 +1127,10 @@ void RMTony::StartTalk(CORO_PARAM, TALKTYPE nTalkType) {
// Perform the set pattern
if (_ctx->headStartPat != 0 || _ctx->bodyStartPat != 0) {
MainFreeze();
mainFreeze();
SetPattern(_ctx->headStartPat);
m_body.SetPattern(_ctx->bodyStartPat);
MainUnfreeze();
mainUnfreeze();
if (_ctx->bodyStartPat != 0)
CORO_INVOKE_0(m_body.WaitForEndPattern);
@ -1138,11 +1138,11 @@ void RMTony::StartTalk(CORO_PARAM, TALKTYPE nTalkType) {
CORO_INVOKE_0(WaitForEndPattern);
}
MainFreeze();
mainFreeze();
SetPattern(_ctx->headLoopPat);
if (_ctx->bodyLoopPat)
m_body.SetPattern(_ctx->bodyLoopPat);
MainUnfreeze();
mainUnfreeze();
CORO_END_CODE;
}
@ -1175,9 +1175,9 @@ bool RMTony::EndTalkCalculate(int &headStandPat, int &headEndPat, int &bodyEndPa
}
if (m_bPastorella) {
MainFreeze();
mainFreeze();
SetPattern(finalPat);
MainUnfreeze();
mainUnfreeze();
m_bIsTalking = false;
return false;
}
@ -1447,7 +1447,7 @@ void RMTony::EndTalk(CORO_PARAM) {
// Handles the end of an animated and static, leaving everything unchanged
if (m_bIsStaticTalk) {
if (m_nTalkType == TALK_CONBARBASTATIC) {
MainFreeze();
mainFreeze();
SetPattern(0);
if (m_TalkDirection == UP || m_TalkDirection == LEFT) {
m_body.SetPattern(BPAT_CONBARBALEFT_STATIC);
@ -1456,11 +1456,11 @@ void RMTony::EndTalk(CORO_PARAM) {
m_body.SetPattern(BPAT_CONBARBARIGHT_STATIC);
m_nBodyOffset.Set(-26, -14);
}
MainUnfreeze();
mainUnfreeze();
} else {
MainFreeze();
mainFreeze();
SetPattern(_ctx->headStandPat);
MainUnfreeze();
mainUnfreeze();
CORO_INVOKE_0(m_body.WaitForEndPattern);
}
@ -1471,36 +1471,36 @@ void RMTony::EndTalk(CORO_PARAM) {
// Set the pattern
if (_ctx->headEndPat != 0 && _ctx->bodyEndPat != 0) {
MainFreeze();
mainFreeze();
SetPattern(_ctx->headEndPat);
MainUnfreeze();
mainUnfreeze();
CORO_INVOKE_0(m_body.WaitForEndPattern);
MainFreeze();
mainFreeze();
m_body.SetPattern(_ctx->bodyEndPat);
MainUnfreeze();
mainUnfreeze();
CORO_INVOKE_0(WaitForEndPattern);
CORO_INVOKE_0(m_body.WaitForEndPattern);
} else if (_ctx->bodyEndPat != 0) {
MainFreeze();
mainFreeze();
SetPattern(_ctx->headStandPat);
MainUnfreeze();
mainUnfreeze();
CORO_INVOKE_0(m_body.WaitForEndPattern);
MainFreeze();
mainFreeze();
m_body.SetPattern(_ctx->bodyEndPat);
MainUnfreeze();
mainUnfreeze();
CORO_INVOKE_0(m_body.WaitForEndPattern);
} else if (_ctx->headEndPat != 0) {
CORO_INVOKE_0(m_body.WaitForEndPattern);
MainFreeze();
mainFreeze();
SetPattern(_ctx->headEndPat);
MainUnfreeze();
mainUnfreeze();
CORO_INVOKE_0(WaitForEndPattern);
} else {
@ -1508,10 +1508,10 @@ void RMTony::EndTalk(CORO_PARAM) {
}
if (_ctx->finalPat != 0) {
MainFreeze();
mainFreeze();
m_body.SetPattern(0);
SetPattern(_ctx->finalPat);
MainUnfreeze();
mainUnfreeze();
}
m_bIsTalking = false;
@ -1740,19 +1740,19 @@ void RMTony::StartStatic(CORO_PARAM, TALKTYPE nTalk) {
// e vai con i pattern
m_bIsStaticTalk = true;
MainFreeze();
mainFreeze();
SetPattern(_ctx->headPat);
m_body.SetPattern(_ctx->bodyStartPat);
MainUnfreeze();
mainUnfreeze();
CORO_INVOKE_0(m_body.WaitForEndPattern);
CORO_INVOKE_0(WaitForEndPattern);
MainFreeze();
mainFreeze();
if (_ctx->headLoopPat != -1)
SetPattern(_ctx->headLoopPat);
m_body.SetPattern(_ctx->bodyLoopPat);
MainUnfreeze();
mainUnfreeze();
CORO_END_CODE;
}
@ -1910,24 +1910,24 @@ void RMTony::EndStatic(CORO_PARAM, TALKTYPE nTalk) {
EndStaticCalculate(nTalk, _ctx->bodyEndPat, _ctx->finalPat, _ctx->headEndPat);
if (_ctx->headEndPat != 0) {
MainFreeze();
mainFreeze();
SetPattern(_ctx->headEndPat);
MainUnfreeze();
mainUnfreeze();
CORO_INVOKE_0(WaitForEndPattern);
} else {
// Play please
MainFreeze();
mainFreeze();
m_body.SetPattern(_ctx->bodyEndPat);
MainUnfreeze();
mainUnfreeze();
CORO_INVOKE_0(m_body.WaitForEndPattern);
}
MainFreeze();
mainFreeze();
SetPattern(_ctx->finalPat);
m_body.SetPattern(0);
MainUnfreeze();
mainUnfreeze();
m_bIsStaticTalk = false;