MCPcopy Create free account
hub / github.com/TASEmulators/fceux / taseditor_setselection

Function taseditor_setselection

src/lua-engine.cpp:5269–5291  ·  view source on GitHub ↗

taseditor.setselection(table new_set)

Source from the content-addressed store, hash-verified

5267
5268// taseditor.setselection(table new_set)
5269static int taseditor_setselection(lua_State *L)
5270{
5271#ifdef __WIN_DRIVER__
5272 std::vector<int> cur_set;
5273 // retrieve new_set data from table to vector
5274 if (!lua_isnil(L, 1))
5275 {
5276 luaL_checktype(L, 1, LUA_TTABLE);
5277 int max_index = luaL_getn(L, 1);
5278 int i = 1;
5279 while (i <= max_index)
5280 {
5281 lua_rawgeti(L, 1, i);
5282 cur_set.push_back(lua_tonumber(L, -1));
5283 lua_pop(L, 1);
5284 i++;
5285 }
5286 }
5287 // and provide its reference to TAS Editor for changing selection
5288 taseditor_lua.setselection(cur_set);
5289#endif
5290 return 0;
5291}
5292
5293// int taseditor.getinput(int frame, int joypad)
5294static int taseditor_getinput(lua_State *L)

Callers

nothing calls this directly

Calls 5

luaL_checktypeFunction · 0.85
luaL_getnFunction · 0.85
lua_rawgetiFunction · 0.85
lua_tonumberFunction · 0.85
setselectionMethod · 0.45

Tested by

no test coverage detected