From 481856c02a0e53c0edf2378ac14ce09ef1cc5e8b Mon Sep 17 00:00:00 2001 From: Ilya Shurumov Date: Tue, 22 Sep 2020 02:31:50 +0600 Subject: [PATCH] - fix DealWithHorn - disable ReadAVI verbosity --- src_rebuild/GAME/C/HANDLING.C | 8 ++++---- src_rebuild/GAME/C/MAIN.C | 5 ++++- src_rebuild/utils/video_source/ReadAVI.cpp | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src_rebuild/GAME/C/HANDLING.C b/src_rebuild/GAME/C/HANDLING.C index fcb61d2f..6acd4f09 100644 --- a/src_rebuild/GAME/C/HANDLING.C +++ b/src_rebuild/GAME/C/HANDLING.C @@ -1989,13 +1989,13 @@ void ProcessCarPad(_CAR_DATA *cp, ulong pad, char PadSteer, char use_analogue) { if ((pad & 4) == 0) { - int_steer *= ((int_steer * int_steer) / 80); - analog_angle = ((long long)int_steer * 0x66666667) >> 32; // (int_steer * 0.6) = int_steer * 2457 + 2048 >> 12 (2457 is 4096 * 0.6) + int_steer *= (int_steer * int_steer) / 80; + analog_angle = ((long long)int_steer * 0x66666667) >> 32; // int_steer * 0.4 } else { - int_steer *= ((int_steer * int_steer) / 60); - analog_angle = ((long long)int_steer * 0x88888889) >> 32; // (int_steer * 0.4) = int_steer * 1638 + 2048 >> 12 (1638 is 4096 * 0.4) + int_steer *= (int_steer * int_steer) / 60; + analog_angle = ((long long)int_steer * 0x88888889) >> 32; // int_steer * 0.6 } analog_angle = (analog_angle >> 5) - (int_steer >> 0x1f); diff --git a/src_rebuild/GAME/C/MAIN.C b/src_rebuild/GAME/C/MAIN.C index ecf752d0..be5a22cd 100644 --- a/src_rebuild/GAME/C/MAIN.C +++ b/src_rebuild/GAME/C/MAIN.C @@ -3350,7 +3350,8 @@ void DealWithHorn(char *hr, int i) SetChannelPosition3(channel, (VECTOR *)car->hd.where.t, car->st.n.linearVelocity, -2000, i * 8 + 0x1000, 0); } - *hr = (*hr+1) % 28; // [A] + int horn = *hr + 1 & 0xff; + *hr = (u_char)horn - (((u_char)((long long)horn * 0xaaaaaaab >> 0x20) & 0xfe) + (horn / 3)); } @@ -3408,6 +3409,8 @@ int Havana3DOcclusion(occlFunc func, int *param) return 1; } + draw = 0; + if (camera_position.vy < 0x1bf) { draw = 16; diff --git a/src_rebuild/utils/video_source/ReadAVI.cpp b/src_rebuild/utils/video_source/ReadAVI.cpp index 82c99030..78b5ebe8 100644 --- a/src_rebuild/utils/video_source/ReadAVI.cpp +++ b/src_rebuild/utils/video_source/ReadAVI.cpp @@ -45,7 +45,7 @@ using namespace std; -#define VERBOSE +// #define VERBOSE #define DBG_LVL_DEF 0 #ifdef VERBOSE