From 1a52f19dd481791b3a0eefb5ff8fe571db361609 Mon Sep 17 00:00:00 2001 From: Nomango <569629550@qq.com> Date: Fri, 2 Feb 2018 10:06:29 +0800 Subject: [PATCH] remove vs2010 project --- core/Base/Input.cpp | 28 ++-- core/emacros.h | 22 +-- project/vs2010/Easy2D.sln | 20 --- project/vs2010/Easy2D.vcxproj | 158 ------------------- project/vs2010/Easy2D.vcxproj.filters | 215 -------------------------- 5 files changed, 25 insertions(+), 418 deletions(-) delete mode 100644 project/vs2010/Easy2D.sln delete mode 100644 project/vs2010/Easy2D.vcxproj delete mode 100644 project/vs2010/Easy2D.vcxproj.filters diff --git a/core/Base/Input.cpp b/core/Base/Input.cpp index 9dd3d71c..f39d027c 100644 --- a/core/Base/Input.cpp +++ b/core/Base/Input.cpp @@ -8,11 +8,11 @@ using namespace e2d; static IDirectInput8* s_pDirectInput = nullptr; // DirectInput ½Ó¿Ú¶ÔÏó static IDirectInputDevice8* s_KeyboardDevice = nullptr; // ¼üÅÌÉ豸½Ó¿Ú static char s_KeyBuffer[256] = { 0 }; // ÓÃÓÚ±£´æ¼üÅ̰´¼üÐÅÏ¢»º³åÇø -static char s_KeySecBuffer[256] = { 0 }; // ¼üÅÌÏûÏ¢¶þ¼¶»º³åÇø +static char s_KeyRecordBuffer[256] = { 0 }; // ¼üÅÌÏûÏ¢¶þ¼¶»º³åÇø static IDirectInputDevice8* s_MouseDevice = nullptr; // Êó±êÉ豸½Ó¿Ú static DIMOUSESTATE s_MouseState; // Êó±êÐÅÏ¢´æ´¢½á¹¹Ìå -static DIMOUSESTATE s_MouseSecState; // Êó±êÐÅÏ¢¶þ¼¶»º³å +static DIMOUSESTATE s_MouseRecordState; // Êó±êÐÅÏ¢¶þ¼¶»º³å static POINT s_MousePosition; // Êó±êλÖô洢½á¹¹Ìå @@ -31,9 +31,9 @@ void EInput::__uninit() bool EInput::__init() { ZeroMemory(s_KeyBuffer, sizeof(s_KeyBuffer)); - ZeroMemory(s_KeySecBuffer, sizeof(s_KeySecBuffer)); + ZeroMemory(s_KeyRecordBuffer, sizeof(s_KeyRecordBuffer)); ZeroMemory(&s_MouseState, sizeof(s_MouseState)); - ZeroMemory(&s_MouseSecState, sizeof(s_MouseSecState)); + ZeroMemory(&s_MouseRecordState, sizeof(s_MouseRecordState)); // ³õʼ»¯½Ó¿Ú¶ÔÏó HRESULT hr = DirectInput8Create( @@ -113,7 +113,7 @@ void EInput::__updateDeviceState() else { for (int i = 0; i < 256; i++) - s_KeySecBuffer[i] = s_KeyBuffer[i]; + s_KeyRecordBuffer[i] = s_KeyBuffer[i]; s_KeyboardDevice->GetDeviceState(sizeof(s_KeyBuffer), (void**)&s_KeyBuffer); } @@ -130,7 +130,7 @@ void EInput::__updateDeviceState() } else { - s_MouseSecState = s_MouseState; + s_MouseRecordState = s_MouseState; s_MouseDevice->GetDeviceState(sizeof(s_MouseState), (void**)&s_MouseState); } DIK_0; @@ -149,14 +149,14 @@ bool EInput::isKeyDown(int nKeyCode) bool EInput::isKeyPress(int nKeyCode) { - if ((s_KeyBuffer[nKeyCode] & 0x80) && !(s_KeySecBuffer[nKeyCode] & 0x80)) + if ((s_KeyBuffer[nKeyCode] & 0x80) && !(s_KeyRecordBuffer[nKeyCode] & 0x80)) return true; return false; } bool EInput::isKeyRelease(int nKeyCode) { - if (!(s_KeyBuffer[nKeyCode] & 0x80) && (s_KeySecBuffer[nKeyCode] & 0x80)) + if (!(s_KeyBuffer[nKeyCode] & 0x80) && (s_KeyRecordBuffer[nKeyCode] & 0x80)) return true; return false; } @@ -184,42 +184,42 @@ bool EInput::isMouseMButtonDown() bool EInput::isMouseLButtonPress() { - if ((s_MouseState.rgbButtons[0] & 0x80) && !(s_MouseSecState.rgbButtons[0] & 0x80)) + if ((s_MouseState.rgbButtons[0] & 0x80) && !(s_MouseRecordState.rgbButtons[0] & 0x80)) return true; return false; } bool EInput::isMouseRButtonPress() { - if ((s_MouseState.rgbButtons[1] & 0x80) && !(s_MouseSecState.rgbButtons[1] & 0x80)) + if ((s_MouseState.rgbButtons[1] & 0x80) && !(s_MouseRecordState.rgbButtons[1] & 0x80)) return true; return false; } bool EInput::isMouseMButtonPress() { - if ((s_MouseState.rgbButtons[2] & 0x80) && !(s_MouseSecState.rgbButtons[2] & 0x80)) + if ((s_MouseState.rgbButtons[2] & 0x80) && !(s_MouseRecordState.rgbButtons[2] & 0x80)) return true; return false; } bool EInput::isMouseLButtonRelease() { - if (!(s_MouseState.rgbButtons[0] & 0x80) && (s_MouseSecState.rgbButtons[0] & 0x80)) + if (!(s_MouseState.rgbButtons[0] & 0x80) && (s_MouseRecordState.rgbButtons[0] & 0x80)) return true; return false; } bool EInput::isMouseRButtonRelease() { - if (!(s_MouseState.rgbButtons[1] & 0x80) && (s_MouseSecState.rgbButtons[1] & 0x80)) + if (!(s_MouseState.rgbButtons[1] & 0x80) && (s_MouseRecordState.rgbButtons[1] & 0x80)) return true; return false; } bool EInput::isMouseMButtonRelease() { - if (!(s_MouseState.rgbButtons[2] & 0x80) && (s_MouseSecState.rgbButtons[2] & 0x80)) + if (!(s_MouseState.rgbButtons[2] & 0x80) && (s_MouseRecordState.rgbButtons[2] & 0x80)) return true; return false; } diff --git a/core/emacros.h b/core/emacros.h index 80d43625..b5a4e330 100644 --- a/core/emacros.h +++ b/core/emacros.h @@ -28,13 +28,8 @@ #define DIRECTINPUT_VERSION 0x0800 #endif -// Windows Header Files: +// Windows Header Files #include -#include - -// C RunTime Header Files -#include -#include #include #include #include @@ -43,6 +38,11 @@ #include #include +// C RunTime Header Files +#include +#include + +// Import Libraries #pragma comment(lib, "d2d1.lib") #pragma comment(lib, "dwrite.lib") #pragma comment(lib, "xaudio2.lib") @@ -56,18 +56,18 @@ EXTERN_C IMAGE_DOS_HEADER __ImageBase; #endif -#ifndef ASSERT_IF +#ifndef ASSERT #if defined( DEBUG ) || defined( _DEBUG ) - #define ASSERT(b, m, ...) do {if (!(b)) { fwprintf(stderr, L"Assert: " #m L"\n", __VA_ARGS__); assert(b); }} while(0) + #define ASSERT(expression, message, ...) do {if (!(expression)) { fwprintf(stderr, L"Assert: " _CRT_WIDE(#message) L"\n", __VA_ARGS__); abort(); }} while(0) #else - #define ASSERT(b, m, ...) ((void)0) + #define ASSERT(expression, message, ...) ((void)0) #endif //DEBUG || _DEBUG #endif #ifndef WARN_IF #if defined( DEBUG ) || defined( _DEBUG ) - #define WARN_IF(b, m, ...) do {if (b) { fwprintf(stderr, L"Warning: " #m L"\n", __VA_ARGS__); }} while(0) + #define WARN_IF(expression, message, ...) do {if (expression) { fwprintf(stderr, L"Warning: " _CRT_WIDE(#message) L"\n", __VA_ARGS__); }} while(0) #else - #define WARN_IF(b, m, ...) ((void)0) + #define WARN_IF(expression, message, ...) ((void)0) #endif //DEBUG || _DEBUG #endif \ No newline at end of file diff --git a/project/vs2010/Easy2D.sln b/project/vs2010/Easy2D.sln deleted file mode 100644 index 9b743ffb..00000000 --- a/project/vs2010/Easy2D.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Easy2D", "Easy2D.vcxproj", "{47AF11E1-8725-4ECA-B8CF-951ABC397B31}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {47AF11E1-8725-4ECA-B8CF-951ABC397B31}.Debug|Win32.ActiveCfg = Debug|Win32 - {47AF11E1-8725-4ECA-B8CF-951ABC397B31}.Debug|Win32.Build.0 = Debug|Win32 - {47AF11E1-8725-4ECA-B8CF-951ABC397B31}.Release|Win32.ActiveCfg = Release|Win32 - {47AF11E1-8725-4ECA-B8CF-951ABC397B31}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/project/vs2010/Easy2D.vcxproj b/project/vs2010/Easy2D.vcxproj deleted file mode 100644 index 1f3e673b..00000000 --- a/project/vs2010/Easy2D.vcxproj +++ /dev/null @@ -1,158 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {47AF11E1-8725-4ECA-B8CF-951ABC397B31} - Win32Proj - Easy2D - - - - StaticLibrary - true - Unicode - - - StaticLibrary - false - false - Unicode - - - - - - - - - - - - - Easy2Dw - $(SolutionDir)$(Platform)\ - $(Configuration)\$(Platform)\ - - - Easy2Ddw - $(SolutionDir)$(Platform)\ - $(Configuration)\$(Platform)\ - - - - - - Level3 - Disabled - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - - - false - - - Windows - true - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - - - - - Windows - true - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/project/vs2010/Easy2D.vcxproj.filters b/project/vs2010/Easy2D.vcxproj.filters deleted file mode 100644 index e144e4ef..00000000 --- a/project/vs2010/Easy2D.vcxproj.filters +++ /dev/null @@ -1,215 +0,0 @@ - - - - - {5be538cb-a432-4f84-9678-bbf408eca288} - - - {d4a509dd-1bc0-4456-9554-d414de91b50c} - - - {c907d829-e510-472c-bd47-cf4eab6f9266} - - - {62d6a1d4-f1ec-458a-aee0-377b16012bed} - - - {508b39c8-a430-45c3-9405-364fbc281220} - - - {c5f168c6-1403-486a-9cae-ab29495a723c} - - - {7b102f67-5905-4c0e-8400-51c128da026a} - - - {c536c42c-283d-4a10-b19b-0699b4f1e051} - - - {17bdc67b-1801-4b69-b79b-ffcbbee8dae0} - - - {6c760a81-9bc8-4fb0-a145-8e119b783365} - - - - - - - - - - - - - - - - - - Action - - - Action - - - Action - - - Action - - - Action - - - Action - - - Action - - - Action - - - Action - - - Action - - - Action - - - Action - - - Action - - - Action - - - Action - - - Action - - - Action - - - Base - - - Base - - - Base - - - Base - - - Base - - - Common - - - Common - - - Common - - - Common - - - Common - - - Common - - - Geometry - - - Geometry - - - Geometry - - - Geometry - - - Event - - - Listener - - - Listener - - - Listener - - - Manager - - - Manager - - - Manager - - - Manager - - - Manager - - - Node - - - Node - - - Node - - - Node - - - Node - - - Node - - - Tool - - - Tool - - - Tool - - - Tool - - - Transition - - - Transition - - - Transition - - - Transition - - - \ No newline at end of file