mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-29 18:23:03 +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_clipboard.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
#include <unordered_map>
|
||||
|
@ -677,6 +678,8 @@ struct InputPrivate
|
|||
/* Collective binding array */
|
||||
std::vector<Binding*> bindings;
|
||||
|
||||
std::string clipboardText;
|
||||
|
||||
ButtonState stateArray[BUTTON_CODE_COUNT*2];
|
||||
|
||||
ButtonState *states;
|
||||
|
@ -1493,11 +1496,10 @@ void Input::clearText()
|
|||
|
||||
const char *Input::getClipboardText()
|
||||
{
|
||||
// FIXME: this doesn't appear to be freed anywhere
|
||||
const char *tx = SDL_GetClipboardText();
|
||||
if (!tx)
|
||||
throw Exception(Exception::SDLError, "Failed to get clipboard text: %s", SDL_GetError());
|
||||
return tx;
|
||||
p->clipboardText = tx;
|
||||
SDL_free((void *)tx);
|
||||
return p->clipboardText.c_str();
|
||||
}
|
||||
|
||||
void Input::setClipboardText(const char *text)
|
||||
|
|
|
@ -41,7 +41,7 @@ int main(int argc, char **argv) {
|
|||
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;
|
||||
for (;;) {
|
||||
|
@ -53,7 +53,7 @@ int main(int argc, char **argv) {
|
|||
++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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue