mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-08-03 15:27:13 -04:00
forward declare context and remove getter error handling
This commit is contained in:
parent
624df21a9c
commit
9fd0a66787
@ -1,7 +1,7 @@
|
||||
#include "clipboardbindings.hpp"
|
||||
|
||||
#include <SDL.h>
|
||||
#include <SDL_clipboard.h>
|
||||
#include <SDL_error.h>
|
||||
|
||||
#include <components/debug/debuglog.hpp>
|
||||
|
||||
@ -17,15 +17,10 @@ namespace MWLua
|
||||
api["get"] = []() {
|
||||
std::string text;
|
||||
|
||||
if (char* raw = SDL_GetClipboardText())
|
||||
{
|
||||
text = raw;
|
||||
SDL_free(raw);
|
||||
}
|
||||
else
|
||||
{
|
||||
Log(Debug::Error) << "Failed to get clipboard content: " << SDL_GetError();
|
||||
}
|
||||
char* raw = SDL_GetClipboardText();
|
||||
text = raw;
|
||||
|
||||
SDL_free(raw);
|
||||
|
||||
return text;
|
||||
};
|
||||
|
@ -3,10 +3,10 @@
|
||||
|
||||
#include <sol/forward.hpp>
|
||||
|
||||
#include "context.hpp"
|
||||
|
||||
namespace MWLua
|
||||
{
|
||||
struct Context;
|
||||
|
||||
sol::table initClipboardPackage(const Context&);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user