Fix compile warning C4717

This commit is contained in:
Kirigaya Kazuto 2020-02-13 09:54:19 +08:00
parent 4f3bfbbade
commit 2da82e4944
2 changed files with 4 additions and 37 deletions

View File

@ -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) 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) int Renderer::copyFill(const Texture& t, const Rect& src, const Point& centerPoint, double angle, FlipMode mode)

View File

@ -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) int Surface::loadAs(const std::string& filename)
{ {
SDL_Surface* temp=IMG_Load(filename.c_str()); 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. /// 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); SDL_Surface* temp=SDL_CreateRGBSurfaceWithFormat(0,width,height,depth,surfaceFormat);
if(temp==nullptr) if(temp==nullptr)
{ {
@ -161,9 +127,7 @@ int Surface::createAs(int width,int height,int depth,Uint32 surfaceFormat)
_set(temp); _set(temp);
return 0; return 0;
} }
*/
SDL_SetError("[MiniEngine] SDL_CreateRGBSurfaceWithFormat Not Linked.");
return -1; return -1;
} }
@ -356,4 +320,5 @@ SDL_Surface* Surface::getRawPointer()
{ {
return _get(); return _get();
} }
} /// End of namespace MiniEngine } /// End of namespace MiniEngine