public void draw(Sprite sprite, int xp, int yp, int mirrorDir, int scale) {
		xp -= xOffs;
		yp -= yOffs;

		int scaleMap = scale - 1;
		boolean mirrory = (mirrorDir & bity) > 0;
		boolean mirrorx = (mirrorDir & bitx) > 0;

		for (int y = 0; y < sprite.h; y++) {
			int ySprite = y;
			if (mirrory) ySprite = (sprite.h - 1) - y;
			int yPixel = y + yp + (y * scaleMap) - (scaleMap >> 1);
			for (int x = 0; x < sprite.w; x++) {
				int xSprite = x;
				if (mirrorx) xSprite = (sprite.w - 1) - x;
				int xPixel = x + xp + (x * scaleMap) - (scaleMap >> 1);

				int col = sprite.pixels[xSprite + ySprite * sprite.w];

				if (col < 0) {
					for (int yScale = 0; yScale < scale; yScale++) {
						if (yScale + yPixel < 0 || yScale + yPixel >= h) continue;
						for (int xScale = 0; xScale < scale; xScale++) {
							if (xPixel + xScale < 0 || xScale + xPixel >= w) continue;

							pixels[(xPixel + xScale) + (yPixel + yScale) * w] = col;
						}
					}
				}
			}
		}
	}