@Override
public void renderImage(
@Nonnull final RenderImage image,
final int x,
final int y,
final int width,
final int height,
@Nonnull final Color c,
final float scale) {
log.finest("renderImage()");
if (width < 0) {
log.warning("Attempted to render image with negative width");
return;
}
if (height < 0) {
log.warning("Attempted to render image with negative height");
return;
}
BatchRenderImage img = (BatchRenderImage) image;
uploadImageInternal(img);
float centerX = x + width / 2.f;
float centerY = y + height / 2.f;
int ix = Math.round(centerX - (width * scale) / 2.f);
int iy = Math.round(centerY - (height * scale) / 2.f);
int iw = Math.round(width * scale);
int ih = Math.round(height * scale);
addQuad(ix, iy, iw, ih, c, c, c, c, img.getX(), img.getY(), img.getWidth(), img.getHeight(), img.getTextureId());
}