rudimentary fluid rendering so that I can work on it

This commit is contained in:
minjaesong
2024-07-15 03:33:31 +09:00
parent 5f1b860555
commit 6399f609a9
7 changed files with 41 additions and 30 deletions

View File

@@ -0,0 +1,32 @@
package net.torvald.terrarum.modulebasegame.console
import com.badlogic.gdx.Gdx
import net.torvald.gdx.graphics.PixmapIO2
import net.torvald.terrarum.App
import net.torvald.terrarum.console.ConsoleCommand
import net.torvald.terrarum.console.Echo
import java.io.File
/**
* Created by minjaesong on 2024-07-15.
*/
class ExportAtlas : ConsoleCommand {
override fun execute(args: Array<String>) {
if (args.size == 2) {
val dir = App.defaultDir + "/Exports/"
val dirAsFile = File(dir)
if (!dirAsFile.exists()) {
dirAsFile.mkdir()
}
PixmapIO2.writeTGA(Gdx.files.absolute("$dir${args[1]}.tga"), App.tileMaker.atlas, false)
}
}
override fun printUsage() {
Echo("Usage: exportatlas <name>")
Echo("Exports current tile atlas into an image.")
Echo("The image can be found at %appdata%/terrarum/Exports")
}
}

View File

@@ -115,7 +115,7 @@ internal object ExportMap : ConsoleCommand {
override fun printUsage() {
Echo("Usage: export <name>")
Echo("Exports current map into echo image.")
Echo("Exports current map into an image.")
Echo("The image can be found at %appdata%/terrarum/Exports")
}
}