HOPKINS: More renaming in ObjectsManager

This commit is contained in:
Strangerke 2013-03-30 11:54:07 +01:00
parent 3648790efb
commit 8b5fc0e2e5
5 changed files with 24 additions and 25 deletions

View File

@ -473,7 +473,7 @@ void DialogsManager::showInventory() {
_inventDisplayedFl = false;
_vm->_graphicsManager->copySurface(_vm->_graphicsManager->_vesaScreen, _inventX, 114, _inventWidth, _inventHeight, _vm->_graphicsManager->_vesaBuffer, _inventX, 114);
_vm->_graphicsManager->addDirtyRect(_inventX, 114, _inventX + _inventWidth, _inventWidth + 114);
_vm->_objectsManager->BOBTOUS = true;
_vm->_objectsManager->_refreshBobMode10Fl = true;
}
_inventWin1 = _vm->_globals->freeMemory(_inventWin1);
@ -596,7 +596,7 @@ void DialogsManager::showLoadGame() {
_vm->_objectsManager->_saveLoadFl = false;
_vm->_graphicsManager->copySurface(_vm->_graphicsManager->_vesaScreen, _vm->_eventsManager->_startPos.x + 183, 60, 274, 353, _vm->_graphicsManager->_vesaBuffer, _vm->_eventsManager->_startPos.x + 183, 60);
_vm->_graphicsManager->addDirtyRect(_vm->_eventsManager->_startPos.x + 183, 60, 457, 413);
_vm->_objectsManager->BOBTOUS = true;
_vm->_objectsManager->_refreshBobMode10Fl = true;
_vm->_objectsManager->_saveLoadSprite = _vm->_globals->freeMemory(_vm->_objectsManager->_saveLoadSprite);
_vm->_objectsManager->_saveLoadSprite2 = _vm->_globals->freeMemory(_vm->_objectsManager->_saveLoadSprite2);
_vm->_objectsManager->_saveLoadX = 0;
@ -625,7 +625,7 @@ void DialogsManager::showSaveGame() {
_vm->_objectsManager->_saveLoadFl = false;
_vm->_graphicsManager->copySurface(_vm->_graphicsManager->_vesaScreen, _vm->_eventsManager->_startPos.x + 183, 60, 274, 353, _vm->_graphicsManager->_vesaBuffer, _vm->_eventsManager->_startPos.x + 183, 60);
_vm->_graphicsManager->addDirtyRect(_vm->_eventsManager->_startPos.x + 183, 60, _vm->_eventsManager->_startPos.x + 457, 413);
_vm->_objectsManager->BOBTOUS = true;
_vm->_objectsManager->_refreshBobMode10Fl = true;
_vm->_objectsManager->_saveLoadSprite = _vm->_globals->freeMemory(_vm->_objectsManager->_saveLoadSprite);
_vm->_objectsManager->_saveLoadSprite2 = _vm->_globals->freeMemory(_vm->_objectsManager->_saveLoadSprite2);
_vm->_objectsManager->_saveLoadX = 0;

View File

@ -113,8 +113,8 @@ ObjectsManager::ObjectsManager(HopkinsEngine *vm) {
_hidingActiveFl = false;
_curObjectFileNum = 0;
_objectDataBuf = g_PTRNUL;
PERSO_ON = false;
BOBTOUS = false;
_charactersEnabledFl = false;
_refreshBobMode10Fl = false;
}
ObjectsManager::~ObjectsManager() {
@ -399,7 +399,7 @@ void ObjectsManager::displaySprite() {
}
}
if (!PERSO_ON) {
if (!_charactersEnabledFl) {
for (int idx = 0; idx < MAX_SPRITE; ++idx) {
if (Liste[idx]._visibleFl) {
clipX = Liste[idx]._posX - 2;
@ -421,7 +421,7 @@ void ObjectsManager::displaySprite() {
displayBobAnim();
displayVBob();
if (!PERSO_ON) {
if (!_charactersEnabledFl) {
// Handle drawing characters on the screen
for (int idx = 0; idx < MAX_SPRITE; ++idx) {
Liste[idx]._visibleFl = false;
@ -991,7 +991,7 @@ void ObjectsManager::beforeSort(SortMode sortMode, int index, int priority) {
// Display BOB Anim
void ObjectsManager::displayBobAnim() {
for (int idx = 1; idx <= 35; idx++) {
if (idx <= 20 && PERSO_ON) {
if (idx <= 20 && _charactersEnabledFl) {
_bob[idx]._bobMode10 = false;
continue;
}
@ -1024,7 +1024,7 @@ void ObjectsManager::displayBobAnim() {
_bob[idx]._xp = READ_LE_INT16(dataPtr + 2 * dataIdx);
if (_lockedAnims[idx]._enableFl)
_bob[idx]._xp = _lockedAnims[idx]._posX;
if ( PERSO_ON && idx > 20 )
if ( _charactersEnabledFl && idx > 20 )
_bob[idx]._xp += _vm->_eventsManager->_startPos.x;
_bob[idx]._yp = READ_LE_INT16(dataPtr + 2 * dataIdx + 2);
@ -1057,7 +1057,7 @@ void ObjectsManager::displayBobAnim() {
if (_lockedAnims[idx]._enableFl)
_bob[idx]._xp = _lockedAnims[idx]._posX;
if (PERSO_ON && idx > 20)
if (_charactersEnabledFl && idx > 20)
_bob[idx]._xp += _vm->_eventsManager->_startPos.x;
_bob[idx]._yp = READ_LE_INT16(bobData + 2);
@ -1081,17 +1081,17 @@ void ObjectsManager::displayBobAnim() {
_bob[idx]._bobMode10 = true;
}
if (!PERSO_ON && BOBTOUS) {
if (!_charactersEnabledFl && _refreshBobMode10Fl) {
for (int i = 0; i < 35; i++) {
if (_bob[i]._bobMode == 10 && !_bob[i]._disabledAnimationFl)
_bob[i]._bobMode10 = true;
}
}
BOBTOUS = false;
_refreshBobMode10Fl = false;
for (int i = 1; i <= 35; i++) {
if (i > 20 || !PERSO_ON) {
if (i > 20 || !_charactersEnabledFl) {
if ((_bob[i]._bobMode == 10) && (_bob[i]._bobMode10)) {
if ((_bob[i]._bobModeChange != 2) && (_bob[i]._bobModeChange != 4)) {
if (Liste2[i]._visibleFl) {
@ -2659,7 +2659,7 @@ void ObjectsManager::handleSpecialGames() {
_vm->_graphicsManager->_scrollOffset = 0;
_vm->_graphicsManager->NB_SCREEN(true);
_vm->_soundManager->_specialSoundNum = 198;
PERSO_ON = true;
_charactersEnabledFl = true;
_vm->_animationManager->unsetClearAnimFlag();
_vm->_animationManager->playAnim("otage.ANM", 1, 24, 500, true);
_vm->_soundManager->_specialSoundNum = 0;
@ -2668,7 +2668,7 @@ void ObjectsManager::handleSpecialGames() {
_vm->_saveLoadManager->load("TEMP1.SCR", _vm->_graphicsManager->_vesaScreen);
g_system->getSavefileManager()->removeSavefile("TEMP1.SCR");
PERSO_ON = false;
_charactersEnabledFl = false;
memcpy(_vm->_graphicsManager->_palette, oldPalette, 769);
_vm->_graphicsManager->setPaletteVGA256(_vm->_graphicsManager->_palette);
_vm->_globals->freeMemory(oldPalette);

View File

@ -241,9 +241,8 @@ public:
SpriteItem _sprite[6];
BobItem _bob[36];
LockAnimItem _lockedAnims[30];
bool PERSO_ON;
bool BOBTOUS;
bool _charactersEnabledFl;
bool _refreshBobMode10Fl;
ObjectsManager(HopkinsEngine *vm);
~ObjectsManager();

View File

@ -2313,12 +2313,12 @@ int ScriptManager::handleOpcode(byte *dataP) {
case 246:
_vm->_objectsManager->removeSprite(0);
_vm->_objectsManager->OPTI_ONE(6, 0, 15, 0);
_vm->_objectsManager->PERSO_ON = true;
_vm->_objectsManager->_charactersEnabledFl = true;
_vm->_graphicsManager->NB_SCREEN(true);
_vm->_animationManager->playSequence2("TUNNEL.SEQ", 1, 18, 20, true);
_vm->_graphicsManager->_noFadingFl = true;
_vm->_graphicsManager->fadeOutLong();
_vm->_objectsManager->PERSO_ON = false;
_vm->_objectsManager->_charactersEnabledFl = false;
_vm->_globals->_exitId = 100;
break;

View File

@ -91,7 +91,7 @@ void TalkManager::startAnimatedCharacterDialogue(const Common::String &filename)
if (!_vm->_graphicsManager->_lineNbr)
_vm->_graphicsManager->_scrollOffset = 0;
_vm->_graphicsManager->NB_SCREEN(true);
_vm->_objectsManager->PERSO_ON = true;
_vm->_objectsManager->_charactersEnabledFl = true;
searchCharacterPalette(_paletteBufferIdx, false);
startCharacterAnim0(_paletteBufferIdx, false);
initCharacterAnim();
@ -129,7 +129,7 @@ void TalkManager::startAnimatedCharacterDialogue(const Common::String &filename)
_vm->_saveLoadManager->load("TEMP.SCR", _vm->_graphicsManager->_vesaScreen);
g_system->getSavefileManager()->removeSavefile("TEMP.SCR");
_vm->_objectsManager->PERSO_ON = false;
_vm->_objectsManager->_charactersEnabledFl = false;
_vm->_eventsManager->_mouseCursorId = oldMouseCursorId;
_vm->_eventsManager->changeMouseCursor(oldMouseCursorId);
@ -1007,14 +1007,14 @@ void TalkManager::animateObject(const Common::String &filename) {
_vm->_graphicsManager->NB_SCREEN(true);
_paletteBufferIdx = 20 * READ_LE_INT16((uint16 *)_characterBuffer + 42) + 110;
_vm->_graphicsManager->NB_SCREEN(true);
_vm->_objectsManager->PERSO_ON = true;
_vm->_objectsManager->_charactersEnabledFl = true;
searchCharacterPalette(_paletteBufferIdx, true);
startCharacterAnim0(_paletteBufferIdx, false);
byte *oldAnswerBufferPtr = _vm->_globals->_answerBuffer;
_vm->_globals->_answerBuffer = g_PTRNUL;
_vm->_globals->_freezeCharacterFl = true;
_vm->_objectsManager->loadLinkFile(screenFilename);
_vm->_objectsManager->PERSO_ON = true;
_vm->_objectsManager->_charactersEnabledFl = true;
_vm->_globals->_actionMoveTo = false;
_vm->_objectsManager->_zoneNum = -1;
initCharacterAnim();
@ -1063,7 +1063,7 @@ void TalkManager::animateObject(const Common::String &filename) {
_vm->_saveLoadManager->load("TEMP.SCR", _vm->_graphicsManager->_vesaScreen);
g_system->getSavefileManager()->removeSavefile("TEMP.SCR");
_vm->_objectsManager->PERSO_ON = false;
_vm->_objectsManager->_charactersEnabledFl = false;
_vm->_eventsManager->_mouseCursorId = 4;
_vm->_eventsManager->changeMouseCursor(4);
_vm->_graphicsManager->SETCOLOR3(253, 100, 100, 100);