From 2fdf701703bd9789034124366344454f7d1ee84c Mon Sep 17 00:00:00 2001 From: kiritow <1362050620@qq.com> Date: Sat, 1 Jul 2017 15:46:42 +0800 Subject: [PATCH] Fix bugs in SDLSystem. Update MiniEngine --- MiniEngine.cpp | 25 ------------------------- MiniEngine.h | 5 ----- SDLWrapper/SDLSystem.cpp | 4 ++-- 3 files changed, 2 insertions(+), 32 deletions(-) diff --git a/MiniEngine.cpp b/MiniEngine.cpp index e4b2650..eca5768 100644 --- a/MiniEngine.cpp +++ b/MiniEngine.cpp @@ -74,31 +74,6 @@ namespace MiniEngine delete pimpl; } - int SetClipboardText(const std::string& str) - { - return SDL_SetClipboardText(str.c_str()); - } - - std::string GetClipboardText() - { - char* pstr=SDL_GetClipboardText(); - if(pstr==nullptr) - { - return std::string(); - } - else - { - std::string s(pstr); - SDL_free(pstr); - return s; - } - } - - bool HasClipboardText() - { - return SDL_HasClipboardText()==SDL_TRUE; - } - bool GetScanKeyState(SDL_Scancode code) { return SDL_GetKeyboardState(NULL)[code]; diff --git a/MiniEngine.h b/MiniEngine.h index e48ef73..0a7ce45 100644 --- a/MiniEngine.h +++ b/MiniEngine.h @@ -4,7 +4,6 @@ #include #include "SDLWrapper/IncludeAll.h" - namespace MiniEngine { class StringEngine @@ -24,10 +23,6 @@ namespace MiniEngine impl* pimpl; }; - int SetClipboardText(const std::string& str); - std::string GetClipboardText(); - bool HasClipboardText(); - /// Experimental - For Experts: Use SDL ScanCode bool GetScanKeyState(SDL_Scancode); diff --git a/SDLWrapper/SDLSystem.cpp b/SDLWrapper/SDLSystem.cpp index f0d309f..c8d0c48 100644 --- a/SDLWrapper/SDLSystem.cpp +++ b/SDLWrapper/SDLSystem.cpp @@ -31,7 +31,7 @@ SDLSystem::SDLSystem(const std::initializer_list& flag_sdl, } ret=IMG_Init(img_flag); - if(ret!=0) + if(ret!=img_flag) /// IMG_Init returns its parameter on success. { ErrorViewer e; e.fetch(); @@ -39,7 +39,7 @@ SDLSystem::SDLSystem(const std::initializer_list& flag_sdl, } ret=Mix_Init(mix_flag); - if(ret!=0) + if(ret!=mix_flag) /// Mix_Init returns its parameter on success. { ErrorViewer e; e.fetch();