| 233 | return 0; |
| 234 | } |
| 235 | static 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 | } |
| 259 | bool isEnabled() |
| 260 | { |
| 261 | return current_mode==MODE_LUA; |
no test coverage detected