summaryrefslogtreecommitdiff
path: root/apps/plugins/lua/rocklib_img.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lua/rocklib_img.c')
-rw-r--r--apps/plugins/lua/rocklib_img.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/apps/plugins/lua/rocklib_img.c b/apps/plugins/lua/rocklib_img.c
index 39f6a51521..909f1b61b9 100644
--- a/apps/plugins/lua/rocklib_img.c
+++ b/apps/plugins/lua/rocklib_img.c
@@ -1188,7 +1188,7 @@ RLI_LUA rli_clear(lua_State *L)
1188#endif /* RLI_EXTENDED */ 1188#endif /* RLI_EXTENDED */
1189 1189
1190/* Rli Image methods exported to lua */ 1190/* Rli Image methods exported to lua */
1191const struct luaL_reg rli_lib [] = 1191static const struct luaL_reg rli_lib [] =
1192{ 1192{
1193 {"__tostring", rli_tostring}, 1193 {"__tostring", rli_tostring},
1194 {"_data", rli_raw}, 1194 {"_data", rli_raw},
@@ -1212,22 +1212,6 @@ const struct luaL_reg rli_lib [] =
1212 {NULL, NULL} 1212 {NULL, NULL}
1213}; 1213};
1214 1214
1215LUALIB_API int rli_init(lua_State *L)
1216{
1217 /* some devices need x | y coords shifted to match native format */
1218 /* conversion between packed native formats and individual pixel addressing */
1219 init_pixelmask(&x_shift, &y_shift, &xy_mask, &pixelmask);
1220
1221 luaL_newmetatable(L, ROCKLUA_IMAGE);
1222
1223 lua_pushvalue(L, -1); /* pushes the metatable */
1224 lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */
1225
1226 luaL_register(L, NULL, rli_lib);
1227
1228 return 1;
1229}
1230
1231/* 1215/*
1232 * ----------------------------- 1216 * -----------------------------
1233 * 1217 *
@@ -1402,7 +1386,7 @@ RB_WRAP(read_bmp_file)
1402} 1386}
1403 1387
1404#define R(NAME) {#NAME, rock_##NAME} 1388#define R(NAME) {#NAME, rock_##NAME}
1405const luaL_Reg rocklib_img[] = 1389static const luaL_Reg rocklib_img[] =
1406{ 1390{
1407 /* Graphics */ 1391 /* Graphics */
1408#ifdef HAVE_LCD_BITMAP 1392#ifdef HAVE_LCD_BITMAP
@@ -1430,3 +1414,19 @@ const luaL_Reg rocklib_img[] =
1430}; 1414};
1431#undef R 1415#undef R
1432 1416
1417LUALIB_API int luaopen_rock_img(lua_State *L)
1418{
1419 /* some devices need x | y coords shifted to match native format */
1420 /* conversion between packed native formats and individual pixel addressing */
1421 init_pixelmask(&x_shift, &y_shift, &xy_mask, &pixelmask);
1422
1423 luaL_newmetatable(L, ROCKLUA_IMAGE);
1424
1425 lua_pushvalue(L, -1); /* pushes the metatable */
1426 lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */
1427
1428 luaL_register(L, LUA_ROCKLIBNAME, rocklib_img);
1429 luaL_register(L, NULL, rli_lib);
1430
1431 return 1;
1432}