BetterScreenShoting
This commit is contained in:
+2
-1
@@ -258,4 +258,5 @@ paket-files/
|
|||||||
|
|
||||||
# Python Tools for Visual Studio (PTVS)
|
# Python Tools for Visual Studio (PTVS)
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.pyc
|
*.pyc
|
||||||
|
/TrooperEngineTest/test.bmp
|
||||||
|
|||||||
@@ -112,7 +112,14 @@ void cRenderer::RenderDrawRect( const SDL_Rect& rect, SDL_Texture* dst /*= nullp
|
|||||||
void cRenderer::ScreenShot( const cString& filename, const cString& dir /*= ""*/ )
|
void cRenderer::ScreenShot( const cString& filename, const cString& dir /*= ""*/ )
|
||||||
{
|
{
|
||||||
SDL_Surface* infoSurface = SDL_GetWindowSurface(VideoEngine::cVideo::Inst().getWindow());
|
SDL_Surface* infoSurface = SDL_GetWindowSurface(VideoEngine::cVideo::Inst().getWindow());
|
||||||
SDL_Surface* saveSurface = NewSurface();
|
if (infoSurface == nullptr)
|
||||||
|
cUtility::Inst().Message("Failed to create info surface from window.\n", __AT__, cUtility::eTypeSDL::SDL);
|
||||||
|
else {
|
||||||
|
SaveSurface(infoSurface, filename, dir);
|
||||||
|
SDL_FreeSurface(infoSurface);
|
||||||
|
infoSurface = NULL;
|
||||||
|
}
|
||||||
|
/*SDL_Surface* saveSurface = NewSurface();
|
||||||
|
|
||||||
if (infoSurface == NULL) {
|
if (infoSurface == NULL) {
|
||||||
cUtility::Inst().Message("Failed to create info surface from window.\n", __AT__, cUtility::eTypeSDL::SDL);
|
cUtility::Inst().Message("Failed to create info surface from window.\n", __AT__, cUtility::eTypeSDL::SDL);
|
||||||
@@ -125,7 +132,7 @@ void cRenderer::ScreenShot( const cString& filename, const cString& dir /*= ""*/
|
|||||||
infoSurface = NULL;
|
infoSurface = NULL;
|
||||||
}
|
}
|
||||||
SDL_FreeSurface(saveSurface);
|
SDL_FreeSurface(saveSurface);
|
||||||
saveSurface = NULL;
|
saveSurface = NULL;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user