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

Function taseditor_getselection

src/lua-engine.cpp:5243–5266  ·  view source on GitHub ↗

table taseditor.getselection()

Source from the content-addressed store, hash-verified

5241
5242// table taseditor.getselection()
5243static int taseditor_getselection(lua_State *L)
5244{
5245#ifdef __WIN_DRIVER__
5246 // create temp vector and provide its reference to TAS Editor for filling the vector with data
5247 std::vector<int> cur_set;
5248 taseditor_lua.getselection(cur_set);
5249 int size = cur_set.size();
5250 if (size)
5251 {
5252 lua_createtable(L, size, 0);
5253 for (int i = 0; i < size; ++i)
5254 {
5255 lua_pushinteger(L, cur_set[i]);
5256 lua_rawseti(L, -2, i + 1);
5257 }
5258 } else
5259 {
5260 lua_pushnil(L);
5261 }
5262#else
5263 lua_pushnil(L);
5264#endif
5265 return 1;
5266}
5267
5268// taseditor.setselection(table new_set)
5269static int taseditor_setselection(lua_State *L)

Callers

nothing calls this directly

Calls 6

lua_createtableFunction · 0.85
lua_pushintegerFunction · 0.85
lua_rawsetiFunction · 0.85
lua_pushnilFunction · 0.85
getselectionMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected