summaryrefslogtreecommitdiff
path: root/src/misc.c
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-06-09 21:35:00 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-06-09 21:35:00 (GMT)
commit1f7106acb16962f925dfccc67dafc39f3bcfd877 (patch)
tree324c1f589da96a30205838e372489d9d9bde6132 /src/misc.c
parent1effdb052a0b952d1390109bed67b3371046ccb7 (diff)
downloadpowder-1f7106acb16962f925dfccc67dafc39f3bcfd877.zip
powder-1f7106acb16962f925dfccc67dafc39f3bcfd877.tar.gz
Gravity zoning
Diffstat (limited to 'src/misc.c')
-rw-r--r--src/misc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/misc.c b/src/misc.c
index f2b713f..2c84baf 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -635,5 +635,15 @@ void RGB_to_HSV(int r,int g,int b,int *h,int *s,int *v)//convert 0-255 RGB value
*v = (int)(255.0*x);
}
}
+
+void membwand(void * destv, void * srcv, size_t destsize, size_t srcsize)
+{
+ size_t i;
+ unsigned char * dest = destv;
+ unsigned char * src = srcv;
+ for(i = 0; i < destsize; i++){
+ dest[i] = dest[i] & src[i%srcsize];
+ }
+}
vector2d v2d_zero = {0,0};
matrix2d m2d_identity = {1,0,0,1};