donadigo / gbxtools

Various scripts that I use for TrackMania replay analysis
GNU General Public License v3.0
58 stars 11 forks source link

Super Quick Question for ur average_steer_partitions.py script #7

Closed itshawk closed 3 years ago

itshawk commented 3 years ago
def event_to_analog_value(event: ControlEntry):
    val = int32((event.flags << 16) | event.enabled)
    val <<= int32(8)
    val >>= int32(8)
    return -val

What is the purpose of the bitwise shifts in this function?

TomashuTTTT7 commented 3 years ago

I wrote this algorithm for donadigo. These shifts are arithmetic and not logical. They convert non-standard 24bit signed integer into usable 32bit signed integer.