public void render(int[] pixs, int xp, int yp, int w, int h, int flip, boolean light) {
		xp -= xOff;
		yp -= yOff;

		boolean flipx = (flip & BIT_MIRROR_X) == BIT_MIRROR_X;
		boolean flipy = (flip & BIT_MIRROR_Y) == BIT_MIRROR_Y;

		for (int y = 0; y < h; y++) {
			if ((y + yp) < 0 || (y + yp) >= height)
				continue;
			int ys = y;
			if (flipy)
				ys = (h - 1) - y;
			for (int x = 0; x < w; x++) {
				if ((x + xp) < 0 || (x + xp) >= width)
					continue;
				int xs = x;
				if (flipx)
					xs = (w - 1) - x;

				int c = pixs[xs + ys * w];
				if (c == 0x7f007f)
					continue;

				if (lightingEnabled && light) {
					c = applyLighting(c, x + xp, y + yp);
				}
				pixels[(x + xp) + (y + yp) * width] = c;
			}
		}
	}