Ticket #8366: mivga-scale-patch-nows.txt

File mivga-scale-patch-nows.txt, 2.4 KB (added by SF/madm00se, 19 years ago)

MIVGA actor scale patch - whitespace ignored

Line 
1Index: scummvm/scumm/actor.cpp
2===================================================================
3RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
4retrieving revision 1.314
5diff -U5 -w -d -r1.314 actor.cpp
6--- scummvm/scumm/actor.cpp 12 Oct 2004 14:40:27 -0000 1.314
7+++ scummvm/scumm/actor.cpp 4 Nov 2004 19:04:30 -0000
8@@ -1034,11 +1034,11 @@
9 }
10
11 bcr->_clipOverride = _clipOverride;
12
13 if (_vm->_version == 4 && boxscale & 0x8000) {
14- bcr->_scaleX = bcr->_scaleY = _vm->getScale(_walkbox, _pos.x, _pos.y);
15+ bcr->_scaleX = bcr->_scaleY = _vm->getScaleFromSlot((boxscale & 0x7fff) + 1, _pos.x, _pos.y);
16 } else {
17 bcr->_scaleX = scalex;
18 bcr->_scaleY = scaley;
19 }
20
21Index: scummvm/scumm/boxes.cpp
22===================================================================
23RCS file: /cvsroot/scummvm/scummvm/scumm/boxes.cpp,v
24retrieving revision 1.81
25diff -U5 -w -d -r1.81 boxes.cpp
26--- scummvm/scumm/boxes.cpp 28 Sep 2004 23:35:07 -0000 1.81
27+++ scummvm/scumm/boxes.cpp 4 Nov 2004 19:04:32 -0000
28@@ -175,12 +175,20 @@
29 slot = 0;
30 }
31
32 // Was a scale slot specified? If so, we compute the effective scale
33 // from it, ignoring the box scale.
34- if (slot) {
35+ if (slot)
36+ scale = getScaleFromSlot(slot, x, y);
37+
38+ return scale;
39+}
40+
41+
42+int ScummEngine::getScaleFromSlot(int slot, int x, int y) {
43 assert(1 <= slot && slot <= ARRAYSIZE(_scaleSlots));
44+ int scale;
45 int scaleX = 0, scaleY = 0;
46 ScaleSlot &s = _scaleSlots[slot-1];
47
48 if (s.y1 == s.y2 && s.x1 == s.x2)
49 error("Invalid scale slot %d", slot);
50@@ -206,13 +214,11 @@
51 // Clip the scale to range 1-255
52 if (scale < 1)
53 scale = 1;
54 else if (scale > 255)
55 scale = 255;
56- }
57
58- // Finally return the scale
59 return scale;
60 }
61
62 int ScummEngine::getBoxScale(int box) {
63 if (_features & GF_NO_SCALING)
64Index: scummvm/scumm/scumm.h
65===================================================================
66RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
67retrieving revision 1.513
68diff -U5 -w -d -r1.513 scumm.h
69--- scummvm/scumm/scumm.h 24 Oct 2004 06:58:41 -0000 1.513
70+++ scummvm/scumm/scumm.h 4 Nov 2004 19:04:33 -0000
71@@ -1115,10 +1115,11 @@
72 Box *getBoxBaseAddr(int box);
73 byte getBoxFlags(int box);
74 int getBoxScale(int box);
75
76 int getScale(int box, int x, int y);
77+ int getScaleFromSlot(int slot, int x, int y);
78
79 protected:
80 // Scaling slots/items
81 struct ScaleSlot {
82 int x1, y1, scale1;