diff options
author | quou <quou@disroot.org> | 2024-07-03 21:27:03 +1000 |
---|---|---|
committer | quou <quou@disroot.org> | 2024-07-03 21:27:03 +1000 |
commit | 8706ad19a8b29073afeece115092f03cbbf369c4 (patch) | |
tree | d37fabd4e2d7d5f3bb8a899014431aef92103bf9 | |
parent | 2da353ada0685a4a8780bf8d2f5aa63252c3f0a5 (diff) |
persp protects against divide by zero.
-rw-r--r-- | maths.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -229,6 +229,7 @@ int* vec_cpy(int* d, const int* s, int c) { } void persp(int* v, int asp) { + v[2] += !v[2]; v[0] = ((v[0] << fbits) / v[2]); v[1] = ((v[1] << fbits) / v[2]) * asp >> fbits; v[2] = f1; |