INNER CODE UNIT · C++

script

evanbowman/BPCore-Engine · source/BPCoreEngine.cpp:348

         auto script = platform->fs().get_file(fname).data_;
         if (luaL_loadstring(L, script)) {
             luaL_error(L, lua_tostring(L, -1));
         }
         if (lua_pcall(L, 0, 0, 0)) {
             luaL_error(L, lua_tostring(L, -1));
             return 1;
         }
         return 0;
     }},
    {"entanim",
     [](lua_State* L) -> int {
         auto e = (Entity*)lua_topointer(L, 1);
         e->has_anim_ = true;
         e->anim_start_ = lua_tointeger(L, 2);
         e->anim_len_ = clamp((int)lua_tointeger(L, 3), 1, 15);
         e->anim_rate_ = clamp((int)lua_tointeger(L, 4), 1, 15);
         lua_pushlightuserdata(L, e);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…