aboutsummaryrefslogtreecommitdiff
path: root/src/common.h
diff options
context:
space:
mode:
authorSamu Laaksonen <laaksonen.sj@gmail.com>2012-12-10 23:47:03 +0200
committerSamu Laaksonen <laaksonen.sj@gmail.com>2012-12-10 23:47:03 +0200
commitad19e537066742e1a5f9bbb8c3549a47480a33c1 (patch)
tree2f48c08f22bea31756f784495d3c50cd9736e889 /src/common.h
parent9674c5ea91912d07f4726140ca2c88669c03f874 (diff)
downloadprism-ad19e537066742e1a5f9bbb8c3549a47480a33c1.tar.gz
prism-ad19e537066742e1a5f9bbb8c3549a47480a33c1.zip
Box2d integration
Very crude and buggy Needs to be much better
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
new file mode 100644
index 0000000..42f55f7
--- /dev/null
+++ b/src/common.h
@@ -0,0 +1,17 @@
+#ifndef COMMON_H
+#define COMMON_H
+
+// Box2D works best for objects of size 0.1m ... 10m
+// So we have a miniature world this time, makes easier to make things happen when
+// used forces are not too big, and nothing too surprising should not happen either...
+// 16px = 0.1m
+// this makes our main character as 32px * 64px ( 20cm wide and 40cm tall )
+#define _PMF (0.1f / 16.0f)
+
+#define P2M(x) ((x) * (_PMF))
+#define M2P(x) ((x) / (_PMF))
+
+#define FPS 60
+#define FRAME_INTERVAL (1000 / FPS)
+
+#endif