mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-23 15:23:44 +02:00
Merge branch 'misc-fixes' into libretro
This commit is contained in:
commit
addf927922
5 changed files with 8 additions and 10 deletions
|
@ -581,7 +581,7 @@ static VALUE gets_(VALUE self) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE get_clipboard(VALUE self) {
|
static VALUE get_clipboard(VALUE self) {
|
||||||
return sb()->bind<struct rb_str_new_cstr>()()(mkxp_retro::input->getClipboardText());
|
return sb()->bind<struct rb_str_new_cstr>()()(mkxp_retro::input->getClipboardText().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE set_clipboard(VALUE self, VALUE value) {
|
static VALUE set_clipboard(VALUE self, VALUE value) {
|
||||||
|
|
|
@ -519,7 +519,7 @@ RB_METHOD(inputGets) {
|
||||||
|
|
||||||
RB_METHOD_GUARD(inputGetClipboard) {
|
RB_METHOD_GUARD(inputGetClipboard) {
|
||||||
RB_UNUSED_PARAM;
|
RB_UNUSED_PARAM;
|
||||||
return rb_utf8_str_new_cstr(shState->input().getClipboardText());
|
return rb_utf8_str_new_cstr(shState->input().getClipboardText().c_str());
|
||||||
}
|
}
|
||||||
RB_METHOD_GUARD_END
|
RB_METHOD_GUARD_END
|
||||||
|
|
||||||
|
|
|
@ -1264,9 +1264,9 @@ void Input::clearText()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *Input::getClipboardText()
|
std::string Input::getClipboardText()
|
||||||
{
|
{
|
||||||
return "";
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
void Input::setClipboardText(const char *text)
|
void Input::setClipboardText(const char *text)
|
||||||
|
|
|
@ -678,8 +678,6 @@ struct InputPrivate
|
||||||
/* Collective binding array */
|
/* Collective binding array */
|
||||||
std::vector<Binding*> bindings;
|
std::vector<Binding*> bindings;
|
||||||
|
|
||||||
std::string clipboardText;
|
|
||||||
|
|
||||||
ButtonState stateArray[BUTTON_CODE_COUNT*2];
|
ButtonState stateArray[BUTTON_CODE_COUNT*2];
|
||||||
|
|
||||||
ButtonState *states;
|
ButtonState *states;
|
||||||
|
@ -1494,12 +1492,12 @@ void Input::clearText()
|
||||||
shState->eThread().textInputBuffer.clear();
|
shState->eThread().textInputBuffer.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *Input::getClipboardText()
|
std::string Input::getClipboardText()
|
||||||
{
|
{
|
||||||
const char *tx = SDL_GetClipboardText();
|
const char *tx = SDL_GetClipboardText();
|
||||||
p->clipboardText = tx;
|
std::string str(tx);
|
||||||
SDL_free((void *)tx);
|
SDL_free((void *)tx);
|
||||||
return p->clipboardText.c_str();
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Input::setClipboardText(const char *text)
|
void Input::setClipboardText(const char *text)
|
||||||
|
|
|
@ -156,7 +156,7 @@ public:
|
||||||
const char *getText();
|
const char *getText();
|
||||||
void clearText();
|
void clearText();
|
||||||
|
|
||||||
const char *getClipboardText();
|
std::string getClipboardText();
|
||||||
void setClipboardText(const char *text);
|
void setClipboardText(const char *text);
|
||||||
|
|
||||||
const char *getAxisName(SDL_GameControllerAxis axis);
|
const char *getAxisName(SDL_GameControllerAxis axis);
|
||||||
|
|
Loading…
Add table
Reference in a new issue