Clean up math functions
- Remove checking for standard functions from the build system - Prefix all invocations with std:: - Replace suffixed functions with unprefixed versions - Include <cmath> in all files that use it and remove the global include e.g. floorf(x) -> std::floor(x)
This commit is contained in:
@@ -12,11 +12,13 @@
|
||||
#include "RageSurface_Load.h"
|
||||
#include "RageSurface.h"
|
||||
#include "RageSurfaceUtils.h"
|
||||
#include "RageSurfaceUtils_Zoom.h"
|
||||
#include "RageLog.h"
|
||||
#include "ProductInfo.h"
|
||||
#include "LocalizedString.h"
|
||||
|
||||
#include "RageSurfaceUtils_Zoom.h"
|
||||
#include <cmath>
|
||||
|
||||
static HBITMAP g_hBitmap = nullptr;
|
||||
|
||||
/* Load a RageSurface into a GDI surface. */
|
||||
@@ -34,7 +36,7 @@ static HBITMAP LoadWin32Surface( const RageSurface *pSplash, HWND hWnd )
|
||||
|
||||
int iWidth = r.right;
|
||||
float fRatio = (float) iWidth / s->w;
|
||||
int iHeight = lrintf( s->h * fRatio );
|
||||
int iHeight = std::lrint( s->h * fRatio );
|
||||
|
||||
RageSurfaceUtils::Zoom( s, iWidth, iHeight );
|
||||
}
|
||||
@@ -55,7 +57,7 @@ static HBITMAP LoadWin32Surface( const RageSurface *pSplash, HWND hWnd )
|
||||
for( int x = 0; x < s->w; ++x )
|
||||
{
|
||||
unsigned const char *data = line + (x*s->format->BytesPerPixel);
|
||||
|
||||
|
||||
SetPixelV( BitmapDC, x, y, RGB( data[3], data[2], data[1] ) );
|
||||
}
|
||||
}
|
||||
@@ -94,10 +96,10 @@ INT_PTR CALLBACK LoadingWindow_Win32::WndProc( HWND hWnd, UINT msg, WPARAM wPara
|
||||
}
|
||||
if( g_hBitmap == nullptr )
|
||||
g_hBitmap = LoadWin32Surface( "Data/splash.bmp", hWnd );
|
||||
SendMessage(
|
||||
GetDlgItem(hWnd,IDC_SPLASH),
|
||||
STM_SETIMAGE,
|
||||
(WPARAM) IMAGE_BITMAP,
|
||||
SendMessage(
|
||||
GetDlgItem(hWnd,IDC_SPLASH),
|
||||
STM_SETIMAGE,
|
||||
(WPARAM) IMAGE_BITMAP,
|
||||
(LPARAM) (HANDLE) g_hBitmap );
|
||||
SetWindowTextA( hWnd, PRODUCT_ID );
|
||||
break;
|
||||
@@ -226,7 +228,7 @@ void LoadingWindow_Win32::SetIndeterminate(bool indeterminate)
|
||||
/*
|
||||
* (c) 2001-2004 Chris Danford, Glenn Maynard
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
@@ -236,7 +238,7 @@ void LoadingWindow_Win32::SetIndeterminate(bool indeterminate)
|
||||
* copyright notice(s) and this permission notice appear in all copies of
|
||||
* the Software and that both the above copyright notice(s) and this
|
||||
* permission notice appear in supporting documentation.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
||||
|
||||
Reference in New Issue
Block a user