daily pastebin goal
69%
SHARE
TWEET

Untitled

a guest Aug 13th, 2017 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
Top