diff --git a/src/SDLWrapper/Renderer.cpp b/src/SDLWrapper/Renderer.cpp index 75925dd..9484cf9 100644 --- a/src/SDLWrapper/Renderer.cpp +++ b/src/SDLWrapper/Renderer.cpp @@ -390,7 +390,9 @@ int Renderer::copyTo(const Texture& t, const Rect& dst, const Point& centerPoint int Renderer::copyTo(const Texture& t, const Point& lupoint, const Point& centerPoint, double angle, FlipMode mode) { - return copyTo(t,lupoint,centerPoint,angle,mode); + auto d = Rect(lupoint.x, lupoint.y, t.getw(), t.geth()).toSDLRect(); + auto c = centerPoint.toSDLPoint(); + return SDL_RenderCopyEx(_get(), t._get(), NULL, &d, angle, &c, _internal::getSDLRendererFlipFromFlipMode(mode)); } int Renderer::copyFill(const Texture& t, const Rect& src, const Point& centerPoint, double angle, FlipMode mode) diff --git a/src/SDLWrapper/Surface.cpp b/src/SDLWrapper/Surface.cpp index b8e12dd..780b802 100644 --- a/src/SDLWrapper/Surface.cpp +++ b/src/SDLWrapper/Surface.cpp @@ -71,39 +71,6 @@ Surface::Surface(const RWOP& rwop) } } -//static -Surface Surface::load(const std::string& filename) -{ - Surface s; - s.loadAs(filename); - return s; -} - -//static -Surface Surface::load(const RWOP& rwop) -{ - Surface s; - s.loadAs(rwop); - return s; -} - -//static -Surface Surface::create(int width, int height, int depth, int Rmask, int Gmask, int Bmask, int Amask) -{ - Surface s; - s.create(width,height,depth,Rmask,Gmask,Bmask,Amask); - return s; -} - -//static -Surface Surface::create(int width, int height, int depth, Uint32 surfaceFormat) -{ - Surface s; - s.create(width,height,depth,surfaceFormat); - return s; -} - - int Surface::loadAs(const std::string& filename) { SDL_Surface* temp=IMG_Load(filename.c_str()); @@ -150,7 +117,6 @@ int Surface::createAs(int width,int height,int depth,Uint32 surfaceFormat) { /// FIXME: This Function is available from SDL2.0.5. But the linker report a undefined reference. - /* SDL_Surface* temp=SDL_CreateRGBSurfaceWithFormat(0,width,height,depth,surfaceFormat); if(temp==nullptr) { @@ -161,9 +127,7 @@ int Surface::createAs(int width,int height,int depth,Uint32 surfaceFormat) _set(temp); return 0; } - */ - SDL_SetError("[MiniEngine] SDL_CreateRGBSurfaceWithFormat Not Linked."); return -1; } @@ -356,4 +320,5 @@ SDL_Surface* Surface::getRawPointer() { return _get(); } + } /// End of namespace MiniEngine