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

Function gui_box

src/lua-engine.cpp:4037–4062  ·  view source on GitHub ↗

gui.box(x1, y1, x2, y2, fillcolor, outlinecolor)

Source from the content-addressed store, hash-verified

4035
4036// gui.box(x1, y1, x2, y2, fillcolor, outlinecolor)
4037static int gui_box(lua_State *L) {
4038
4039 int x1,y1,x2,y2;
4040 uint32 fillcolor;
4041 uint32 outlinecolor;
4042
4043 x1 = luaL_checkinteger(L,1);
4044 y1 = luaL_checkinteger(L,2);
4045 x2 = luaL_checkinteger(L,3);
4046 y2 = luaL_checkinteger(L,4);
4047 fillcolor = gui_optcolour(L,5,LUA_BUILD_PIXEL(63, 255, 255, 255));
4048 outlinecolor = gui_optcolour(L,6,LUA_BUILD_PIXEL(255, LUA_PIXEL_R(fillcolor), LUA_PIXEL_G(fillcolor), LUA_PIXEL_B(fillcolor)));
4049
4050 if (x1 > x2)
4051 std::swap(x1, x2);
4052 if (y1 > y2)
4053 std::swap(y1, y2);
4054
4055 gui_prepare();
4056
4057 gui_drawbox_internal(x1, y1, x2, y2, outlinecolor);
4058 if ((x2 - x1) >= 2 && (y2 - y1) >= 2)
4059 gui_fillbox_internal(x1+1, y1+1, x2-1, y2-1, fillcolor);
4060
4061 return 0;
4062}
4063
4064// (old) gui.box(x1, y1, x2, y2, color)
4065FCEU_MAYBE_UNUSED

Callers

nothing calls this directly

Calls 6

luaL_checkintegerFunction · 0.85
gui_optcolourFunction · 0.85
swapFunction · 0.85
gui_prepareFunction · 0.85
gui_drawbox_internalFunction · 0.85
gui_fillbox_internalFunction · 0.85

Tested by

no test coverage detected