aboutsummaryrefslogtreecommitdiffstats
path: root/src/common.h
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2023-04-22 18:30:45 +0200
committerBad Diode <bd@badd10de.dev>2023-04-22 18:30:45 +0200
commit4305d585d87c6bbc197b0fe2d9f144d6d0b772e2 (patch)
tree97491407729dd51e14a908d42ffff4d0d94e844e /src/common.h
parent84196f9aa9c1cacc0d240b4aafa795cd26febaa9 (diff)
downloaduxngba-4305d585d87c6bbc197b0fe2d9f144d6d0b772e2.tar.gz
uxngba-4305d585d87c6bbc197b0fe2d9f144d6d0b772e2.zip
Add frame time and FPS calculation to profiling macros
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
index 1fbfa4c..bbe6b52 100644
--- a/src/common.h
+++ b/src/common.h
@@ -735,6 +735,7 @@ wait_vsync(void) {
735#define LEN(ARR) (sizeof(ARR) / sizeof((ARR)[0])) 735#define LEN(ARR) (sizeof(ARR) / sizeof((ARR)[0]))
736 736
737// Fixed-point arithmetic for (i.P) numbers. 737// Fixed-point arithmetic for (i.P) numbers.
738#define FP_NUM(A,P) ((A) << (P))
738#define FP_MUL(A,B,P) (((A) * (B)) >> (P)) 739#define FP_MUL(A,B,P) (((A) * (B)) >> (P))
739#define FP_DIV(A,B,P) (((A) << (P)) / (B)) 740#define FP_DIV(A,B,P) (((A) << (P)) / (B))
740#define FP_LERP(Y0,Y1,X,P) ((Y0) + FP_MUL((X), ((Y1) - (Y0)), P)) 741#define FP_LERP(Y0,Y1,X,P) ((Y0) + FP_MUL((X), ((Y1) - (Y0)), P))