public void renderSprite(int xp, int yp, int scale, int color, Sprite sprite){
		int size = sprite.size;
		for(int y = 0; y < size * scale; y++){
			int ya = y + yp;
			for(int x = 0; x < size * scale; x++){
				int xa = x + xp;
				if(xa < 0 || ya < 0 || xa >= width || ya >= height) continue;
				int col = sprite.pixels[(x / scale) + (y / scale) * size];
				if(col != 0xffff00ff && col != 0xff7f007f){
					if(color != -1) col = blend(col, color, 0.5f);
					pixels[xa + ya * width] = col;
				}
			}
		}
	}