mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-14 04:24:05 +09:00
wipwip
This commit is contained in:
@@ -97,23 +97,7 @@ internal object BlocksDrawer {
|
||||
// with TGA, you have a complete control over this, with the expense of added hassle on your side.
|
||||
// -- Torvald, 2018-12-19
|
||||
|
||||
printdbg(this, "Making terrain textures...")
|
||||
|
||||
CreateTileAtlas()
|
||||
//JsonWriter.writeToFile(CreateTileAtlas.tags, "${AppLoader.defaultDir}/test_rendertags.json")
|
||||
// each takes about 60 seconds
|
||||
//printdbg(this, "Writing pixmap as tga: atlas.tga")
|
||||
//PixmapIO2.writeTGA(Gdx.files.absolute("${AppLoader.defaultDir}/atlas.tga"), CreateTileAtlas.atlas, false)
|
||||
//printdbg(this, "Writing pixmap as tga: atlasAutumn.tga")
|
||||
//PixmapIO2.writeTGA(Gdx.files.absolute("${AppLoader.defaultDir}/atlasAutumn.tga"), CreateTileAtlas.atlasAutumn, false)
|
||||
//printdbg(this, "Writing pixmap as tga: atlasWinter.tga")
|
||||
//PixmapIO2.writeTGA(Gdx.files.absolute("${AppLoader.defaultDir}/atlasWinter.tga"), CreateTileAtlas.atlasWinter, false)
|
||||
//printdbg(this, "Writing pixmap as tga: atlasSpring.tga")
|
||||
//PixmapIO2.writeTGA(Gdx.files.absolute("${AppLoader.defaultDir}/atlasSpring.tga"), CreateTileAtlas.atlasSpring, false)
|
||||
//printdbg(this, "Writing pixmap as tga: atlasFluid.tga")
|
||||
//PixmapIO2.writeTGA(Gdx.files.absolute("${AppLoader.defaultDir}/atlasFluid.tga"), CreateTileAtlas.atlasFluid, false)
|
||||
|
||||
|
||||
// CreateTileAtlas.invoke() has been moved to the AppLoader.create() //
|
||||
|
||||
// create terrain texture from pixmaps
|
||||
weatherTerrains = arrayOf(
|
||||
|
||||
@@ -240,7 +240,7 @@ object CreateTileAtlas {
|
||||
// 112x112 or 224x224
|
||||
else {
|
||||
if (tilesPixmap.width != tilesPixmap.height && tilesPixmap.width % (7 * TILE_SIZE) >= 2) {
|
||||
throw IllegalArgumentException("Unrecognized image dimension: ${tilesPixmap.width}x${tilesPixmap.height}")
|
||||
throw IllegalArgumentException("Unrecognized image dimension ${tilesPixmap.width}x${tilesPixmap.height} from $modname:${matte.name()}")
|
||||
}
|
||||
// figure out the tags
|
||||
var connectionType = 0
|
||||
@@ -266,8 +266,10 @@ object CreateTileAtlas {
|
||||
tilesPixmap.dispose()
|
||||
}
|
||||
|
||||
fun tileIDtoAtlasNumber(tileID: ItemID) = tags[tileID]!!.tileNumber
|
||||
fun tileIDtoItemSheetNumber(tileID: ItemID) = itemSheetNumbers[tileID]!!
|
||||
fun tileIDtoAtlasNumber(tileID: ItemID) = tags[tileID]?.tileNumber
|
||||
?: throw NullPointerException("AtlasNumbers mapping from $tileID does not exist")
|
||||
fun tileIDtoItemSheetNumber(tileID: ItemID) = itemSheetNumbers[tileID]
|
||||
?: throw NullPointerException("ItemSheetNumber mapping from $tileID does not exist")
|
||||
|
||||
/**
|
||||
* This function must precede the drawToAtlantes() function, as the marking requires the variable
|
||||
|
||||
Reference in New Issue
Block a user