by RockstarRaccoon » Sat Feb 05, 2022 12:49 pm
Sir Robin wrote:Would it be possible to make texture offsets as fixed point instead of integers?
They already are. There's a ton of precise double math in here to make that work.
Try using the line-def edit in UDB to manually enter the alignment of a wall in a UDMF map. It'll work, though it's not as useful as one might think, at that scale.
EDIT:
Ok... I just checked that, and while the code IS in GZDoom to hold these things as floats (necessary for smooth animation and properly aligning scaled textures)...
Code: Select all
double xOffset;
double yOffset;
double xScale;
double yScale;
And the code is there to read it from UDMF...
Spoiler:
Code: Select all
case NAME_offsetx_top:
sd->SetTextureXOffset(side_t::top, CheckFloat(key));
continue;
case NAME_offsety_top:
sd->SetTextureYOffset(side_t::top, CheckFloat(key));
continue;
case NAME_offsetx_mid:
sd->SetTextureXOffset(side_t::mid, CheckFloat(key));
continue;
case NAME_offsety_mid:
sd->SetTextureYOffset(side_t::mid, CheckFloat(key));
continue;
case NAME_offsetx_bottom:
sd->SetTextureXOffset(side_t::bottom, CheckFloat(key));
continue;
case NAME_offsety_bottom:
sd->SetTextureYOffset(side_t::bottom, CheckFloat(key));
continue;
...when I enter a float in UDB, it
accepts the float and will even
save it as one, but it doesn't render in visual mode...
I guess we should add that to the list of things that need to be updated in UDB's renderer. We were talking about this the other day on UDB's Discord, and there
is a rework of that code being planned, it's just on hold while there's all this updating being done to linedefs...
[quote="Sir Robin"]Would it be possible to make texture offsets as fixed point instead of integers?[/quote]
They already are. There's a ton of precise double math in here to make that work.
Try using the line-def edit in UDB to manually enter the alignment of a wall in a UDMF map. It'll work, though it's not as useful as one might think, at that scale.
EDIT:
Ok... I just checked that, and while the code IS in GZDoom to hold these things as floats (necessary for smooth animation and properly aligning scaled textures)...
[code]double xOffset;
double yOffset;
double xScale;
double yScale;[/code]
And the code is there to read it from UDMF...
[spoiler][code]case NAME_offsetx_top:
sd->SetTextureXOffset(side_t::top, CheckFloat(key));
continue;
case NAME_offsety_top:
sd->SetTextureYOffset(side_t::top, CheckFloat(key));
continue;
case NAME_offsetx_mid:
sd->SetTextureXOffset(side_t::mid, CheckFloat(key));
continue;
case NAME_offsety_mid:
sd->SetTextureYOffset(side_t::mid, CheckFloat(key));
continue;
case NAME_offsetx_bottom:
sd->SetTextureXOffset(side_t::bottom, CheckFloat(key));
continue;
case NAME_offsety_bottom:
sd->SetTextureYOffset(side_t::bottom, CheckFloat(key));
continue;[/code][/spoiler]
...when I enter a float in UDB, it [i]accepts[/i] the float and will even [i]save[/i] it as one, but it doesn't render in visual mode...
I guess we should add that to the list of things that need to be updated in UDB's renderer. We were talking about this the other day on UDB's Discord, and there [i]is[/i] a rework of that code being planned, it's just on hold while there's all this updating being done to linedefs...