Much improved text rendering. It was being read horizontally backwards and the position was being incremented too early.

This commit is contained in:
starfrost013
2025-03-24 13:34:22 +00:00
parent c3ebf327d9
commit 94cd84363c
2 changed files with 23 additions and 22 deletions

View File

@@ -63,7 +63,8 @@ void nv3_class_00c_method(uint32_t param, uint32_t method_id, nv3_ramin_context_
nv3->pgraph.win95_gdi_text.point_d.x = (param & 0xFFFF);
nv3->pgraph.win95_gdi_text.point_d.y = ((param >> 16) & 0xFFFF);
nv3->pgraph.win95_gdi_text_current_position = nv3->pgraph.win95_gdi_text.point_d;
nv3->pgraph.win95_gdi_text_current_position.x = (nv3->pgraph.win95_gdi_text.point_d.x + nv3->pgraph.win95_gdi_text.size_in_d.w);
nv3->pgraph.win95_gdi_text_current_position.y = (nv3->pgraph.win95_gdi_text.point_d.y);
break;
default:
/* Type A submission: these are the same things as rectangles */

View File

@@ -65,28 +65,9 @@ void nv3_render_gdi_type_d(nv3_grobj_t grobj, uint32_t param)
bool bit = (param >> bit_num) & 0x01;
//bool bit = true; // debug test
nv3->pgraph.win95_gdi_text_current_position.x++;
/* let's hope NV never overflow the y */
if (nv3->pgraph.win95_gdi_text_current_position.x >= end_x)
{
nv3->pgraph.win95_gdi_text_current_position.x = nv3->pgraph.win95_gdi_text.point_d.x;
nv3->pgraph.win95_gdi_text_current_position.y++;
}
/* check if we are in the clipping rectangle */
if (nv3->pgraph.win95_gdi_text_current_position.x < nv3->pgraph.win95_gdi_text.clip_d.left
|| nv3->pgraph.win95_gdi_text_current_position.x > nv3->pgraph.win95_gdi_text.clip_d.right
|| nv3->pgraph.win95_gdi_text_current_position.y < nv3->pgraph.win95_gdi_text.clip_d.top
|| nv3->pgraph.win95_gdi_text_current_position.y > nv3->pgraph.win95_gdi_text.clip_d.bottom)
{
return;
}
// if it's 0 we don't need to do anything
if (!bit)
continue;
else
// if it's a 0 bit we don't need to do anything
if (bit)
{
switch (nv3->nvbase.svga.bpp)
{
@@ -105,5 +86,24 @@ void nv3_render_gdi_type_d(nv3_grobj_t grobj, uint32_t param)
}
}
/* increment the position - the bitmap is stored horizontally backward */
nv3->pgraph.win95_gdi_text_current_position.x--;
/* let's hope NV never overflow the y */
if (nv3->pgraph.win95_gdi_text_current_position.x <= nv3->pgraph.win95_gdi_text.point_d.x)
{
nv3->pgraph.win95_gdi_text_current_position.x = nv3->pgraph.win95_gdi_text.point_d.x + nv3->pgraph.win95_gdi_text.size_in_d.w;
nv3->pgraph.win95_gdi_text_current_position.y++;
}
/* check if we are in the clipping rectangle */
if (nv3->pgraph.win95_gdi_text_current_position.x < nv3->pgraph.win95_gdi_text.clip_d.left
|| nv3->pgraph.win95_gdi_text_current_position.x > nv3->pgraph.win95_gdi_text.clip_d.right
|| nv3->pgraph.win95_gdi_text_current_position.y < nv3->pgraph.win95_gdi_text.clip_d.top
|| nv3->pgraph.win95_gdi_text_current_position.y > nv3->pgraph.win95_gdi_text.clip_d.bottom)
{
return;
}
}
}