Keep 26.3's name-tag and text-display values
Review caught three regressions against the pinned client jar: submitInner lines stay lineHeight+1 (10 px), submitNameTag fades discrete and see-through names with the same 0x7F, and lightCoordsWithEmission floors both light channels at 2. Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
@@ -252,27 +252,17 @@ impl Game<'_> {
|
||||
out: &mut Vec<Vertex>,
|
||||
see_through: &mut Vec<Vertex>,
|
||||
) {
|
||||
// renderNameTag's text colours: a discrete name's faded 0x20FFFFFF,
|
||||
// the see-through copy's 0x80FFFFFF.
|
||||
const DISCRETE: u32 = 0x20;
|
||||
const FADED: u32 = 0x80;
|
||||
// The text alpha that goes with getBackgroundOpacity(0.25):
|
||||
// max((0.25 + 0.75) / 2, 0.5), as ARGB.color (the floor of 255 times it).
|
||||
const FADED: u32 = 0x7F;
|
||||
for tag in self.name_tags(camera, alpha) {
|
||||
let o = tag.at - camera;
|
||||
if tag.discrete {
|
||||
self.name_tag_quads(
|
||||
o,
|
||||
&tag.lines,
|
||||
DISCRETE,
|
||||
true,
|
||||
0,
|
||||
vertex_light(tag.light),
|
||||
out,
|
||||
);
|
||||
self.name_tag_quads(o, &tag.lines, FADED, true, 0, vertex_light(tag.light), out);
|
||||
continue;
|
||||
}
|
||||
// LightCoordsUtil.lightCoordsWithEmission(lightCoords, 2): the block
|
||||
// channel at least 2, the sky channel unchanged.
|
||||
let lit = (tag.light & 0xF0) | (tag.light & 15).max(2);
|
||||
// LightCoordsUtil.lightCoordsWithEmission(lightCoords, 2).
|
||||
let lit = (tag.light >> 4).max(2) << 4 | (tag.light & 15).max(2);
|
||||
self.name_tag_quads(o, &tag.lines, 0xFF, false, 0, vertex_light(lit), out);
|
||||
// RenderPipelines.TEXT_SEE_THROUGH: no depth test, no lightmap.
|
||||
self.name_tag_quads(o, &tag.lines, FADED, true, 2, 0, see_through);
|
||||
|
||||
@@ -198,7 +198,7 @@ impl Game<'_> {
|
||||
Lines { lines, width }
|
||||
});
|
||||
let width = *width;
|
||||
let height = lines.len() as f32 * 9.0 - 1.0;
|
||||
let height = lines.len() as f32 * 10.0 - 1.0;
|
||||
matrix *=
|
||||
glam::Mat4::from_translation(glam::Vec3::new(1.0 - width / 2.0, -height, 0.0));
|
||||
let mut batch = HudBatch::new([1, 1]);
|
||||
@@ -233,7 +233,7 @@ impl Game<'_> {
|
||||
atlas,
|
||||
line,
|
||||
x,
|
||||
i as f32 * 9.0,
|
||||
i as f32 * 10.0,
|
||||
rgba(255, 255, 255, d.opacity as u8),
|
||||
d.flags & 1 != 0,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user