From 2015499ff1f61d59e38e7943248d46cc2b16bc41 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Sun, 11 Dec 2011 00:30:26 +0800 Subject: [PATCH] Fix grav wall --- includes/gravity.h | 2 +- src/graphics.c | 2 +- src/gravity.c | 24 ++++++++++++++++-------- src/main.c | 2 +- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/includes/gravity.h b/includes/gravity.h index 986aefcf9..9168b9df5 100644 --- a/includes/gravity.h +++ b/includes/gravity.h @@ -11,7 +11,7 @@ extern float gravmap[YRES/CELL][XRES/CELL]; //Maps to be used by the main thread extern float *gravpf; extern float *gravxf; extern float *gravyf; -extern unsigned gravmask[YRES/CELL][XRES/CELL]; +extern unsigned *gravmaskf; extern float th_ogravmap[YRES/CELL][XRES/CELL]; // Maps to be processed by the gravity thread extern float th_gravmap[YRES/CELL][XRES/CELL]; diff --git a/src/graphics.c b/src/graphics.c index 62475fce5..55dd0532a 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1427,7 +1427,7 @@ void draw_grav_zones(pixel * vid) { for (x=0; xshape; @@ -476,9 +477,16 @@ void gravity_mask() { if(cshape[y*(XRES/CELL)+x]){ if(c_mask_el->shapeout) - gravmask[y][x] = 0xFFFFFFFF; + maskvalue = 0xFFFFFFFF; else - gravmask[y][x] = 0x00000000; + maskvalue = 0x00000000; + for (j=0; j