1
0
Fork 0
mirror of https://github.com/k4zmu2a/SpaceCadetPinball.git synced 2025-09-08 17:10:16 +02:00

Switched positional audio to collision coordinate system.

Refactored positional audio.
This commit is contained in:
Muzychenko Andrey 2022-06-01 16:19:27 +03:00
parent c93e11ee6b
commit 8017734de4
19 changed files with 214 additions and 143 deletions

View file

@ -102,8 +102,8 @@ void TLine::place_in_grid()
for (auto indexX = xBox0, indexY = yBox0; indexX != xBox1 || indexY != yBox1;)
{
// Calculate y from indexY and from line formula
auto yDiscrete = (indexY + yBias) * edgeMan->AdvanceY + edgeMan->Y;
auto ylinear = ((indexX + xBias) * edgeMan->AdvanceX + edgeMan->X) * dyDx + precomp;
auto yDiscrete = (indexY + yBias) * edgeMan->AdvanceY + edgeMan->MinY;
auto ylinear = ((indexX + xBias) * edgeMan->AdvanceX + edgeMan->MinX) * dyDx + precomp;
if (dirY == 1 ? ylinear >= yDiscrete : ylinear <= yDiscrete)
{
// Advance indexY when discrete value is ahead/behind