mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-18 14:34:04 +09:00
no memory leak on ImageBuffer rendering
Turns out, <ImageBuffer>.image creates new Image instance which will NEVER be reclaimed (which causes OutOfMemoryError) unless manually destroy()ed. Former-commit-id: 34840cf63e52e5635ec8acd5fb1bb78923c61063 Former-commit-id: aca4388320fae022a4744f75c1b0f66b544bdafb
This commit is contained in:
@@ -10,7 +10,7 @@ import org.newdawn.slick.Image
|
||||
/**
|
||||
* Created by minjaesong on 2017-01-07.
|
||||
*/
|
||||
class TapestryObject(val image: Image, val artName: String, val artAuthor: String) : FixtureBase(physics = false) {
|
||||
class TapestryObject(image: Image, val artName: String, val artAuthor: String) : FixtureBase(physics = false) {
|
||||
|
||||
// physics = false only speeds up for ~2 frames with 50 tapestries
|
||||
|
||||
@@ -19,6 +19,7 @@ class TapestryObject(val image: Image, val artName: String, val artAuthor: Strin
|
||||
makeNewSprite(image.width, image.height, image)
|
||||
setHitboxDimension(image.width, image.height, 0, 0)
|
||||
setPosition(Terrarum.appgc.mouseX, Terrarum.appgc.mouseY)
|
||||
// you CAN'T destroy the image
|
||||
}
|
||||
|
||||
override fun update(gc: GameContainer, delta: Int) {
|
||||
|
||||
Reference in New Issue
Block a user