mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
cleanup pixmap
This commit is contained in:
@@ -50,12 +50,13 @@ public abstract class DrawOnPixmap {
|
|||||||
font.setColor(color);
|
font.setColor(color);
|
||||||
font.draw(batch, itemText, x, y, width, Align.center, true);
|
font.draw(batch, itemText, x, y, width, Align.center, true);
|
||||||
batch.end();
|
batch.end();
|
||||||
drawingMap.drawPixmap(Pixmap.createFromFrameBuffer(0, 0, drawingMap.getWidth(), drawingMap.getHeight()),0,0);
|
Pixmap pixmap = Pixmap.createFromFrameBuffer(0, 0, drawingMap.getWidth(), drawingMap.getHeight());
|
||||||
|
drawingMap.drawPixmap(pixmap, 0, 0);
|
||||||
frameBuffer.end();
|
frameBuffer.end();
|
||||||
texture.dispose();
|
texture.dispose();
|
||||||
batch.dispose();
|
batch.dispose();
|
||||||
|
pixmap.dispose();
|
||||||
if (bigText) //don't know why this is needed to circumvent bug getting default size for the same pixelfont
|
if (bigText) //don't know why this is needed to circumvent bug getting default size for the same pixelfont
|
||||||
Controls.getBitmapFont("default");
|
Controls.getBitmapFont("default");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -484,10 +484,12 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb
|
|||||||
g.end();
|
g.end();
|
||||||
g.endClip();
|
g.endClip();
|
||||||
//Rendering ends here. Create a new Pixmap to Texture with mipmaps, otherwise will render as full black.
|
//Rendering ends here. Create a new Pixmap to Texture with mipmaps, otherwise will render as full black.
|
||||||
Texture result = new Texture(Pixmap.createFromFrameBuffer(0, 0, preview_w, preview_h), Forge.isTextureFilteringEnabled());
|
Pixmap pixmap = Pixmap.createFromFrameBuffer(0, 0, preview_w, preview_h);
|
||||||
|
Texture result = new Texture(pixmap, Forge.isTextureFilteringEnabled());
|
||||||
frameBuffer.end();
|
frameBuffer.end();
|
||||||
g.dispose();
|
g.dispose();
|
||||||
frameBuffer.dispose();
|
frameBuffer.dispose();
|
||||||
|
pixmap.dispose();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -519,7 +521,9 @@ public class RewardActor extends Actor implements Disposable, ImageFetcher.Callb
|
|||||||
}
|
}
|
||||||
getGraphics().end();
|
getGraphics().end();
|
||||||
getGraphics().endClip();
|
getGraphics().endClip();
|
||||||
generatedTooltip = new Texture(Pixmap.createFromFrameBuffer(0, 0, preview_w, preview_h), Forge.isTextureFilteringEnabled());
|
Pixmap pixmap = Pixmap.createFromFrameBuffer(0, 0, preview_w, preview_h);
|
||||||
|
generatedTooltip = new Texture(pixmap, Forge.isTextureFilteringEnabled());
|
||||||
|
pixmap.dispose();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
//e.printStackTrace();
|
//e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user