mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-02 09:03:37 +00:00
Fix screenshot save:
Use wchar_t string to keep provided screenshot path. Fixed Screenshots become invalid images #409
This commit is contained in:
parent
e3d8905984
commit
8950fef27b
|
@ -17,7 +17,7 @@ EXPORT bool CALL RunConfig(const wchar_t * _strFileName);
|
|||
EXPORT int CALL RunAbout();
|
||||
EXPORT void CALL LoadConfig(const wchar_t * _strFileName);
|
||||
EXPORT void CALL LoadCustomRomSettings(const wchar_t * _strFileName, const char * _romName);
|
||||
EXPORT void CALL SaveScreenshot(const char * _folder, const char * _name, int _width, int _height, const unsigned char * _data);
|
||||
EXPORT void CALL SaveScreenshot(const wchar_t * _folder, const char * _name, int _width, int _height, const unsigned char * _data);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
|
|
|
@ -6,12 +6,12 @@
|
|||
|
||||
#include "../Config.h"
|
||||
|
||||
EXPORT void CALL SaveScreenshot(const char * _folder, const char * _name, int _width, int _height, const unsigned char * _data)
|
||||
EXPORT void CALL SaveScreenshot(const wchar_t * _folder, const char * _name, int _width, int _height, const unsigned char * _data)
|
||||
{
|
||||
const char * bmp = "bmp";
|
||||
const char * jpg = "jpg";
|
||||
const char * fileExt = config.texture.screenShotFormat == 0 ? bmp : jpg;
|
||||
QString folderName = QString::fromLocal8Bit(_folder);
|
||||
QString folderName = QString::fromWCharArray(_folder);
|
||||
QDir folder;
|
||||
if (!folder.exists(folderName) && !folder.mkpath(folderName))
|
||||
return;
|
||||
|
|
|
@ -138,7 +138,7 @@ void OGLVideo::swapBuffers()
|
|||
|
||||
void OGLVideo::setCaptureScreen(const char * const _strDirectory)
|
||||
{
|
||||
m_strScreenDirectory = _strDirectory;
|
||||
::mbstowcs(m_strScreenDirectory, _strDirectory, PLUGIN_PATH_SIZE-1);
|
||||
m_bCaptureScreen = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -165,7 +165,7 @@ protected:
|
|||
m_bCaptureScreen(false), m_bToggleFullscreen(false), m_bResizeWindow(false), m_bFullscreen(false), m_bAdjustScreen(false),
|
||||
m_width(0), m_height(0), m_heightOffset(0),
|
||||
m_screenWidth(0), m_screenHeight(0), m_resizeWidth(0), m_resizeHeight(0),
|
||||
m_scaleX(0), m_scaleY(0), m_adjustScale(0), m_strScreenDirectory(NULL)
|
||||
m_scaleX(0), m_scaleY(0), m_adjustScale(0)
|
||||
{}
|
||||
|
||||
void _setBufferSize();
|
||||
|
@ -182,7 +182,7 @@ protected:
|
|||
f32 m_scaleX, m_scaleY;
|
||||
f32 m_adjustScale;
|
||||
|
||||
const char * m_strScreenDirectory;
|
||||
wchar_t m_strScreenDirectory[PLUGIN_PATH_SIZE];
|
||||
|
||||
private:
|
||||
OGLRender m_render;
|
||||
|
|
Loading…
Reference in New Issue
Block a user