VOYEUR: Rename some fields related to fading

This commit is contained in:
Strangerke 2014-02-11 08:00:15 +01:00
parent e688cb5015
commit 1ed4ed47af
6 changed files with 60 additions and 60 deletions

View File

@ -43,7 +43,7 @@ SVoy::SVoy() {
Common::fill((byte *)this, (byte *)this + sizeof(SVoy), 0);
_eventFlags = EVTFLAG_TIME_DISABLED;
_field4376 = _field4378 = 127;
_fadingAmount1 = _fadingAmount2 = 127;
_murderThreshold = 9999;
_aptLoadMode = -1;
_eventFlags |= EVTFLAG_100;
@ -105,11 +105,11 @@ void SVoy::synchronize(Common::Serializer &s) {
for (int idx = 0; idx < _eventCount; ++idx)
_events[idx].synchronize(s);
s.syncAsSint16LE(_field4376);
s.syncAsSint16LE(_field4378);
s.syncAsSint16LE(_field437A);
s.syncAsSint16LE(_field437C);
s.syncAsSint16LE(_field437E);
s.syncAsSint16LE(_fadingAmount1);
s.syncAsSint16LE(_fadingAmount2);
s.syncAsSint16LE(_fadingStep1);
s.syncAsSint16LE(_fadingStep2);
s.syncAsSint16LE(_fadingType);
s.syncAsSint16LE(_victimNumber);
s.syncAsSint16LE(_incriminatedVictimNumber);
s.syncAsSint16LE(_videoEventId);

View File

@ -136,11 +136,11 @@ public:
bool _victimMurdered;
int _murderThreshold;
int _field4376;
int _field4378;
int _field437A;
int _field437C;
int _field437E;
int _fadingAmount1;
int _fadingAmount2;
int _fadingStep1;
int _fadingStep2;
int _fadingType;
int _victimNumber;
int _incriminatedVictimNumber;
int _videoEventId;

View File

@ -505,30 +505,30 @@ void EventsManager::vDoCycleInt() {
void EventsManager::fadeIntFunc() {
switch (_vm->_voy._field437E) {
switch (_vm->_voy._fadingType) {
case 1:
if (_vm->_voy._field4376 < 63)
_vm->_voy._field4376 += _vm->_voy._field437A;
if (_vm->_voy._field4378 < 63)
_vm->_voy._field4378 += _vm->_voy._field437C;
if (_vm->_voy._field4376 > 63)
_vm->_voy._field4376 = 63;
if (_vm->_voy._field4378 > 63)
_vm->_voy._field4378 = 63;
if ((_vm->_voy._field4376 == 63) && (_vm->_voy._field4378 == 63))
_vm->_voy._field437E = 0;
if (_vm->_voy._fadingAmount1 < 63)
_vm->_voy._fadingAmount1 += _vm->_voy._fadingStep1;
if (_vm->_voy._fadingAmount2 < 63)
_vm->_voy._fadingAmount2 += _vm->_voy._fadingStep2;
if (_vm->_voy._fadingAmount1 > 63)
_vm->_voy._fadingAmount1 = 63;
if (_vm->_voy._fadingAmount2 > 63)
_vm->_voy._fadingAmount2 = 63;
if ((_vm->_voy._fadingAmount1 == 63) && (_vm->_voy._fadingAmount2 == 63))
_vm->_voy._fadingType = 0;
break;
case 2:
if (_vm->_voy._field4376 > 0)
_vm->_voy._field4376 -= _vm->_voy._field437A;
if (_vm->_voy._field4378 > 0)
_vm->_voy._field4378 -= _vm->_voy._field437C;
if (_vm->_voy._field4376 < 0)
_vm->_voy._field4376 = 0;
if (_vm->_voy._field4378 < 0)
_vm->_voy._field4378 = 0;
if ((_vm->_voy._field4376 == 0) && (_vm->_voy._field4378 == 0))
_vm->_voy._field437E = 0;
if (_vm->_voy._fadingAmount1 > 0)
_vm->_voy._fadingAmount1 -= _vm->_voy._fadingStep1;
if (_vm->_voy._fadingAmount2 > 0)
_vm->_voy._fadingAmount2 -= _vm->_voy._fadingStep2;
if (_vm->_voy._fadingAmount1 < 0)
_vm->_voy._fadingAmount1 = 0;
if (_vm->_voy._fadingAmount2 < 0)
_vm->_voy._fadingAmount2 = 0;
if ((_vm->_voy._fadingAmount1 == 0) && (_vm->_voy._fadingAmount2 == 0))
_vm->_voy._fadingType = 0;
break;
default:
break;

View File

@ -1112,7 +1112,7 @@ void ThreadResource::doRoom() {
SVoy &voy = vm._voy;
vm.makeViewFinderP();
voy._field437E = 0;
voy._fadingType = 0;
if (!vm._bVoy->getBoltGroup(vm._playStampGroupId, true))
return;
@ -1122,9 +1122,9 @@ void ThreadResource::doRoom() {
(*vm._graphicsManager._vPort)->setupViewPort(vm._graphicsManager._backgroundPage);
vm._graphicsManager._backColors->startFade();
voy._field437A = 2;
voy._field437C = 0;
voy._field437E = 1;
voy._fadingStep1 = 2;
voy._fadingStep2 = 0;
voy._fadingType = 1;
Common::Array<RectEntry> &hotspots = vm._bVoy->boltEntry(vm._playStampGroupId + 4)._rectResource->_entries;
int hotspotId = -1;
@ -1138,7 +1138,7 @@ void ThreadResource::doRoom() {
vm._eventsManager.getMouseInfo();
vm._eventsManager.setMousePos(Common::Point(192, 120));
voy._field437E = 0;
voy._fadingType = 0;
vm._currentVocId = 146;
voy._musicStartTime = voy._RTVNum;
@ -1253,17 +1253,17 @@ void ThreadResource::doRoom() {
vm._eventsManager.delay(1);
vm._eventsManager.hideCursor();
while (!vm.shouldQuit() && voy._field4378 > 0) {
if (voy._field4376 < 63) {
voy._field4376 += 4;
if (voy._field4376 > 63)
voy._field4376 = 63;
while (!vm.shouldQuit() && voy._fadingAmount2 > 0) {
if (voy._fadingAmount1 < 63) {
voy._fadingAmount1 += 4;
if (voy._fadingAmount1 > 63)
voy._fadingAmount1 = 63;
}
if (voy._field4378 > 0) {
voy._field4378 -= 8;
if (voy._field4378 < 0)
voy._field4378 = 0;
if (voy._fadingAmount2 > 0) {
voy._fadingAmount2 -= 8;
if (voy._fadingAmount2 < 0)
voy._fadingAmount2 = 0;
}
vm._eventsManager.delay(1);
@ -1280,7 +1280,7 @@ void ThreadResource::doRoom() {
voy._eventFlags = EVTFLAG_TIME_DISABLED;
vm._eventsManager.incrementTime(1);
voy._viewBounds = nullptr;
voy._field437E = 0;
voy._fadingType = 0;
vm.makeViewFinderP();
if (voy._boltGroupId2 != -1) {

View File

@ -1020,45 +1020,45 @@ void GraphicsManager::screenReset() {
void GraphicsManager::fadeDownICF1(int steps) {
if (steps > 0) {
int stepAmount = _vm->_voy._field4378 / steps;
int stepAmount = _vm->_voy._fadingAmount2 / steps;
for (int idx = 0; idx < steps; ++idx) {
_vm->_voy._field4378 -= stepAmount;
_vm->_voy._fadingAmount2 -= stepAmount;
_vm->_eventsManager.delay(1);
}
}
_vm->_voy._field4378 = 0;
_vm->_voy._fadingAmount2 = 0;
}
void GraphicsManager::fadeUpICF1(int steps) {
if (steps > 0) {
int stepAmount = (63 - _vm->_voy._field4378) / steps;
int stepAmount = (63 - _vm->_voy._fadingAmount2) / steps;
for (int idx = 0; idx < steps; ++idx) {
_vm->_voy._field4378 += stepAmount;
_vm->_voy._fadingAmount2 += stepAmount;
_vm->_eventsManager.delay(1);
}
}
_vm->_voy._field4378 = 63;
_vm->_voy._fadingAmount2 = 63;
}
void GraphicsManager::fadeDownICF(int steps) {
if (steps > 0) {
_vm->_eventsManager.hideCursor();
int stepAmount1 = _vm->_voy._field4376 / steps;
int stepAmount2 = _vm->_voy._field4378 / steps;
int stepAmount1 = _vm->_voy._fadingAmount1 / steps;
int stepAmount2 = _vm->_voy._fadingAmount2 / steps;
for (int idx = 0; idx < steps; ++idx) {
_vm->_voy._field4376 -= stepAmount1;
_vm->_voy._field4378 -= stepAmount2;
_vm->_voy._fadingAmount1 -= stepAmount1;
_vm->_voy._fadingAmount2 -= stepAmount2;
_vm->_eventsManager.delay(1);
}
}
_vm->_voy._field4376 = 0;
_vm->_voy._field4378 = 0;
_vm->_voy._fadingAmount1 = 0;
_vm->_voy._fadingAmount2 = 0;
}
void GraphicsManager::drawDot() {

View File

@ -654,7 +654,7 @@ void VoyeurEngine::reviewTape() {
} while (!shouldQuit() && (!_eventsManager._mouseClicked || foundIndex == -1));
newY = _eventsManager.getMousePos().y;
_voy._field437E = 0;
_voy._fadingType = 0;
_voy._viewBounds = nullptr;
(*_graphicsManager._vPort)->setupViewPort(NULL);