Skip to content

Commit

Permalink
HOPKINS: More field renamings
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Mar 17, 2013
1 parent b984629 commit df8be4e
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 57 deletions.
4 changes: 2 additions & 2 deletions engines/hopkins/globals.cpp
Expand Up @@ -292,7 +292,7 @@ void Globals::initAnimBqe() {

void Globals::initVBob() {
for (int idx = 0; idx < 30; ++idx) {
VBob[idx].field4 = 0;
VBob[idx]._displayMode = 0;
VBob[idx]._xp = 0;
VBob[idx]._yp = 0;
VBob[idx]._frameIndex = 0;
Expand All @@ -304,7 +304,7 @@ void Globals::initVBob() {

void Globals::clearVBob() {
for (int idx = 0; idx < 30; ++idx) {
VBob[idx].field4 = 0;
VBob[idx]._displayMode = 0;
VBob[idx]._xp = 0;
VBob[idx]._yp = 0;
VBob[idx]._frameIndex = 0;
Expand Down
2 changes: 1 addition & 1 deletion engines/hopkins/globals.h
Expand Up @@ -57,7 +57,7 @@ struct LockAnimItem {

struct VBobItem {
byte *_spriteData;
int field4;
int _displayMode;
int _xp;
int _yp;
int _frameIndex;
Expand Down
2 changes: 1 addition & 1 deletion engines/hopkins/lines.cpp
Expand Up @@ -2532,7 +2532,7 @@ int LinesManager::getMouseZone() {
if ((_vm->_eventsManager._mousePos.y + _vm->_eventsManager._mouseOffset.y) > 19) {
for (int bobZoneId = 0; bobZoneId <= 48; bobZoneId++) {
int bobId = BOBZONE[bobZoneId];
if (bobId && BOBZONE_FLAG[bobZoneId] && _vm->_objectsManager._bob[bobId].field0 && _vm->_objectsManager._bob[bobId]._frameIndex != 250 &&
if (bobId && BOBZONE_FLAG[bobZoneId] && _vm->_objectsManager._bob[bobId]._bobMode && _vm->_objectsManager._bob[bobId]._frameIndex != 250 &&
!_vm->_objectsManager._bob[bobId]._disabledAnimationFl && xp > _vm->_objectsManager._bob[bobId]._oldX &&
xp < _vm->_objectsManager._bob[bobId]._oldWidth + _vm->_objectsManager._bob[bobId]._oldX && yp > _vm->_objectsManager._bob[bobId]._oldY) {
if (yp < _vm->_objectsManager._bob[bobId]._oldHeight + _vm->_objectsManager._bob[bobId]._oldY) {
Expand Down
88 changes: 44 additions & 44 deletions engines/hopkins/objects.cpp
Expand Up @@ -498,7 +498,7 @@ void ObjectsManager::resetBob(int idx) {
BobItem &bob = _bob[idx];
ListeItem &item = _vm->_globals.Liste2[idx];

bob.field0 = 0;
bob._bobMode = 0;
bob._spriteData = g_PTRNUL;
bob._xp = 0;
bob._yp = 0;
Expand All @@ -508,8 +508,8 @@ void ObjectsManager::resetBob(int idx) {
bob._moveChange2 = 0;
bob._disabledAnimationFl = false;
bob._animData = g_PTRNUL;
bob.field1C = false;
bob.field1E = 0;
bob._bobMode10 = false;
bob._bobModeChange = 0;
bob.field20 = 0;
bob.field22 = 0;
bob.field34 = false;
Expand Down Expand Up @@ -577,7 +577,7 @@ void ObjectsManager::setBobInfo(int idx) {
void ObjectsManager::displayBob(int idx) {
_priorityFl = true;

if (_bob[idx].field0)
if (_bob[idx]._bobMode)
return;

resetBob(idx);
Expand Down Expand Up @@ -609,17 +609,17 @@ void ObjectsManager::displayBob(int idx) {
}

_bob[idx]._animData = _vm->_globals._animBqe[idx]._data;
_bob[idx].field0 = 10;
_bob[idx]._bobMode = 10;
_bob[idx]._spriteData = _vm->_globals.Bank[bankIdx]._data;

_bob[idx].field1E = v9;
_bob[idx]._bobModeChange = v9;
_bob[idx].field20 = v6;
_bob[idx].field22 = v8;
}

void ObjectsManager::hideBob(int idx) {
if ((_bob[idx].field0 == 3) || (_bob[idx].field0 == 10))
_bob[idx].field0++;
if ((_bob[idx]._bobMode == 3) || (_bob[idx]._bobMode == 10))
_bob[idx]._bobMode++;
}

void ObjectsManager::setBobOffset(int idx, int offset) {
Expand All @@ -632,7 +632,7 @@ void ObjectsManager::SCBOB(int idx) {
return;

for (int i = 0; i <= 20; i++) {
if ((_bob[i].field0) && (!_bob[i]._disabledAnimationFl) && (!_bob[i].field34) && (_bob[i]._frameIndex != 250)) {
if ((_bob[i]._bobMode) && (!_bob[i]._disabledAnimationFl) && (!_bob[i].field34) && (_bob[i]._frameIndex != 250)) {
int oldRight = _bob[i]._oldX + _bob[i]._oldWidth;
int oldBottom = _bob[i]._oldY + _bob[i]._oldHeight;
int cachedRight = hid->_width + hid->_x;
Expand Down Expand Up @@ -921,30 +921,30 @@ void ObjectsManager::beforeSort(SortMode sortMode, int index, int priority) {
void ObjectsManager::displayBobAnim() {
for (int idx = 1; idx <= 35; idx++) {
if (idx <= 20 && PERSO_ON) {
_bob[idx].field1C = false;
_bob[idx]._bobMode10 = false;
continue;
}

if (_bob[idx].field0 != 10)
if (_bob[idx]._bobMode != 10)
continue;

_bob[idx].field1C = false;
_bob[idx]._bobMode10 = false;
if (_bob[idx]._animData == g_PTRNUL || _bob[idx]._disabledAnimationFl || _bob[idx].field20 == 0 || _bob[idx].field20 < -1) {
if (_bob[idx].field1E == 1 || _bob[idx].field1E == 2)
_bob[idx].field1C = true;
if (_bob[idx]._bobModeChange == 1 || _bob[idx]._bobModeChange == 2)
_bob[idx]._bobMode10 = true;
continue;
}

if (_bob[idx]._moveChange1 == _bob[idx]._moveChange2) {
_bob[idx].field1C = true;
_bob[idx]._bobMode10 = true;
} else {
_bob[idx]._moveChange2++;
_bob[idx].field1C = false;
_bob[idx]._bobMode10 = false;
}

if (!_bob[idx].field1C) {
if (_bob[idx].field1E == 1 || _bob[idx].field1E == 2)
_bob[idx].field1C = true;
if (!_bob[idx]._bobMode10) {
if (_bob[idx]._bobModeChange == 1 || _bob[idx]._bobModeChange == 2)
_bob[idx]._bobMode10 = true;
continue;
}

Expand All @@ -967,8 +967,8 @@ void ObjectsManager::displayBobAnim() {
_bob[idx]._moveChange1 /= _vm->_globals._speed;
if (_bob[idx]._moveChange1 > 0) {
_bob[idx]._moveChange2 = 1;
if (_bob[idx].field1E == 1 || _bob[idx].field1E == 2)
_bob[idx].field1C = true;
if (_bob[idx]._bobModeChange == 1 || _bob[idx]._bobModeChange == 2)
_bob[idx]._bobMode10 = true;
continue;
}

Expand All @@ -978,7 +978,7 @@ void ObjectsManager::displayBobAnim() {
if (_bob[idx].field20 > 0)
_bob[idx].field20--;
if (_bob[idx].field20 != -1 && _bob[idx].field20 <= 0) {
_bob[idx].field0 = 11;
_bob[idx]._bobMode = 11;
} else {
_bob[idx]._animDataIdx = 0;
byte *bobData = _bob[idx]._animData + 20;
Expand Down Expand Up @@ -1006,23 +1006,23 @@ void ObjectsManager::displayBobAnim() {
}

_bob[idx]._moveChange2 = 1;
if (_bob[idx].field1E == 1 || _bob[idx].field1E == 2)
_bob[idx].field1C = true;
if (_bob[idx]._bobModeChange == 1 || _bob[idx]._bobModeChange == 2)
_bob[idx]._bobMode10 = true;
}

if (!PERSO_ON && BOBTOUS) {
for (int i = 0; i < 35; i++) {
if (_bob[i].field0 == 10 && !_bob[i]._disabledAnimationFl)
_bob[i].field1C = true;
if (_bob[i]._bobMode == 10 && !_bob[i]._disabledAnimationFl)
_bob[i]._bobMode10 = true;
}
}

BOBTOUS = false;

for (int i = 1; i <= 35; i++) {
if (i > 20 || !PERSO_ON) {
if ((_bob[i].field0 == 10) && (_bob[i].field1C)) {
if ((_bob[i].field1E != 2) && (_bob[i].field1E != 4)) {
if ((_bob[i]._bobMode == 10) && (_bob[i]._bobMode10)) {
if ((_bob[i]._bobModeChange != 2) && (_bob[i]._bobModeChange != 4)) {
if (_vm->_globals.Liste2[i]._visibleFl) {
_vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen,
_vm->_globals.Liste2[i]._posX, _vm->_globals.Liste2[i]._posY,
Expand All @@ -1034,7 +1034,7 @@ void ObjectsManager::displayBobAnim() {
}
}

if (_bob[i].field0 == 11) {
if (_bob[i]._bobMode == 11) {
if (_vm->_globals.Liste2[i]._visibleFl) {
_vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen,
_vm->_globals.Liste2[i]._posX, _vm->_globals.Liste2[i]._posY,
Expand All @@ -1044,14 +1044,14 @@ void ObjectsManager::displayBobAnim() {
_vm->_globals.Liste2[i]._visibleFl = false;
}

_bob[i].field0 = 0;
_bob[i]._bobMode = 0;
}
}
}

for (int i = 1; i <= 35; i++) {
_bob[i]._oldY = 0;
if (_bob[i].field0 == 10 && !_bob[i]._disabledAnimationFl && _bob[i].field1C) {
if (_bob[i]._bobMode == 10 && !_bob[i]._disabledAnimationFl && _bob[i]._bobMode10) {
CALCUL_BOB(i);
int priority = _bob[i]._oldX2 + _bob[i]._oldHeight + _bob[i]._oldY;

Expand All @@ -1070,7 +1070,7 @@ void ObjectsManager::displayVBob() {

for (int idx = 0; idx <= 29; idx++) {
VBobItem *vbob = &_vm->_globals.VBob[idx];
if (vbob->field4 == 4) {
if (vbob->_displayMode == 4) {
width = getWidth(vbob->_spriteData, vbob->_frameIndex);
height = getHeight(vbob->_spriteData, vbob->_frameIndex);

Expand All @@ -1083,7 +1083,7 @@ void ObjectsManager::displayVBob() {
_vm->_graphicsManager.addDirtyRect(vbob->_xp, vbob->_yp, vbob->_xp + width, height + vbob->_yp);
vbob->_surface = _vm->_globals.freeMemory(vbob->_surface);

vbob->field4 = 0;
vbob->_displayMode = 0;
vbob->_spriteData = g_PTRNUL;
vbob->_xp = 0;
vbob->_yp = 0;
Expand All @@ -1094,7 +1094,7 @@ void ObjectsManager::displayVBob() {
vbob->_oldSpriteData = g_PTRNUL;
}

if (vbob->field4 == 3) {
if (vbob->_displayMode == 3) {
width = getWidth(vbob->_oldSpriteData, vbob->_oldFrameIndex);
height = getHeight(vbob->_oldSpriteData, vbob->_oldFrameIndex);

Expand All @@ -1106,7 +1106,7 @@ void ObjectsManager::displayVBob() {

_vm->_graphicsManager.addDirtyRect(vbob->_oldX, vbob->_oldY, vbob->_oldX + width, vbob->_oldY + height);

vbob->field4 = 1;
vbob->_displayMode = 1;
vbob->_oldSpriteData = vbob->_spriteData;

vbob->_surface = _vm->_globals.freeMemory(vbob->_surface);
Expand All @@ -1116,7 +1116,7 @@ void ObjectsManager::displayVBob() {
vbob->_oldFrameIndex = vbob->_frameIndex;
}

if (vbob->field4 == 1) {
if (vbob->_displayMode == 1) {
width = getWidth(vbob->_spriteData, vbob->_frameIndex);
height = getHeight(vbob->_spriteData, vbob->_frameIndex);

Expand All @@ -1143,7 +1143,7 @@ void ObjectsManager::displayVBob() {
}

_vm->_graphicsManager.addDirtyRect(vbob->_xp, vbob->_yp , vbob->_xp + width, vbob->_yp + height);
vbob->field4 = 2;
vbob->_displayMode = 2;
}
}
}
Expand Down Expand Up @@ -2709,8 +2709,8 @@ void ObjectsManager::VBOB(byte *src, int idx, int xp, int yp, int frameIndex) {
error("MAX_VBOB exceeded");

VBobItem *vbob = &_vm->_globals.VBob[idx];
if (vbob->field4 <= 1) {
vbob->field4 = 1;
if (vbob->_displayMode <= 1) {
vbob->_displayMode = 1;
vbob->_xp = xp;
vbob->_yp = yp;
vbob->_frameIndex = frameIndex;
Expand All @@ -2720,8 +2720,8 @@ void ObjectsManager::VBOB(byte *src, int idx, int xp, int yp, int frameIndex) {
vbob->_spriteData = src;
vbob->_oldSpriteData = src;
vbob->_surface = _vm->_globals.freeMemory(vbob->_surface);
} else if (vbob->field4 == 2 || vbob->field4 == 4) {
vbob->field4 = 3;
} else if (vbob->_displayMode == 2 || vbob->_displayMode == 4) {
vbob->_displayMode = 3;
vbob->_oldX = vbob->_xp;
vbob->_oldY = vbob->_yp;
vbob->_oldSpriteData = vbob->_spriteData;
Expand All @@ -2738,10 +2738,10 @@ void ObjectsManager::VBOB_OFF(int idx) {
error("MAX_VBOB exceeded");

VBobItem *vbob = &_vm->_globals.VBob[idx];
if (vbob->field4 <= 1)
vbob->field4 = 0;
if (vbob->_displayMode <= 1)
vbob->_displayMode = 0;
else
vbob->field4 = 4;
vbob->_displayMode = 4;
}

void ObjectsManager::doActionBack(int idx) {
Expand Down
6 changes: 3 additions & 3 deletions engines/hopkins/objects.h
Expand Up @@ -52,7 +52,7 @@ struct SpriteItem {
};

struct BobItem {
int field0;
int _bobMode;
byte *_spriteData;
int _xp;
int _yp;
Expand All @@ -62,8 +62,8 @@ struct BobItem {
int _moveChange2;
bool _disabledAnimationFl;
byte *_animData;
bool field1C;
int field1E;
bool _bobMode10;
int _bobModeChange;
int field20;
int field22;
bool field34; // Set to true in B_CACHE_OFF()
Expand Down
12 changes: 6 additions & 6 deletions engines/hopkins/talk.cpp
Expand Up @@ -602,21 +602,21 @@ void TalkManager::VISU_PARLE() {

void TalkManager::BOB_VISU_PARLE(int idx) {
_vm->_objectsManager._priorityFl = true;
if (!_vm->_objectsManager._bob[idx].field0) {
if (!_vm->_objectsManager._bob[idx]._bobMode) {
_vm->_objectsManager.resetBob(idx);
byte *bqeData = _vm->_globals._animBqe[idx]._data;
int newField1E = READ_LE_INT16(bqeData + 2);
if (!newField1E)
newField1E = 1;
int newMode = READ_LE_INT16(bqeData + 2);
if (!newMode)
newMode = 1;
if (READ_LE_INT16(bqeData + 24)) {
_vm->_objectsManager._bob[idx]._isSpriteFl = true;
_vm->_objectsManager._bob[idx]._zoomFactor = 0;
_vm->_objectsManager._bob[idx]._flipFl = false;
_vm->_objectsManager._bob[idx]._animData = _vm->_globals._animBqe[idx]._data;
_vm->_objectsManager._bob[idx].field0 = 10;
_vm->_objectsManager._bob[idx]._bobMode = 10;
bqeData = _characterSprite;
_vm->_objectsManager._bob[idx]._spriteData = _characterSprite;
_vm->_objectsManager._bob[idx].field1E = newField1E;
_vm->_objectsManager._bob[idx]._bobModeChange = newMode;
_vm->_objectsManager._bob[idx].field20 = -1;
_vm->_objectsManager._bob[idx].field22 = 0;
}
Expand Down

0 comments on commit df8be4e

Please sign in to comment.