MCPcopy Create free account
hub / github.com/DFHack/dfhack / parseSpecial

Method parseSpecial

plugins/rendermax/renderer_light.cpp:995–1028  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

993 if(!lua_isnil(L,-1))engine->class_name=lua_parseMatDef(L);\
994 lua_pop(L,1)
995int lightingEngineViewscreen::parseSpecial(lua_State* L)
996{
997 auto engine= (lightingEngineViewscreen*)lua_touserdata(L, 1);
998 Lua::StackUnwinder unwinder(L);
999 lua_getfield(L,2,"special");
1000 if(!lua_istable(L,-1))
1001 {
1002 luaL_error(L,"Special table not found.");
1003 return 0;
1004 }
1005 LOAD_SPECIAL(LAVA,matLava);
1006 LOAD_SPECIAL(WATER,matWater);
1007 LOAD_SPECIAL(FROZEN_LIQUID,matIce);
1008 LOAD_SPECIAL(AMBIENT,matAmbience);
1009 LOAD_SPECIAL(CURSOR,matCursor);
1010 LOAD_SPECIAL(CITIZEN,matCitizen);
1011 GETLUANUMBER(engine->levelDim,levelDim);
1012 GETLUANUMBER(engine->dayHour,dayHour);
1013 GETLUANUMBER(engine->daySpeed,daySpeed);
1014 GETLUANUMBER(engine->num_diffuse,diffusionCount);
1015 GETLUANUMBER(engine->adv_mode,advMode);
1016 lua_getfield(L,-1,"dayColors");
1017 if(lua_istable(L,-1))
1018 {
1019 engine->dayColors.clear();
1020 lua_pushnil(L);
1021 while (lua_next(L, -2) != 0) {
1022 engine->dayColors.push_back(lua_parseLightCell(L));
1023 lua_pop(L,1);
1024 }
1025 lua_pop(L,1);
1026 }
1027 return 0;
1028}
1029#undef LOAD_SPECIAL
1030int lightingEngineViewscreen::parseItems(lua_State* L)
1031{

Callers

nothing calls this directly

Calls 7

lua_touserdataFunction · 0.85
lua_getfieldFunction · 0.85
luaL_errorFunction · 0.85
lua_pushnilFunction · 0.85
lua_nextFunction · 0.85
lua_parseLightCellFunction · 0.85
clearMethod · 0.45

Tested by

no test coverage detected