mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-13 20:14:05 +09:00
savegame to save with the thumbnail
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
package net.torvald.terrarum.console
|
||||
|
||||
import com.badlogic.gdx.Gdx
|
||||
import com.badlogic.gdx.graphics.Pixmap
|
||||
import net.torvald.gdx.graphics.PixmapIO2
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.ccG
|
||||
import net.torvald.terrarum.modulebasegame.IngameRenderer
|
||||
@@ -8,7 +11,13 @@ object ScreencapNogui: ConsoleCommand {
|
||||
|
||||
override fun execute(args: Array<String>) {
|
||||
if (args.size == 2) {
|
||||
IngameRenderer.fboRGBexportPath = AppLoader.defaultDir + "/Exports/${args[1]}.tga"
|
||||
IngameRenderer.fboRGBexportCallback = {
|
||||
val w = 960
|
||||
val h = 640
|
||||
val p = Pixmap.createFromFrameBuffer((it.width - w).ushr(1), (it.height - h).ushr(1), w, h)
|
||||
PixmapIO2.writeTGA(Gdx.files.absolute(AppLoader.defaultDir + "/Exports/${args[1]}.tga"), p, true)
|
||||
p.dispose()
|
||||
}
|
||||
IngameRenderer.fboRGBexportRequested = true
|
||||
Echo("FBO exported to$ccG Exports/${args[1]}.tga")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user