aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he/logic_he.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2011-08-03 11:09:32 -0400
committerMatthew Hoops2011-08-03 11:14:52 -0400
commita160179f3716b4350c765d307af6eeba1859b1c1 (patch)
tree377c81a23405a1783fdefbcc40157e56bceaf4fd /engines/scumm/he/logic_he.cpp
parent743ed0517bd251a6d1de25b85ed3afe4feba01ce (diff)
downloadscummvm-rg350-a160179f3716b4350c765d307af6eeba1859b1c1.tar.gz
scummvm-rg350-a160179f3716b4350c765d307af6eeba1859b1c1.tar.bz2
scummvm-rg350-a160179f3716b4350c765d307af6eeba1859b1c1.zip
SCUMM: Fix remaining soccer u32 op_1007 bugs
Thanks to fuzzie for snooping that one out. The field boundaries now work correctly. SoccerMLS/Soccer2004 only are missing proper shadow support now. The original soccer is still having problems with clicking on the field.
Diffstat (limited to 'engines/scumm/he/logic_he.cpp')
-rw-r--r--engines/scumm/he/logic_he.cpp31
1 files changed, 16 insertions, 15 deletions
diff --git a/engines/scumm/he/logic_he.cpp b/engines/scumm/he/logic_he.cpp
index b99459d80d..c4f019c5b5 100644
--- a/engines/scumm/he/logic_he.cpp
+++ b/engines/scumm/he/logic_he.cpp
@@ -1026,23 +1026,24 @@ int LogicHEsoccer::op_1007(int32 *args) {
// This initializes the _userDataD fields that are used in op_1006/op_1011
_intArraysAllocated = false;
- double v14 = (double)args[0] * 0.01;
- double v13 = (double)args[2] * 0.01;
- _userDataD[524] = v14;
- double v12 = atan2(v14, v13);
- _userDataD[520] = v12;
- double v15 = atan2((double)args[3] * 0.01, v13 - (double)args[4] * 0.01);
- double v19 = v15 * 2.0;
- double v17 = atan2(v14, v13 - (double)args[4] * 0.01);
- _userDataD[519] = v19;
- _userDataD[521] = v17;
- _userDataD[525] = (v17 - v12) * 2.0;
- _userDataD[527] = (double)args[5];
- _userDataD[526] = (double)args[6];
- _userDataD[528] = (double)args[7];
+
+ float y1 = (double)args[0] / 100.0;
+ float x1 = (double)args[1] / 100.0;
+ float x2 = (double)args[2] / 100.0;
+ float y2 = (double)args[3] / 100.0;
+ float x3 = (double)args[4] / 100.0;
+
+ _userDataD[518] = x2;
+ _userDataD[519] = 2 * atan2(y2, x2 - x3);
+ _userDataD[520] = atan2(y1, x2);
+ _userDataD[521] = atan2(y1, x1);
+ _userDataD[524] = y1;
+ _userDataD[525] = 2 * (_userDataD[521] - _userDataD[520]);
+ _userDataD[526] = args[6];
+ _userDataD[527] = args[5];
+ _userDataD[528] = args[7];
_userDataD[522] = _userDataD[526] / _userDataD[525];
_userDataD[523] = _userDataD[527] / _userDataD[519];
- _userDataD[518] = v13;
// Clear both byte arrays
memset(_byteArray1, 0, 4096);