keeperfx
keeperfx copied to clipboard
Non-dynamic lights are off-center
Bug has been there since the original game:
KeeperFX with a non-dynamic light:
KeeperFX with a dynamic light:
Notice the non-dynamic lights display to the north-west(always, independent of camera location).
https://github.com/dkfans/keeperfx/blob/master/src/light_data.c#L754
It would seem that these values are wrong.
Dynamic lights calculate the diagonal length to determine lighting. Static lights take them from the last field in this array.
hmm in the original game those values were calculated, but since we couldn't get the rewritten version to work properly, and it always calculated the same table anyways, we just took the output and put it into that table directly instead of calculating it