| 930 | if(!lua_isnil(L,-1) && lua_isnumber(L,-1))field=lua_tonumber(L,-1);\ |
| 931 | lua_pop(L,1) |
| 932 | matLightDef lua_parseMatDef(lua_State* L) |
| 933 | { |
| 934 | |
| 935 | matLightDef ret; |
| 936 | lua_getfield(L,-1,"tr"); |
| 937 | if((ret.isTransparent=!lua_isnil(L,-1))) |
| 938 | { |
| 939 | ret.transparency=lua_parseLightCell(L); |
| 940 | } |
| 941 | lua_pop(L,1); |
| 942 | |
| 943 | lua_getfield(L,-1,"em"); |
| 944 | if((ret.isEmiting=!lua_isnil(L,-1))) |
| 945 | { |
| 946 | ret.emitColor=lua_parseLightCell(L); |
| 947 | lua_pop(L,1); |
| 948 | lua_getfield(L,-1,"rad"); |
| 949 | if(lua_isnil(L,-1)) |
| 950 | { |
| 951 | lua_pop(L,1); |
| 952 | luaL_error(L,"Material has emittance but no radius"); |
| 953 | } |
| 954 | else |
| 955 | ret.radius=lua_tonumber(L,-1); |
| 956 | lua_pop(L,1); |
| 957 | } |
| 958 | else |
| 959 | lua_pop(L,1); |
| 960 | GETLUAFLAG(ret.flicker,"flicker"); |
| 961 | return ret; |
| 962 | } |
| 963 | int lightingEngineViewscreen::parseMaterials(lua_State* L) |
| 964 | { |
| 965 | auto engine= (lightingEngineViewscreen*)lua_touserdata(L, 1); |
no test coverage detected