Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
CreatureChat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Public
CreatureChat
Commits
78c30d56
Commit
78c30d56
authored
Jul 09, 2024
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Experimental: Adding hidden icon UV coordinates to player icon drawing.
parent
fa3a5d72
Pipeline
#12651
passed with stages
in 2 minutes 31 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
BubbleRenderer.java
src/client/java/com/owlmaddie/ui/BubbleRenderer.java
+44
-0
No files found.
src/client/java/com/owlmaddie/ui/BubbleRenderer.java
View file @
78c30d56
...
...
@@ -268,6 +268,50 @@ public class BubbleRenderer {
bufferBuilder
.
vertex
(
matrix4f
,
x
+
width
,
y
+
height
,
z
).
color
(
255
,
255
,
255
,
255
).
texture
(
hatU2
,
hatV2
).
light
(
light
).
overlay
(
overlay
).
next
();
bufferBuilder
.
vertex
(
matrix4f
,
x
+
width
,
y
,
z
).
color
(
255
,
255
,
255
,
255
).
texture
(
hatU2
,
hatV1
).
light
(
light
).
overlay
(
overlay
).
next
();
bufferBuilder
.
vertex
(
matrix4f
,
x
,
y
,
z
).
color
(
255
,
255
,
255
,
255
).
texture
(
hatU1
,
hatV1
).
light
(
light
).
overlay
(
overlay
).
next
();
// Hidden icon UV coordinates
float
[][]
newCoordinates
=
{
{
0.0
F
,
0.0
F
,
8.0
F
,
8.0
F
,
0
F
,
0
F
},
// Row 1 left
{
24.0
F
,
0.0
F
,
32.0
F
,
8.0
F
,
8
F
,
0
F
},
// Row 1 middle
{
32.0
F
,
0.0
F
,
40.0
F
,
8.0
F
,
16
F
,
0
F
},
// Row 1 right
{
56.0
F
,
0.0
F
,
64.0
F
,
8.0
F
,
0
F
,
8
F
},
// Row 2 left
{
56.0
F
,
20.0
F
,
64.0
F
,
28.0
F
,
8
F
,
8
F
},
// Row 2 middle
{
36.0
F
,
16.0
F
,
44.0
F
,
20.0
F
,
16
F
,
8
F
},
// Row 2 right top
{
56.0
F
,
16.0
F
,
64.0
F
,
20.0
F
,
16
F
,
12
F
},
// Row 2 right bottom
{
56.0
F
,
28.0
F
,
64.0
F
,
36.0
F
,
0
F
,
16
F
},
// Row 3 left
{
56.0
F
,
36.0
F
,
64.0
F
,
44.0
F
,
8
F
,
16
F
},
// Row 3 middle
{
56.0
F
,
44.0
F
,
64.0
F
,
52.0
F
,
16
F
,
16
F
},
// Row 3 right
};
// Scaling factor for the new layer (24x24 to fit in 8x8)
float
scaleFactor
=
0.77
F
;
// Adjust depth for the new layer
z
-=
0.01
F
;
// Draw new coordinates
for
(
float
[]
coords
:
newCoordinates
)
{
float
newU1
=
coords
[
0
]
/
textureWidth
;
float
newV1
=
coords
[
1
]
/
textureHeight
;
float
newU2
=
coords
[
2
]
/
textureWidth
;
float
newV2
=
coords
[
3
]
/
textureHeight
;
// Calculate the position within the 8x8 area
float
offsetX
=
coords
[
4
]
*
scaleFactor
;
float
offsetY
=
coords
[
5
]
*
scaleFactor
;
float
scaledX
=
x
+
offsetX
;
float
scaledY
=
y
+
offsetY
;
float
scaledWidth
=
(
coords
[
2
]
-
coords
[
0
])
*
scaleFactor
;
float
scaledHeight
=
(
coords
[
3
]
-
coords
[
1
])
*
scaleFactor
;
// Draw new layer
bufferBuilder
.
vertex
(
matrix4f
,
scaledX
,
scaledY
+
scaledHeight
,
z
).
color
(
255
,
255
,
255
,
255
).
texture
(
newU1
,
newV2
).
light
(
light
).
overlay
(
overlay
).
next
();
bufferBuilder
.
vertex
(
matrix4f
,
scaledX
+
scaledWidth
,
scaledY
+
scaledHeight
,
z
).
color
(
255
,
255
,
255
,
255
).
texture
(
newU2
,
newV2
).
light
(
light
).
overlay
(
overlay
).
next
();
bufferBuilder
.
vertex
(
matrix4f
,
scaledX
+
scaledWidth
,
scaledY
,
z
).
color
(
255
,
255
,
255
,
255
).
texture
(
newU2
,
newV1
).
light
(
light
).
overlay
(
overlay
).
next
();
bufferBuilder
.
vertex
(
matrix4f
,
scaledX
,
scaledY
,
z
).
color
(
255
,
255
,
255
,
255
).
texture
(
newU1
,
newV1
).
light
(
light
).
overlay
(
overlay
).
next
();
}
tessellator
.
draw
();
// Disable blending and depth test
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment