mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-30 11:19:51 +02:00
Fix Clipboard for renderer build, ensure MacOS and Windows clipboard funcs return std::string
This commit is contained in:
@@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
|
|
||||||
void EngineProcess() {}
|
void EngineProcess() {}
|
||||||
void ClipboardPush(char * text) {}
|
void ClipboardPush(std::string) {}
|
||||||
char * ClipboardPull() {}
|
std::string ClipboardPull() {}
|
||||||
int GetModifiers() { return 0; }
|
int GetModifiers() { return 0; }
|
||||||
|
|
||||||
void readFile(std::string filename, std::vector<char> & storage)
|
void readFile(std::string filename, std::vector<char> & storage)
|
||||||
|
@@ -103,7 +103,7 @@ std::string ClipboardPull()
|
|||||||
{
|
{
|
||||||
#ifdef MACOSX
|
#ifdef MACOSX
|
||||||
const char *text = readClipboard();
|
const char *text = readClipboard();
|
||||||
return text ? text : "";
|
return text ? std::string(text) : "";
|
||||||
#elif defined(WIN)
|
#elif defined(WIN)
|
||||||
if (OpenClipboard(NULL))
|
if (OpenClipboard(NULL))
|
||||||
{
|
{
|
||||||
@@ -114,7 +114,7 @@ std::string ClipboardPull()
|
|||||||
glbuffer = (char*)GlobalLock(cbuffer);
|
glbuffer = (char*)GlobalLock(cbuffer);
|
||||||
GlobalUnlock(cbuffer);
|
GlobalUnlock(cbuffer);
|
||||||
CloseClipboard();
|
CloseClipboard();
|
||||||
return glbuffer ? glbuffer : "";
|
return glbuffer ? std::string(glbuffer) : "";
|
||||||
}
|
}
|
||||||
#elif defined(LIN) && defined(SDL_VIDEO_DRIVER_X11)
|
#elif defined(LIN) && defined(SDL_VIDEO_DRIVER_X11)
|
||||||
std::string text = "";
|
std::string text = "";
|
||||||
|
Reference in New Issue
Block a user