bringing back old animating titlescreen

This commit is contained in:
minjaesong
2021-09-08 16:22:25 +09:00
parent 7c38e9a7fd
commit b8e181915e
16 changed files with 157 additions and 108 deletions

View File

@@ -330,6 +330,21 @@ object IngameRenderer : Disposable {
blendNormal(batch)
///////////////////////////////////////////////////////////////////////
if (fboRGBexportRequested) {
fboRGBexportRequested = false
try {
val w = 960
val h = 640
val p = Pixmap.createFromFrameBuffer((fboRGB.width - w).ushr(1), (fboRGB.height - h).ushr(1), w, h)
PixmapIO2.writeTGA(Gdx.files.absolute(fboRGBexportPath), p, true)
p.dispose()
}
catch (e: Throwable) {
e.printStackTrace()
}
}
///////////////////////////////////////////////////////////////////////
@@ -368,6 +383,7 @@ object IngameRenderer : Disposable {
}
internal var fboRGBexportRequested = false
internal var fboRGBexportPath = ""
private fun drawToRGB(
actorsRenderBehind: List<ActorWithBody>?,
@@ -418,25 +434,6 @@ object IngameRenderer : Disposable {
}
}
if (fboRGBexportRequested) {
fboRGBexportRequested = false
val fileChooser = JFileChooser()
fileChooser.showSaveDialog(null)
try {
if (fileChooser.selectedFile != null) {
fboRGB.inAction(null, null) {
val p = ScreenUtils.getFrameBufferPixmap(0, 0, fboRGB.width, fboRGB.height)
PixmapIO2.writeTGA(Gdx.files.absolute(fileChooser.selectedFile.absolutePath), p, false)
p.dispose()
}
}
}
catch (e: Throwable) {
e.printStackTrace()
}
}
fboRGB_lightMixed.inAction(camera, batch) {
setCameraPosition(0f, 0f)