summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-03-07 12:46:22 +0100
committerwm4 <wm4@nowhere>2014-03-07 12:47:07 +0100
commit9cc9d19eee1ceddf189bf21e1b69ea12f95395ec (patch)
tree5121302fe570fc7aae789dd7b6bc1ca3cc883909 /common
parent52428ece91883bd11f573f0b9231fd1630ac72af (diff)
downloadmpv-9cc9d19eee1ceddf189bf21e1b69ea12f95395ec.tar.bz2
mpv-9cc9d19eee1ceddf189bf21e1b69ea12f95395ec.tar.xz
common: add some helper macros
Diffstat (limited to 'common')
-rw-r--r--common/common.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/common.h b/common/common.h
index afb0f6ceda..aad1460aa2 100644
--- a/common/common.h
+++ b/common/common.h
@@ -70,6 +70,9 @@ struct mp_rect {
int x1, y1;
};
+#define mp_rect_w(r) ((r).x1 - (r).x0)
+#define mp_rect_h(r) ((r).y1 - (r).y0)
+
void mp_rect_union(struct mp_rect *rc, const struct mp_rect *src);
bool mp_rect_intersection(struct mp_rect *rc, const struct mp_rect *rc2);