Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple heights, refactors, fixes #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ repositories {

dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("com.displee:rs-cache-library:6.4")
implementation("com.google.code.gson:gson:2.8.5")
implementation("com.displee:rs-cache-library:6.8.1")
implementation("com.google.code.gson:gson:2.8.8")
implementation("org.bitbucket.akornilov.kotlin:binary-streams:0.33")
implementation(files("lib/jogamp-fat.jar"))
implementation(files("lib/dockfx-0.4-SNAPSHOT.jar"))
implementation("com.google.inject:guice:4.2.3")
implementation("com.jfoenix:jfoenix:9.0.9")
implementation("org.jsoup:jsoup:1.11.3")
implementation("com.google.inject:guice:5.0.1")
implementation("com.jfoenix:jfoenix:9.0.10")
implementation("org.jsoup:jsoup:1.14.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7")
implementation("org.apache.commons:commons-compress:1.20")
implementation("org.apache.commons:commons-compress:1.21")
}

tasks {
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/cache/loaders/ObjectLoader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class ObjectLoader @Inject constructor(
}
def.params = params
} else {
println("Unrecognized opcode")
println("Unrecognized opcode: $opcode");
}
}

Expand Down
25 changes: 20 additions & 5 deletions src/main/kotlin/controllers/InspectorController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,26 @@ class InspectorController @Inject constructor(
val sb = StringBuilder()
when (hovered.type) {
LocationType.TILE_PAINT -> {
val tp = hovered.sceneTile.tilePaint?: return
sb.append(
"Tile Paint -- nwHeight: ${tp.nwHeight}, neHeight: ${tp.neHeight}, swHeight: ${tp.swHeight}, seHeight: ${tp.seHeight}")
sb.append("sceneX: ${hovered.sceneTile.x} sceneY: ${hovered.sceneTile.y}")
sb.append("\n cacheTile cacheHeight: ${hovered.sceneTile.cacheTile?.cacheHeight} height: ${hovered.sceneTile.cacheTile?.height} \n overlayId: ${hovered.sceneTile.overlayDefinition?.id}")
val st = hovered.sceneTile?: return
val t = st.tilePaint?: return
sb.append("TILE_PAINT:\n")
sb.append(" nwHeight: ${t.nwHeight}, neHeight: ${t.neHeight}, swHeight: ${t.swHeight}, seHeight: ${t.seHeight}\n")
sb.append(" nwColor: ${t.nwColor}, neColor: ${t.neColor}, swColor: ${t.swColor}, seColor: ${t.seColor}\n")
sb.append(" X: ${st.x} Y: ${st.y} cacheTile.cacheHeight: ${st.cacheTile?.cacheHeight} height: ${st.cacheTile?.height}\n")
sb.append(" overlay: id: ${st.overlayDefinition?.id} rgbColor: ${st.overlayDefinition?.rgbColor} texture: ${st.overlayDefinition?.texture} secondaryRgbColor: ${st.overlayDefinition?.secondaryRgbColor} hideUnderlay: ${st.overlayDefinition?.hideUnderlay}\n")
sb.append(" underlay: id: ${st.underlayDefinition?.id} color: ${st.underlayDefinition?.color} hue: ${st.underlayDefinition?.hue} saturation: ${st.underlayDefinition?.saturation} lightness: ${st.underlayDefinition?.lightness}\n")
}
LocationType.TILE_MODEL -> {
val st = hovered.sceneTile?: return
val t = st.tileModel?: return
sb.append("TILE_MODEL:\n")
sb.append(" nwHeight: ${t.nwHeight}, neHeight: ${t.neHeight}, swHeight: ${t.swHeight}, seHeight: ${t.seHeight}\n")
sb.append(" nwColor: ${t.nwColor}, neColor: ${t.neColor}, swColor: ${t.swColor}, seColor: ${t.seColor}\n")
sb.append(" nwColorB: ${t.nwColorB}, neColorB: ${t.neColorB}, swColorB: ${t.swColorB}, seColorB: ${t.seColorB}\n")
sb.append(" X: ${st.x} Y: ${st.y} cacheTile.cacheHeight: ${st.cacheTile?.cacheHeight} height: ${st.cacheTile?.height}\n")
sb.append(" overlayPath: ${t.overlayPath} overlayRotation: ${t.overlayRotation} overlayTexture: ${t.overlayTexture} underlayRgb: ${t.underlayRgb} overlayRgb: ${t.overlayRgb}\n");
sb.append(" overlay: id: ${st.overlayDefinition?.id} rgbColor: ${st.overlayDefinition?.rgbColor} texture: ${st.overlayDefinition?.texture} secondaryRgbColor: ${st.overlayDefinition?.secondaryRgbColor} hideUnderlay: ${st.overlayDefinition?.hideUnderlay}\n")
sb.append(" underlay: id: ${st.underlayDefinition?.id} color: ${st.underlayDefinition?.color} hue: ${st.underlayDefinition?.hue} saturation: ${st.underlayDefinition?.saturation} lightness: ${st.underlayDefinition?.lightness}\n")
}
LocationType.WALL_CORNER -> {
val wall = hovered.sceneTile.wall?: return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class TopdownMapController @Inject constructor(
}

private fun drawFull() {
return
// return
sceneHeight = scene.radius * REGION_SIZE
sceneWidth = sceneHeight
canvasHeight = sceneWidth * tileSize.get()
Expand Down
14 changes: 8 additions & 6 deletions src/main/kotlin/controllers/worldRenderer/Renderer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -812,12 +812,13 @@ class Renderer @Inject constructor(
private fun drawTiles() {
modelBuffers.clear()
modelBuffers.targetBufferOffset = 0
for (x in 0 until scene.radius * REGION_SIZE) {
for (y in 0 until scene.radius * REGION_SIZE) {
var tile: SceneTile? = scene.getTile(0, x, y)
if (tile != null) {
drawTile(tile)
}
for (z in 0 until REGION_HEIGHT) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea how to fix the height of the second floor walls on region id 14642?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! Do you mean these?

image

No idea actually.

DO you think we could just merge this MR and then resolve this later? At least multiple heights would work.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for (x in 0 until scene.radius * REGION_SIZE) {
for (y in 0 until scene.radius * REGION_SIZE) {
var tile: SceneTile? = scene.getTile(z, x, y)
if (tile != null) {
drawTile(tile)
}
// tile = scene.getTile(1, x, y)
// if (tile != null) {
// drawTile(tile)
Expand All @@ -830,6 +831,7 @@ class Renderer @Inject constructor(
// if (tile != null) {
// drawTile(tile)
// }
}
}
}

Expand Down
Loading