@@ -52,11 +52,12 @@ object CrosshairRenderer {
52
52
53
53
fun updateVanilla () {
54
54
val icon = TextureUtil .readBufferedImage(mc.resourceManager.getResource(Gui .icons).inputStream)
55
- vanilla = DynamicTexture (15 , 15 )
56
- for (y in 0 until 15 ) {
57
- for (x in 0 until 15 ) {
58
- if (icon.getRGB(x, y) == - 1 ) {
59
- vanilla.textureData[x + y * 15 ] = - 1
55
+ val size = icon.width * 16 / 256
56
+ vanilla = DynamicTexture (size, size)
57
+ for (y in 0 until size) {
58
+ for (x in 0 until size) {
59
+ icon.getRGB(x, y).let {
60
+ if (it != 0 ) vanilla.textureData[x + y * size] = it
60
61
}
61
62
}
62
63
}
@@ -99,10 +100,10 @@ object CrosshairRenderer {
99
100
GL .translate(crosshair.offsetX.toFloat(), crosshair.offsetY.toFloat(), 0f )
100
101
GL .translate((UResolution .windowWidth / 2 ).toFloat(), (UResolution .windowHeight / 2 ).toFloat(), 0f )
101
102
GL .rotate(crosshair.rotation.toFloat(), 0f , 0f , 1f )
102
- val scale = ModConfig .newCurrentCrosshair .scale / 100f
103
- val textureSize = if (ModConfig .mode) drawingImage.width else 15
103
+ val scale = crosshair .scale / 100f
104
+ val textureSize = if (ModConfig .mode) drawingImage.width else 16
104
105
val size = ceil(textureSize * mcScale * scale).toInt()
105
- val translation = if (crosshair.centered) (- size / 2 ).toFloat() else (- (size - mcScale) / 2 ).toInt().toFloat()
106
+ val translation = if (ModConfig .mode) if ( crosshair.centered) (- size / 2 ).toFloat() else (- (size - mcScale) / 2 ).toInt().toFloat() else ceil( - 7 * mcScale * scale )
106
107
GL .translate(translation, translation, 0f )
107
108
Gui .drawScaledCustomSizeModalRect(0 , 0 , 0f , 0f , textureSize, textureSize, size, size, textureSize.toFloat(), textureSize.toFloat())
108
109
val c = getColor()
0 commit comments