diff options
author | Matthew Hoops | 2011-08-02 16:11:29 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-08-02 16:11:29 -0400 |
commit | 6d5d5f8269d9f5f705f4c90d0455f0ff30ec11c3 (patch) | |
tree | 08e22cc4a118ee80379dc846baa606475f4bbc78 /engines/scumm/he | |
parent | 42c359a879b96ba1380ff97828fe8d7fdbcc8687 (diff) | |
download | scummvm-rg350-6d5d5f8269d9f5f705f4c90d0455f0ff30ec11c3.tar.gz scummvm-rg350-6d5d5f8269d9f5f705f4c90d0455f0ff30ec11c3.tar.bz2 scummvm-rg350-6d5d5f8269d9f5f705f4c90d0455f0ff30ec11c3.zip |
SCUMM: Fix some more soccer u32 logic bugs
The camera now pans correctly. The players/ball have yet to reappear on the field, however. Thanks to fuzzie for spotting
Diffstat (limited to 'engines/scumm/he')
-rw-r--r-- | engines/scumm/he/logic_he.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/engines/scumm/he/logic_he.cpp b/engines/scumm/he/logic_he.cpp index 11b10a65ef..e8af5a2a53 100644 --- a/engines/scumm/he/logic_he.cpp +++ b/engines/scumm/he/logic_he.cpp @@ -1009,7 +1009,7 @@ int LogicHEsoccer::op_1006(int32 a1, int32 a2, int32 a3, int32 a4) { _userDataD[529] = a4; var108 = atan2(v1, v3) * _userDataD[523] - a4; - var109 = _userDataD[526] - _userDataD[528] + (_userDataD[521] - atan2(_userDataD[524] - v2, v3)) * _userDataD[522]; + var109 = _userDataD[526] - _userDataD[528] - (_userDataD[521] - atan2(_userDataD[524] - v2, v3)) * _userDataD[522]; writeScummVar(108, (int32)var108); writeScummVar(109, (int32)var109); @@ -1213,15 +1213,16 @@ int LogicHEsoccer::op_1011(int32 a1, int32 a2, int32 a3, int32 a4, int32 a5, int } float v7 = atan2(_userDataD[524] - v28, (double)v31); - int v8 = (int)(_userDataD[526] - (_userDataD[521] - v7) * _userDataD[522] + 300.0); + int v8 = (int)(_userDataD[526] - (_userDataD[521] - v7) * _userDataD[522] - 300.0); + double v9 = _userDataD[523]; - double v9 = atan2(_userDataD[523], (double)v31); + v29 = atan2(v29, v31); // x/y position? putInArray(a2, i, 0, (int32)(v29 * v9 + 640.0)); putInArray(a2, i, 1, v8); double v10 = atan2(_userDataD[524], (double)v31); - int v12 = (int)(_userDataD[526] - (_userDataD[521] - (float)v10) * _userDataD[522] + 300.0); + int v12 = (int)(_userDataD[526] - (_userDataD[521] - (float)v10) * _userDataD[522] - 300.0); double v13 = _userDataD[523]; v29 = atan2(v29, v31); @@ -1241,7 +1242,7 @@ int LogicHEsoccer::op_1011(int32 a1, int32 a2, int32 a3, int32 a4, int32 a5, int // This retains v28 from (i == 17)? float v16 = _userDataD[524] - v28; - float v17 = v16 / tan((_userDataD[528] + v15 - _userDataD[526]) / (_userDataD[522] + _userDataD[521])); + float v17 = v16 / tan((_userDataD[528] + v15 - _userDataD[526]) / _userDataD[522] + _userDataD[521]); double v18 = tan((double)(v14 - 640) / _userDataD[523]) * v17; putInArray(a1, i, 0, (int)(v18 * 100.0)); putInArray(a1, i, 2, (int)(v17 * 100.0)); @@ -1388,6 +1389,9 @@ int LogicHEsoccer::op_1014(int32 a1, int32 a2, int32 a3, int32 a4, int32 a5, int double v27 = (double)a3; double v15, v28 = 0.0, v30 = 0.0, v32 = 0.0; + writeScummVar(108, 0); + writeScummVar(109, 0); + switch (a10) { case 1: case 3: |