mirror of
https://github.com/ZDoom/Raze.git
synced 2025-05-30 00:41:24 +00:00
Use type safe angle and horizon classes for the render interface
These need to be robust and not allow implicit conversions.
This commit is contained in:
parent
9742bc72aa
commit
945dbc9f7e
7 changed files with 82 additions and 64 deletions
|
@ -95,6 +95,14 @@ public:
|
|||
return binangle(value - other.value);
|
||||
}
|
||||
|
||||
void interpolate(binangle a1, binangle a2, fix16_t smoothratio)
|
||||
{
|
||||
// Calculate in floating point to reduce the error caused by overflows which are to be expected here and then downconvert using a method that is safe to overflow.
|
||||
// We do not want fixed point multiplications here to trash the result.
|
||||
double smooth = smoothratio / 65536.f;
|
||||
value = xs_CRoundToUInt(double(a1.asbam()) + smooth * (double(a2.asbam()) - double(a1.asbam())));
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
@ -170,7 +178,6 @@ public:
|
|||
{
|
||||
return fixedhoriz(value - other.value);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue