Advertisement
Guest User

Untitled

a guest
Aug 13th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. void Selenite::loadGame(const std::string& file)
  2. {
  3.  
  4. std::ifstream fs;
  5. fs.open(file,std::ios::binary|std::ios::in);
  6. if(fs.is_open())
  7. {
  8. if(lua)lua_close(lua);lua=0;
  9. lua=luaL_newstate();
  10.  
  11. /*
  12. luaL_newmetatable(lua, "object");
  13. lua_pushliteral(lua, "__index");
  14. lua_pushcfunction(lua,apiObjectIndex);
  15. lua_rawset(lua, -3);
  16. lua_pop(lua, 1);
  17. */
  18.  
  19.  
  20. if(rootObject)delete rootObject;
  21. rootObject=new TGameObject();
  22. rootObject->load(fs);
  23. std::string currentSceneUUID=ioutil::readString(fs);
  24. fs.close();
  25.  
  26.  
  27. //TScene* scene=(TScene*)rootObject->getObject(currentSceneUUID);
  28. //selectScene(scene);
  29.  
  30. }
  31. else
  32. {
  33.  
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement