mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-11 11:04:05 +09:00
binopan adjustments, get actor head size from the sprite
This commit is contained in:
@@ -80,19 +80,19 @@ object AssembleSheetPixmap {
|
||||
return null
|
||||
}
|
||||
|
||||
fun getMugshotFromAssetsDir(properties: ADProperties): TextureRegion? {
|
||||
// TODO assemble from HAIR_FORE (optional), HAIR (optional) then HEAD (mandatory)
|
||||
fun getMugshotFromAssetsDir(properties: ADProperties): Pair<Pixmap?, TextureRegion?> {
|
||||
// assemble from HAIR_FORE (optional), HAIR (optional) then HEAD (mandatory)
|
||||
val getter = getAssetsDirFileGetter(properties)
|
||||
val headPixmap = getPartPixmap(getter, "HEAD")
|
||||
val hairPixmap = getPartPixmap(getter, "HAIR")
|
||||
val hair2Pixmap = getPartPixmap(getter, "HAIR_FORE")
|
||||
|
||||
if (headPixmap == null) throw FileNotFoundException("Bodyparts file of HEAD is not found!")
|
||||
return composeMugshot(properties, headPixmap, hairPixmap, hair2Pixmap)
|
||||
if (headPixmap == null) return null to null//throw FileNotFoundException("Bodyparts file of HEAD is not found!")
|
||||
return headPixmap to composeMugshot(properties, headPixmap, hairPixmap, hair2Pixmap)
|
||||
}
|
||||
|
||||
fun getMugshotFromVirtualDisk(disk: SimpleFileSystem, entrynum: Long, properties: ADProperties): TextureRegion? {
|
||||
// TODO assemble from HAIR_FORE (optional), HAIR (optional) then HEAD (mandatory)
|
||||
fun getMugshotFromVirtualDisk(disk: SimpleFileSystem, entrynum: Long, properties: ADProperties): Pair<Pixmap?, TextureRegion?> {
|
||||
// assemble from HAIR_FORE (optional), HAIR (optional) then HEAD (mandatory)
|
||||
val bodypartMapping = Properties()
|
||||
bodypartMapping.load(ByteArray64Reader(disk.getFile(entrynum)!!.bytes, Common.CHARSET))
|
||||
val getter = getVirtualDiskFileGetter(bodypartMapping, disk)
|
||||
@@ -100,8 +100,8 @@ object AssembleSheetPixmap {
|
||||
val hairPixmap = getPartPixmap(getter, "HAIR")
|
||||
val hair2Pixmap = getPartPixmap(getter, "HAIR_FORE")
|
||||
|
||||
if (headPixmap == null) throw FileNotFoundException("Bodyparts file of HEAD is not found!")
|
||||
return composeMugshot(properties, headPixmap, hairPixmap, hair2Pixmap)
|
||||
if (headPixmap == null) return null to null//throw FileNotFoundException("Bodyparts file of HEAD is not found!")
|
||||
return headPixmap to composeMugshot(properties, headPixmap, hairPixmap, hair2Pixmap)
|
||||
}
|
||||
|
||||
private fun composeMugshot(properties: ADProperties, head: Pixmap, hair: Pixmap?, hair2: Pixmap?): TextureRegion {
|
||||
@@ -125,7 +125,7 @@ object AssembleSheetPixmap {
|
||||
val tr = TextureRegion(Texture(canvas))
|
||||
|
||||
canvas.dispose()
|
||||
head.dispose()
|
||||
// head.dispose()
|
||||
hair?.dispose()
|
||||
hair2?.dispose()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user