mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-24 08:15:50 +00:00
Removed SDL_stdinc.h dependency on HAVE_M_PI, added SDL_M_PIl (double) and SDL_M_PIf (float) instead
This commit is contained in:
@@ -3679,7 +3679,7 @@ SDL_RenderCopyExF(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
float s_minx, s_miny, s_maxx, s_maxy;
|
||||
float c_minx, c_miny, c_maxx, c_maxy;
|
||||
|
||||
const float radian_angle = (float)((M_PI * angle) / 180.0);
|
||||
const float radian_angle = (float)((SDL_M_PIl * angle) / 180.0);
|
||||
const float s = SDL_sinf(radian_angle);
|
||||
const float c = SDL_cosf(radian_angle);
|
||||
|
||||
|
||||
@@ -1821,13 +1821,13 @@ D3D11_UpdateViewport(SDL_Renderer * renderer)
|
||||
projection = MatrixIdentity();
|
||||
break;
|
||||
case DXGI_MODE_ROTATION_ROTATE270:
|
||||
projection = MatrixRotationZ(SDL_static_cast(float, M_PI * 0.5f));
|
||||
projection = MatrixRotationZ(SDL_M_PIf * 0.5f);
|
||||
break;
|
||||
case DXGI_MODE_ROTATION_ROTATE180:
|
||||
projection = MatrixRotationZ(SDL_static_cast(float, M_PI));
|
||||
projection = MatrixRotationZ(SDL_M_PIf);
|
||||
break;
|
||||
case DXGI_MODE_ROTATION_ROTATE90:
|
||||
projection = MatrixRotationZ(SDL_static_cast(float, -M_PI * 0.5f));
|
||||
projection = MatrixRotationZ(-SDL_M_PIf * 0.5f);
|
||||
break;
|
||||
default:
|
||||
return SDL_SetError("An unknown DisplayOrientation is being used");
|
||||
|
||||
@@ -2366,13 +2366,13 @@ D3D12_UpdateViewport(SDL_Renderer * renderer)
|
||||
projection = MatrixIdentity();
|
||||
break;
|
||||
case DXGI_MODE_ROTATION_ROTATE270:
|
||||
projection = MatrixRotationZ(SDL_static_cast(float, M_PI * 0.5f));
|
||||
projection = MatrixRotationZ(SDL_M_PIf * 0.5f);
|
||||
break;
|
||||
case DXGI_MODE_ROTATION_ROTATE180:
|
||||
projection = MatrixRotationZ(SDL_static_cast(float, M_PI));
|
||||
projection = MatrixRotationZ(SDL_M_PIf);
|
||||
break;
|
||||
case DXGI_MODE_ROTATION_ROTATE90:
|
||||
projection = MatrixRotationZ(SDL_static_cast(float, -M_PI * 0.5f));
|
||||
projection = MatrixRotationZ(-SDL_M_PIf * 0.5f);
|
||||
break;
|
||||
default:
|
||||
return SDL_SetError("An unknown DisplayOrientation is being used");
|
||||
|
||||
@@ -122,7 +122,7 @@ SDLgfx_rotozoomSurfaceSizeTrig(int width, int height, double angle, const SDL_FP
|
||||
double sinangle;
|
||||
double cosangle;
|
||||
|
||||
radangle = angle * (M_PI / 180.0);
|
||||
radangle = angle * (SDL_M_PIl / 180.0);
|
||||
sinangle = SDL_sin(radangle);
|
||||
cosangle = SDL_cos(radangle);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user