2
0

lua.cpp 697 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #include "Crown.h"
  2. #include "Game.h"
  3. namespace crown
  4. {
  5. StringSetting g_boot("boot_file", "lua main file", "lua/game.raw");
  6. lua_State* L;
  7. void init()
  8. {/*
  9. L = luaL_newstate();
  10. luaL_openlibs(L);
  11. lua_cpcall(L, luaopen_libcrownlua, NULL);
  12. const char* path = device()->filesystem()->os_path(g_boot.value());
  13. if (luaL_loadfile(L, path) || lua_pcall(L, 0, 0, 0))
  14. {
  15. os::printf("error: %s", lua_tostring(L, -1));
  16. }
  17. lua_getglobal(L, "init");
  18. lua_pcall(L, 0, 0, 0);
  19. */
  20. }
  21. void shutdown()
  22. {
  23. /*
  24. lua_getglobal(L, "shutdown");
  25. lua_pcall(L, 0, 0, 0);
  26. lua_close(L);
  27. */
  28. }
  29. void frame(float dt)
  30. {
  31. /*
  32. lua_getglobal(L, "frame");
  33. lua_pushnumber(L, dt);
  34. lua_pcall(L, 1, 0, 0);
  35. */
  36. }
  37. }