Renderer floatification: Use floating point for texturemids and Y scales
This commit is contained in:
parent
4a1cc61822
commit
3ef5a678d5
12 changed files with 185 additions and 182 deletions
|
|
@ -1108,14 +1108,15 @@ void R_FillColumnHorizP (void)
|
|||
|
||||
void R_DrawMaskedColumnHoriz (const BYTE *column, const FTexture::Span *span)
|
||||
{
|
||||
const fixed_t texturemid = FLOAT2FIXED(dc_texturemid);
|
||||
while (span->Length != 0)
|
||||
{
|
||||
const int length = span->Length;
|
||||
const int top = span->TopOffset;
|
||||
|
||||
// calculate unclipped screen coordinates for post
|
||||
dc_yl = (sprtopscreen + spryscale * top) >> FRACBITS;
|
||||
dc_yh = (sprtopscreen + spryscale * (top + length) - FRACUNIT) >> FRACBITS;
|
||||
dc_yl = xs_RoundToInt(sprtopscreen + spryscale * top);
|
||||
dc_yh = xs_RoundToInt(sprtopscreen + spryscale * (top + length) - 1);
|
||||
|
||||
if (sprflipvert)
|
||||
{
|
||||
|
|
@ -1136,7 +1137,7 @@ void R_DrawMaskedColumnHoriz (const BYTE *column, const FTexture::Span *span)
|
|||
if (sprflipvert)
|
||||
{
|
||||
dc_texturefrac = (dc_yl*dc_iscale) - (top << FRACBITS)
|
||||
- fixed_t(CenterY * dc_iscale) - dc_texturemid;
|
||||
- fixed_t(CenterY * dc_iscale) - texturemid;
|
||||
const fixed_t maxfrac = length << FRACBITS;
|
||||
while (dc_texturefrac >= maxfrac)
|
||||
{
|
||||
|
|
@ -1154,7 +1155,7 @@ void R_DrawMaskedColumnHoriz (const BYTE *column, const FTexture::Span *span)
|
|||
}
|
||||
else
|
||||
{
|
||||
dc_texturefrac = dc_texturemid - (top << FRACBITS)
|
||||
dc_texturefrac = texturemid - (top << FRACBITS)
|
||||
+ (dc_yl*dc_iscale) - fixed_t((CenterY-1) * dc_iscale);
|
||||
while (dc_texturefrac < 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue