+static void eraseArea(struct point *p, int width, int height)
+{
+ int x, y;
+ unsigned short *dst;
+
+ int x0 = p->x;
+ int y0 = p->y;
+ int x1 = p->x + width;
+ int y1 = p->y + height;
+
+ int dx, dy;
+
+ if (x0 < 0) x0 = 0;
+ if (y0 < 0) y0 = 0;
+ if (x1 > fb_width) x1 = fb_width;
+ if (y1 > fb_height) y1 = fb_height;
+
+ dx = x1 - x0;
+ //dy = y1 - y0;
+
+ dst = (unsigned short*)lightmap + y0 * fb_width + x0;
+
+ for (y = y0; y < y1; y++)
+ {
+ for (x = x0; x < x1; x++)
+ {
+ *dst++ = 0;
+ }
+ dst += fb_width - dx;
+ }
+}