mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-30 18:53:07 +02:00
Merge branch 'misc-fixes' into libretro
This commit is contained in:
commit
3bceb56bd3
2 changed files with 8 additions and 6 deletions
|
@ -32,6 +32,7 @@
|
||||||
#include <SDL_mouse.h>
|
#include <SDL_mouse.h>
|
||||||
#include <SDL_clipboard.h>
|
#include <SDL_clipboard.h>
|
||||||
|
|
||||||
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
@ -677,6 +678,8 @@ 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;
|
||||||
|
@ -1493,11 +1496,10 @@ void Input::clearText()
|
||||||
|
|
||||||
const char *Input::getClipboardText()
|
const char *Input::getClipboardText()
|
||||||
{
|
{
|
||||||
// FIXME: this doesn't appear to be freed anywhere
|
|
||||||
const char *tx = SDL_GetClipboardText();
|
const char *tx = SDL_GetClipboardText();
|
||||||
if (!tx)
|
p->clipboardText = tx;
|
||||||
throw Exception(Exception::SDLError, "Failed to get clipboard text: %s", SDL_GetError());
|
SDL_free((void *)tx);
|
||||||
return tx;
|
return p->clipboardText.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Input::setClipboardText(const char *text)
|
void Input::setClipboardText(const char *text)
|
||||||
|
|
|
@ -41,7 +41,7 @@ int main(int argc, char **argv) {
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
outputf << "#include <stddef.h>\n#include <stdint.h>\nextern const uint8_t " << arrayname << "[] = {";
|
outputf << "#ifndef MKXPZ_EMBEDTOOL_" << arrayname << "\n#define MKXPZ_EMBEDTOOL_" << arrayname << "\n#include <stddef.h>\n#include <stdint.h>\n#ifdef __cplusplus\nextern\n#endif /* __cplusplus */\nconst uint8_t " << arrayname << "[] = {";
|
||||||
|
|
||||||
uint64_t len = 0;
|
uint64_t len = 0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
@ -53,7 +53,7 @@ int main(int argc, char **argv) {
|
||||||
++len;
|
++len;
|
||||||
}
|
}
|
||||||
|
|
||||||
outputf << "};\nextern const size_t " << arrayname << "_len = " << len << "ULL;";
|
outputf << "};\n#ifdef __cplusplus\nextern\n#endif /* __cplusplus */\nconst size_t " << arrayname << "_len = " << len << "ULL;\n#endif /* MKXPZ_EMBEDTOOL_" << arrayname << " */\n";
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue