| 813 | } |
| 814 | |
| 815 | public void drawCardImage(FImage image, TextureRegion damage_overlay, float x, float y, float w, float h, boolean drawGrayscale, boolean damaged) { |
| 816 | if (image == null) |
| 817 | return; |
| 818 | if (!drawGrayscale) { |
| 819 | image.draw(this, x, y, w, h); |
| 820 | if (damage_overlay != null && damaged) |
| 821 | batch.draw(damage_overlay, adjustX(x), adjustY(y, h), w, h); |
| 822 | } else { |
| 823 | batch.end(); |
| 824 | shaderGrayscale.bind(); |
| 825 | shaderGrayscale.setUniformf("u_grayness", 1f); |
| 826 | shaderGrayscale.setUniformf("u_bias", 0.8f); |
| 827 | batch.setShader(shaderGrayscale); |
| 828 | batch.begin(); |
| 829 | //draw gray |
| 830 | image.draw(this, x, y, w, h); |
| 831 | //reset |
| 832 | batch.end(); |
| 833 | batch.setShader(null); |
| 834 | batch.begin(); |
| 835 | } |
| 836 | } |
| 837 | |
| 838 | public void drawCardImage(Texture image, TextureRegion damage_overlay, float x, float y, float w, float h, boolean drawGrayscale, boolean damaged) { |
| 839 | if (!drawGrayscale) { |