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

Function invalidate

plugins/rendermax/rendermax.cpp:235–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233 return 0;
234}
235static int invalidate(lua_State* L)
236{
237 if(current_mode!=MODE_LUA)
238 return 0;
239 renderer_lua* r=reinterpret_cast<renderer_lua*>(enabler->renderer);
240 if(lua_gettop(L)==0)
241 {
242 r->invalidate();
243 }
244 else
245 {
246 int x,y,w,h;
247 lua_getfield(L,1,"x");
248 x=lua_tonumber(L,-1);lua_pop(L,1);
249 lua_getfield(L,1,"y");
250 y=lua_tonumber(L,-1);lua_pop(L,1);
251 lua_getfield(L,1,"w");
252 w=lua_tonumber(L,-1);lua_pop(L,1);
253 lua_getfield(L,1,"h");
254 h=lua_tonumber(L,-1);lua_pop(L,1);
255 r->invalidateRect(x,y,w,h);
256 }
257 return 0;
258}
259bool isEnabled()
260{
261 return current_mode==MODE_LUA;

Callers 1

logicMethod · 0.85

Calls 4

lua_gettopFunction · 0.85
lua_getfieldFunction · 0.85
invalidateRectMethod · 0.80
invalidateMethod · 0.45

Tested by

no test coverage detected