mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-12 11:34:05 +09:00
particles must be disposed of before overwritten
This commit is contained in:
@@ -12,8 +12,9 @@ import net.torvald.UnsafeHelper
|
|||||||
*/
|
*/
|
||||||
internal class UnsafeCvecArray(val width: Int, val height: Int) {
|
internal class UnsafeCvecArray(val width: Int, val height: Int) {
|
||||||
|
|
||||||
private val TOTAL_SIZE_IN_BYTES = 16L * (width + 1) * (height + 1)
|
val TOTAL_SIZE_IN_BYTES = 16L * (width + 1) * (height + 1)
|
||||||
private val array = UnsafeHelper.allocate(TOTAL_SIZE_IN_BYTES)
|
private val array = UnsafeHelper.allocate(TOTAL_SIZE_IN_BYTES)
|
||||||
|
val ptr = array.ptr
|
||||||
|
|
||||||
private inline fun toAddr(x: Int, y: Int) = 16L * (y * width + x)
|
private inline fun toAddr(x: Int, y: Int) = 16L * (y * width + x)
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -152,6 +152,9 @@ open class TerrarumIngame(batch: SpriteBatch) : IngameInstance(batch) {
|
|||||||
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
particlesContainer.overwritingPolicy = {
|
||||||
|
it.dispose()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1300,10 +1303,6 @@ open class TerrarumIngame(batch: SpriteBatch) : IngameInstance(batch) {
|
|||||||
IngameRenderer.resize(App.scr.width, App.scr.height)
|
IngameRenderer.resize(App.scr.width, App.scr.height)
|
||||||
val drawWidth = Toolkit.drawWidth
|
val drawWidth = Toolkit.drawWidth
|
||||||
|
|
||||||
if (gameInitialised) {
|
|
||||||
//LightmapRenderer.fireRecalculateEvent()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (gameFullyLoaded) {
|
if (gameFullyLoaded) {
|
||||||
// resize UIs
|
// resize UIs
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
package net.torvald.terrarum.modulebasegame.gameactors
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A wrapper to support instant player changing (or possessing other NPCs maybe)
|
|
||||||
*
|
|
||||||
* @param actor : here you 'attach' the actor you wish to control
|
|
||||||
* Created by minjaesong on 2016-10-23.
|
|
||||||
*/
|
|
||||||
@Deprecated("The ingame should discriminate 'theRealGamer' and 'actorNowPlaying'")
|
|
||||||
class PlayableActorDelegate(@Transient val actor: ActorHumanoid) {
|
|
||||||
|
|
||||||
/*init {
|
|
||||||
if (actor !is Controllable)
|
|
||||||
throw IllegalArgumentException("Player must be 'Controllable'!")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
fun update(delta: Float) {
|
|
||||||
//val oldTilewisePos = actor.hIntTilewiseHitbox
|
|
||||||
|
|
||||||
actor.update(delta)
|
|
||||||
|
|
||||||
// fire lightmap recalculate event upon tilewise pos change
|
|
||||||
//val newTilewisePos = actor.hIntTilewiseHitbox
|
|
||||||
//if (oldTilewisePos != newTilewisePos) {
|
|
||||||
// LightmapRenderer.fireRecalculateEvent()
|
|
||||||
//}
|
|
||||||
// not going to work: think about stationery tiki torches, global lights, etc
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user