2024-01-24 09:18:02 +00:00
|
|
|
#pragma option -zCSHARED
|
|
|
|
|
2022-12-26 02:41:18 +00:00
|
|
|
#include "th01/math/polar.hpp"
|
2023-06-08 15:55:57 +00:00
|
|
|
#include "th03/math/polar.hpp"
|
2021-03-01 14:50:43 +00:00
|
|
|
#include "th04/math/vector.hpp"
|
|
|
|
|
2023-06-08 15:55:57 +00:00
|
|
|
int pascal polar(int center, int radius, int ratio)
|
2021-03-01 14:50:43 +00:00
|
|
|
{
|
2023-06-08 15:55:57 +00:00
|
|
|
return (((static_cast<long>(radius) * ratio) >> 8) + center);
|
2021-03-01 14:50:43 +00:00
|
|
|
}
|
|
|
|
|
2024-05-26 17:39:06 +00:00
|
|
|
void pascal vector2_at(
|
2021-03-01 14:50:43 +00:00
|
|
|
SPPoint near &ret,
|
|
|
|
subpixel_t origin_x,
|
|
|
|
subpixel_t origin_y,
|
|
|
|
subpixel_t length,
|
|
|
|
int angle
|
|
|
|
)
|
|
|
|
{
|
|
|
|
_BX = angle;
|
|
|
|
#if (GAME == 5)
|
|
|
|
_BH ^= _BH;
|
|
|
|
#endif
|
|
|
|
_BX += _BX; // *= sizeof(short)
|
|
|
|
ret.x.v = polar_x_fast_unsafe(origin_x, length, _BX);
|
|
|
|
ret.y.v = polar_y_fast_unsafe(origin_y, length, _BX);
|
|
|
|
}
|