diff --git a/Source/nragev20/Debug.cpp b/Source/nragev20/Debug.cpp index 5e41dcb834..4e3851eb2a 100644 --- a/Source/nragev20/Debug.cpp +++ b/Source/nragev20/Debug.cpp @@ -21,8 +21,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "commonIncludes.h" #include + +#include "commonIncludes.h" #include "FileAccess.h" bool bDebug = true; diff --git a/Source/nragev20/DirectInput.cpp b/Source/nragev20/DirectInput.cpp index 0169984b48..dbd3440c98 100644 --- a/Source/nragev20/DirectInput.cpp +++ b/Source/nragev20/DirectInput.cpp @@ -21,16 +21,21 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include #include -#include "commonIncludes.h" +#include #include + +#include "commonIncludes.h" +#include "DirectInput.h" #include "NRagePluginV2.h" #include "PakIO.h" -#include "DirectInput.h" #include "XInputController.h" -#include -#include + +using std::min; +using std::max; // ProtoTypes // HRESULT AcquireDevice( LPDIRECTINPUTDEVICE8 lpDirectInputDevice ); @@ -377,7 +382,7 @@ bool GetNControllerInput ( const int indexController, LPDWORD pdwData ) { if( pcController->wAxeBuffer[i] < MAXAXISVALUE ) { - l_Value = pcController->wAxeBuffer[i] = min(( pcController->wAxeBuffer[i] + N64DIVIDER*3), MAXAXISVALUE ); + l_Value = pcController->wAxeBuffer[i] = min(( pcController->wAxeBuffer[i] + N64DIVIDER*3), MAXAXISVALUE ); } else l_Value = MAXAXISVALUE; @@ -386,7 +391,7 @@ bool GetNControllerInput ( const int indexController, LPDWORD pdwData ) { if( pcController->wAxeBuffer[i] < MAXAXISVALUE ) { - l_Value = pcController->wAxeBuffer[i] = min(( pcController->wAxeBuffer[i] * 2 + N64DIVIDER*5 ), MAXAXISVALUE ); + l_Value = pcController->wAxeBuffer[i] = min(( pcController->wAxeBuffer[i] * 2 + N64DIVIDER*5 ), MAXAXISVALUE ); } else l_Value = MAXAXISVALUE; @@ -430,7 +435,7 @@ bool GetNControllerInput ( const int indexController, LPDWORD pdwData ) // wAxeBuffer is negative for axes 1 and 2 if buffer remains, else zero if(( pcController->bMouseMoveX == MM_ABS && i < 2 ) || ( pcController->bMouseMoveY == MM_ABS && i > 1 )) - pcController->wAxeBuffer[i] = min( max( MINAXISVALUE, pcController->wAxeBuffer[i]) , MAXAXISVALUE); + pcController->wAxeBuffer[i] = min( max( MINAXISVALUE, pcController->wAxeBuffer[i]) , MAXAXISVALUE); else if (( pcController->bMouseMoveX == MM_BUFF && i < 2 ) || ( pcController->bMouseMoveY == MM_BUFF && i > 1 )) pcController->wAxeBuffer[i] = pcController->wAxeBuffer[i] * MOUSEBUFFERDECAY / 100; else // "deadpan" mouse @@ -542,14 +547,14 @@ bool GetNControllerInput ( const int indexController, LPDWORD pdwData ) double dRel = MAXAXISVALUE / dRangeDiagonal; *pdwData = MAKELONG(w_Buttons, - MAKEWORD( (BYTE)(min( max( MINAXISVALUE, (long)(lAxisValueX * d_ModifierX * dRel )), MAXAXISVALUE) / N64DIVIDER ), - (BYTE)(min( max( MINAXISVALUE, (long)(lAxisValueY * d_ModifierY * dRel )), MAXAXISVALUE) / N64DIVIDER ))); + MAKEWORD( (BYTE)(min( max( MINAXISVALUE, (long)(lAxisValueX * d_ModifierX * dRel )), MAXAXISVALUE) / N64DIVIDER ), + (BYTE)(min( max( MINAXISVALUE, (long)(lAxisValueY * d_ModifierY * dRel )), MAXAXISVALUE) / N64DIVIDER ))); } else { *pdwData = MAKELONG(w_Buttons, - MAKEWORD( (BYTE)(min( max( MINAXISVALUE, (long)(lAxisValueX * d_ModifierX )), MAXAXISVALUE) / N64DIVIDER ), - (BYTE)(min( max( MINAXISVALUE, (long)(lAxisValueY * d_ModifierY )), MAXAXISVALUE) / N64DIVIDER ))); + MAKEWORD( (BYTE)(min( max( MINAXISVALUE, (long)(lAxisValueX * d_ModifierX )), MAXAXISVALUE) / N64DIVIDER ), + (BYTE)(min( max( MINAXISVALUE, (long)(lAxisValueY * d_ModifierY )), MAXAXISVALUE) / N64DIVIDER ))); } return true; @@ -887,7 +892,7 @@ bool CreateEffectHandle( HWND hWnd, LPDIRECTINPUTDEVICE8 lpDirectInputDevice, LP if( nAxes == 0 ) return false; - nAxes = min( nAxes, 2 ); + nAxes = min( nAxes, 2 ); // Must be unaquired for setting stuff like Co-op Level diff --git a/Source/nragev20/DirectInput.h b/Source/nragev20/DirectInput.h index b659dac829..19491a5951 100644 --- a/Source/nragev20/DirectInput.h +++ b/Source/nragev20/DirectInput.h @@ -26,6 +26,8 @@ #include +#include "NRagePluginV2.h" + extern LPDIRECTINPUT8 g_pDIHandle; diff --git a/Source/nragev20/FileAccess.cpp b/Source/nragev20/FileAccess.cpp index ef9dbdd2c1..990e09185c 100644 --- a/Source/nragev20/FileAccess.cpp +++ b/Source/nragev20/FileAccess.cpp @@ -21,18 +21,21 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "commonIncludes.h" +#include +#include + #include #include -#include -#include #include +#include + +#include "commonIncludes.h" +#include "DirectInput.h" +#include "FileAccess.h" +#include "Interface.h" #include "NRagePluginV2.h" #include "PakIO.h" -#include "Interface.h" -#include "FileAccess.h" -#include "DirectInput.h" -#include + using std::string; #ifndef IDR_PROFILE_DEFAULT1 diff --git a/Source/nragev20/FileAccess.h b/Source/nragev20/FileAccess.h index e9159ebc96..4ab8d2565b 100644 --- a/Source/nragev20/FileAccess.h +++ b/Source/nragev20/FileAccess.h @@ -24,9 +24,11 @@ #ifndef _FILEACCESS_H_ #define _FILEACCESS_H_ +#include + #include "NRagePluginV2.h" #include "Version.h" -#include + using std::string; bool GetDirectory( LPTSTR pszDirectory, WORD wDirID ); diff --git a/Source/nragev20/GBCart.cpp b/Source/nragev20/GBCart.cpp index 84f1e0176c..ec0d110738 100644 --- a/Source/nragev20/GBCart.cpp +++ b/Source/nragev20/GBCart.cpp @@ -10,11 +10,12 @@ ** */ -#include "commonIncludes.h" #include + +#include "commonIncludes.h" +#include "GBCart.h" #include "NRagePluginV2.h" #include "PakIO.h" -#include "GBCart.h" void ClearData(BYTE *Data, int Length); diff --git a/Source/nragev20/GBCart.h b/Source/nragev20/GBCart.h index 529b9dbebe..543bc757ea 100644 --- a/Source/nragev20/GBCart.h +++ b/Source/nragev20/GBCart.h @@ -1,9 +1,10 @@ #ifndef _GBCART_H_ #define _GBCART_H_ -#include #include +#include + typedef struct _gbCartRTC { UINT mapperSeconds; UINT mapperMinutes; diff --git a/Source/nragev20/Interface.cpp b/Source/nragev20/Interface.cpp index 2ac93f68e1..ac8e825723 100644 --- a/Source/nragev20/Interface.cpp +++ b/Source/nragev20/Interface.cpp @@ -21,18 +21,20 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "commonIncludes.h" +#include + #include #include -#include -#include "NRagePluginV2.h" + +#include "commonIncludes.h" #include "DirectInput.h" -#include "XInputController.h" #include "FileAccess.h" -#include "PakIO.h" #include "Interface.h" #include "International.h" +#include "NRagePluginV2.h" +#include "PakIO.h" #include "Version.h" +#include "XInputController.h" // Prototypes // BOOL CALLBACK ControllerTabProc( HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam ); diff --git a/Source/nragev20/International.cpp b/Source/nragev20/International.cpp index 631973a363..5aa0ac3ceb 100644 --- a/Source/nragev20/International.cpp +++ b/Source/nragev20/International.cpp @@ -23,12 +23,14 @@ // Internationalization routines go in this file. -#include "International.h" -#include -#include #include #include -#include "debug.h" + +#include +#include + +#include "International.h" +#include "Debug.h" LANGID GetNTDLLNativeLangID(); BOOL IsHongKongVersion(); diff --git a/Source/nragev20/International.h b/Source/nragev20/International.h index 54243ba87e..abac85e56f 100644 --- a/Source/nragev20/International.h +++ b/Source/nragev20/International.h @@ -21,9 +21,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "settings.h" #include +#include "settings.h" + #ifndef _NRINTERNATIONAL_ #define _NRINTERNATIONAL_ diff --git a/Source/nragev20/NRagePluginV2.cpp b/Source/nragev20/NRagePluginV2.cpp index c2054de72a..a69bcd95b4 100644 --- a/Source/nragev20/NRagePluginV2.cpp +++ b/Source/nragev20/NRagePluginV2.cpp @@ -21,11 +21,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "commonIncludes.h" #include #include #include #include + +#include "commonIncludes.h" + #include "NRagePluginV2.h" #include "Interface.h" #include "FileAccess.h" diff --git a/Source/nragev20/NRagePluginV2.h b/Source/nragev20/NRagePluginV2.h index 77695aed3e..52fc95f3e5 100644 --- a/Source/nragev20/NRagePluginV2.h +++ b/Source/nragev20/NRagePluginV2.h @@ -24,6 +24,7 @@ #define _NRAGEPLUGIN_ #include + #include "XInputController.h" ///////////////////////////////////////////////////////////////////////////////// diff --git a/Source/nragev20/PakIO.cpp b/Source/nragev20/PakIO.cpp index 85c5e909f3..7be39855dd 100644 --- a/Source/nragev20/PakIO.cpp +++ b/Source/nragev20/PakIO.cpp @@ -21,17 +21,23 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "commonIncludes.h" +#include +#include + #include #include #include -#include -#include "NRagePluginV2.h" + +#include "commonIncludes.h" #include "DirectInput.h" -#include "Interface.h" #include "FileAccess.h" -#include "PakIO.h" #include "GBCart.h" +#include "Interface.h" +#include "NRagePluginV2.h" +#include "PakIO.h" + +using std::min; +using std::max; // ProtoTypes BYTE AddressCRC( const unsigned char * Address ); diff --git a/Source/nragev20/PakIO.h b/Source/nragev20/PakIO.h index 9e5fa86d1e..3def49a866 100644 --- a/Source/nragev20/PakIO.h +++ b/Source/nragev20/PakIO.h @@ -170,16 +170,4 @@ typedef struct _ADAPTOIDPAK bool fRumblePak; } ADAPTOIDPAK, *LPADAPTOIDPAK; -/* - * from under with MSVC defines these macros. - * For some reason, they are unavailable with MinGW's copy of . - */ -#ifndef max -#define max(a, b) (((a) > (b)) ? (a) : (b)) -#endif - -#ifndef min -#define min(a, b) (((a) < (b)) ? (a) : (b)) -#endif - #endif // #ifndef _PAKIO_H_ diff --git a/Source/nragev20/commonIncludes.h b/Source/nragev20/commonIncludes.h index d06df2c2e5..e5bc55ab77 100644 --- a/Source/nragev20/commonIncludes.h +++ b/Source/nragev20/commonIncludes.h @@ -24,11 +24,14 @@ #ifndef _COMMONINCLUDES_H_ #define _COMMONINCLUDES_H_ +/* #undef WIN32_LEAN_AND_MEAN #pragma warning(disable:4201) +*/ -#include "settings.h" #include + +#include "settings.h" #include "resource.h" #include "Debug.h"