Skip to content

Commit aeeca33

Browse files
committed
fix: fix hud texture location
also cleanup prints
1 parent af53286 commit aeeca33

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cake/core/src/main/java/org/demoth/cake/stages/LayoutExecutor.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,20 @@ class LayoutExecutor(
2323
if (texture == null) {
2424
return
2525
}
26-
spriteBatch.draw(texture, x.toFloat() , y.toFloat())
26+
// fixme: quake hud coordinates have different texture origin
27+
spriteBatch.draw(texture, x.toFloat() , y.toFloat() - texture.height)
2728
}
2829

2930
// Example stub for a text-drawing operation.
3031
private fun drawText(x: Int, y: Int, text: String?, alt: Boolean) {
31-
println("Drawing $text at $x, $y alt=$alt")
32+
// println("Drawing $text at $x, $y alt=$alt")
33+
// todo
3234
}
3335

3436
// Example stub for drawing a numeric field.
3537
private fun drawNumber(x: Int, y: Int, value: Short, width: Int, color: Int) {
36-
println("Drawing $value at $x, $y width=$width color=$color")
38+
// println("Drawing $value at $x, $y width=$width color=$color")
39+
// todo
3740
}
3841

3942
/**
@@ -64,8 +67,6 @@ class LayoutExecutor(
6467
return
6568
}
6669

67-
println("Executing layout: $layout")
68-
6970
// Variables to track current position and field width.
7071
var x = 0
7172
var y = 0
@@ -95,7 +96,6 @@ class LayoutExecutor(
9596
val statIndex = tokens.removeFirst().toInt()
9697
val imageIndex = stats[statIndex]
9798
gameConfig[Defines.CS_IMAGES + imageIndex.toInt()]?.let {
98-
println("Drawing ${it.value} at $x, $y")
9999
drawImage(x, y, it.resource as? Texture)
100100
}
101101
}

0 commit comments

Comments
 (0)