DRASCULA: Merge the floor coordinates into _walkRect

This commit is contained in:
Filippos Karapetis
2017-11-11 17:14:38 +02:00
parent 1e1b6f7ca4
commit 1f1d860797
3 changed files with 14 additions and 17 deletions
+2 -6
View File
@@ -94,10 +94,6 @@ DrasculaEngine::DrasculaEngine(OSystem *syst, const DrasculaGameDescription *gam
_talkSequencesSize = 0;
_numLangs = 0;
feetHeight = 0;
floorX1 = 0;
floorY1 = 0;
floorX2 = 0;
floorY2 = 0;
lowerLimit = 0;
upperLimit = 0;
trackFinal = 0;
@@ -768,8 +764,8 @@ bool DrasculaEngine::verify1() {
}
if (doBreak == 0) {
roomX = CLIP(_mouseX, floorX1, floorX2);
roomY = CLIP(_mouseY, floorY1 + feetHeight, floorY2);
roomX = CLIP<int16>(_mouseX, _walkRect.left, _walkRect.right);
roomY = CLIP<int16>(_mouseY, _walkRect.top + feetHeight, _walkRect.bottom);
startWalking();
}
doBreak = 0;
+1 -1
View File
@@ -443,7 +443,7 @@ public:
int doBreak;
int stepX, stepY;
int curHeight, curWidth, feetHeight;
int floorX1, floorY1, floorX2, floorY2;
Common::Rect _walkRect;
int lowerLimit, upperLimit;
int trackFinal;
bool _walkToObject;
+11 -10
View File
@@ -1732,10 +1732,11 @@ void DrasculaEngine::enterRoom(int roomIndex) {
}
}
p.parseInt(floorX1);
p.parseInt(floorY1);
p.parseInt(floorX2);
p.parseInt(floorY2);
p.parseInt(x1);
p.parseInt(y1);
p.parseInt(x2);
p.parseInt(y2);
_walkRect = Common::Rect(x1, y1, x2, y2);
if (currentChapter != 2) {
p.parseInt(upperLimit);
@@ -1797,27 +1798,27 @@ void DrasculaEngine::enterRoom(int roomIndex) {
color_abc(kColorLightGreen);
if (currentChapter != 2) {
for (l = 0; l <= floorY1; l++)
for (l = 0; l <= _walkRect.top; l++)
factor_red[l] = upperLimit;
for (l = floorY1; l <= 201; l++)
for (l = _walkRect.top; l <= 201; l++)
factor_red[l] = lowerLimit;
chiquez = (float)(lowerLimit - upperLimit) / (float)(floorY2 - floorY1);
for (l = floorY1; l <= floorY2; l++) {
chiquez = (float)(lowerLimit - upperLimit) / (float)(_walkRect.bottom - _walkRect.top);
for (l = _walkRect.top; l <= _walkRect.bottom; l++) {
factor_red[l] = (int)(upperLimit + pequegnez);
pequegnez = pequegnez + chiquez;
}
}
if (_roomNumber == 24) {
for (l = floorY1 - 1; l > 74; l--) {
for (l = _walkRect.top - 1; l > 74; l--) {
factor_red[l] = (int)(upperLimit - pequegnez);
pequegnez = pequegnez + chiquez;
}
}
if (currentChapter == 5 && _roomNumber == 54) {
for (l = floorY1 - 1; l > 84; l--) {
for (l = _walkRect.top - 1; l > 84; l--) {
factor_red[l] = (int)(upperLimit - pequegnez);
pequegnez = pequegnez + chiquez;
}