Skip to content

Commit 2da82e4

Browse files
committed
Fix compile warning C4717
1 parent 4f3bfbb commit 2da82e4

File tree

2 files changed

+4
-37
lines changed

2 files changed

+4
-37
lines changed

src/SDLWrapper/Renderer.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,9 @@ int Renderer::copyTo(const Texture& t, const Rect& dst, const Point& centerPoint
390390

391391
int Renderer::copyTo(const Texture& t, const Point& lupoint, const Point& centerPoint, double angle, FlipMode mode)
392392
{
393-
return copyTo(t,lupoint,centerPoint,angle,mode);
393+
auto d = Rect(lupoint.x, lupoint.y, t.getw(), t.geth()).toSDLRect();
394+
auto c = centerPoint.toSDLPoint();
395+
return SDL_RenderCopyEx(_get(), t._get(), NULL, &d, angle, &c, _internal::getSDLRendererFlipFromFlipMode(mode));
394396
}
395397

396398
int Renderer::copyFill(const Texture& t, const Rect& src, const Point& centerPoint, double angle, FlipMode mode)

src/SDLWrapper/Surface.cpp

+1-36
Original file line numberDiff line numberDiff line change
@@ -71,39 +71,6 @@ Surface::Surface(const RWOP& rwop)
7171
}
7272
}
7373

74-
//static
75-
Surface Surface::load(const std::string& filename)
76-
{
77-
Surface s;
78-
s.loadAs(filename);
79-
return s;
80-
}
81-
82-
//static
83-
Surface Surface::load(const RWOP& rwop)
84-
{
85-
Surface s;
86-
s.loadAs(rwop);
87-
return s;
88-
}
89-
90-
//static
91-
Surface Surface::create(int width, int height, int depth, int Rmask, int Gmask, int Bmask, int Amask)
92-
{
93-
Surface s;
94-
s.create(width,height,depth,Rmask,Gmask,Bmask,Amask);
95-
return s;
96-
}
97-
98-
//static
99-
Surface Surface::create(int width, int height, int depth, Uint32 surfaceFormat)
100-
{
101-
Surface s;
102-
s.create(width,height,depth,surfaceFormat);
103-
return s;
104-
}
105-
106-
10774
int Surface::loadAs(const std::string& filename)
10875
{
10976
SDL_Surface* temp=IMG_Load(filename.c_str());
@@ -150,7 +117,6 @@ int Surface::createAs(int width,int height,int depth,Uint32 surfaceFormat)
150117
{
151118
/// FIXME: This Function is available from SDL2.0.5. But the linker report a undefined reference.
152119

153-
/*
154120
SDL_Surface* temp=SDL_CreateRGBSurfaceWithFormat(0,width,height,depth,surfaceFormat);
155121
if(temp==nullptr)
156122
{
@@ -161,9 +127,7 @@ int Surface::createAs(int width,int height,int depth,Uint32 surfaceFormat)
161127
_set(temp);
162128
return 0;
163129
}
164-
*/
165130

166-
SDL_SetError("[MiniEngine] SDL_CreateRGBSurfaceWithFormat Not Linked.");
167131
return -1;
168132
}
169133

@@ -356,4 +320,5 @@ SDL_Surface* Surface::getRawPointer()
356320
{
357321
return _get();
358322
}
323+
359324
} /// End of namespace MiniEngine

0 commit comments

Comments
 (0)