Quirks.cpp 516 B

12345678910111213141516171819202122232425262728
  1. #include <cstring>
  2. #include "Quirks.h"
  3. #include "utility/misc.h"
  4. #include "sfwindow.h"
  5. using namespace WalrusRPG;
  6. using tinystl::string;
  7. void Quirks::init(const char *argv_0)
  8. {
  9. UNUSED(argv_0);
  10. }
  11. void Quirks::deinit()
  12. {
  13. }
  14. std::unique_ptr<char> Quirks::solve_absolute_path(const char *path)
  15. {
  16. std::unique_ptr<char> result(new char[strlen(path)]);
  17. strcpy(result.get(), path);
  18. return result;
  19. }
  20. bool Quirks::get_key(keycode_t key)
  21. {
  22. return sf::Keyboard::isKeyPressed(key) && window.hasFocus();
  23. }