mirror of
https://github.com/86Box/86Box.git
synced 2026-02-23 18:08:20 -07:00
Much improved text rendering. It was being read horizontally backwards and the position was being incremented too early.
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user