mirror of
https://github.com/ProjectSWGCore/pswgcommon.git
synced 2026-01-17 00:04:25 -05:00
Fixed unnecessary warnings in bitmap loading
This commit is contained in:
@@ -3,7 +3,6 @@ package com.projectswg.common.data.swgiff.parsers.terrain.bitmap
|
||||
import com.projectswg.common.data.swgiff.IffChunk
|
||||
import com.projectswg.common.data.swgiff.IffForm
|
||||
import com.projectswg.common.data.swgiff.parsers.SWGParser
|
||||
import me.joshlarson.jlcommon.log.Log
|
||||
import java.io.IOException
|
||||
|
||||
class BitmapFamily : SWGParser {
|
||||
@@ -21,7 +20,6 @@ class BitmapFamily : SWGParser {
|
||||
bitmap.readFile(value)
|
||||
this.bitmap = bitmap
|
||||
} catch (e: IOException) {
|
||||
Log.e("Failed to load height bitmap: %s", value)
|
||||
this.bitmap = null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.projectswg.common.data.swgiff.IffChunk
|
||||
import com.projectswg.common.data.swgiff.IffForm
|
||||
import com.projectswg.common.data.swgiff.parsers.terrain.TerrainInfoLookup
|
||||
import com.projectswg.common.data.swgiff.parsers.terrain.bitmap.TargaBitmap
|
||||
import me.joshlarson.jlcommon.log.Log
|
||||
|
||||
class FilterBitmap : FilterLayer() {
|
||||
|
||||
@@ -19,7 +20,12 @@ class FilterBitmap : FilterLayer() {
|
||||
if (bitmap == null)
|
||||
bitmap = terrainInfo.bitmaps[bitmapId]?.bitmap
|
||||
|
||||
val bitmap = bitmap ?: return 1f // Didnt find bitmap for filter
|
||||
val bitmap = bitmap
|
||||
if (bitmap == null) {
|
||||
Log.e("Failed to find required terrain height bitmap: $bitmapId: ${terrainInfo.bitmaps[bitmapId]?.file}")
|
||||
return 1f
|
||||
}
|
||||
|
||||
val width = bitmap.width
|
||||
val height = bitmap.height
|
||||
val transformedX = (p.x - rectangle.minX) * width / (rectangle.maxX - rectangle.minX)
|
||||
|
||||
Reference in New Issue
Block a user