Unverified Commit 25c42844 authored by Rob Loach's avatar Rob Loach
Browse files

Fix a few unused variable notices

parent 6ca8d9f3
......@@ -24,6 +24,7 @@ function lutro.draw()
end
function lutro.update(dt)
local width, height = spriteImg:getDimensions()
for index,value in ipairs(sprites) do
local tempSpriteId = value[1]
local tempSpritePosX = value[2]
......@@ -42,13 +43,13 @@ function lutro.update(dt)
tempSpriteSpeedY = tempSpriteSpeedY * -1
tempSpritePosY = 0
end
if tempSpritePosX > lutro.graphics.getWidth() then
if tempSpritePosX > lutro.graphics.getWidth() - width then
tempSpriteSpeedX = tempSpriteSpeedX * -1
tempSpritePosX = lutro.graphics.getWidth()
tempSpritePosX = lutro.graphics.getWidth() - width
end
if tempSpritePosY > lutro.graphics.getHeight() then
if tempSpritePosY > lutro.graphics.getHeight() - height then
tempSpriteSpeedY = tempSpriteSpeedY * -1
tempSpritePosY = lutro.graphics.getHeight()
tempSpritePosY = lutro.graphics.getHeight() - height
end
local sprite = {tempSpriteId, tempSpritePosX, tempSpritePosY, tempSpriteSpeedX, tempSpriteSpeedY }
......
......@@ -915,8 +915,9 @@ static int gfx_draw(lua_State *L)
float sy = OPTNUMBER(L, start + 5, sx);
int ox = OPTNUMBER(L, start + 6, 0);
int oy = OPTNUMBER(L, start + 7, 0);
int kx = OPTNUMBER(L, start + 8, 0);
int ky = OPTNUMBER(L, start + 9, 0);
// TODO: Make use of the kx ky shearing numbers in lutro.graphics.draw()
// int kx = OPTNUMBER(L, start + 8, 0);
// int ky = OPTNUMBER(L, start + 9, 0);
rect_t drect = {
x + ox,
......
......@@ -46,12 +46,13 @@ void *image_data_create(lua_State *L, bitmap_t* self)
if (luaL_newmetatable(L, "ImageData") != 0)
{
static luaL_Reg imgdata_funcs[] = {
{ "getWidth", l_getWidth },
{ "getHeight", l_getHeight },
{ "getPixel", l_getPixel },
{ "setPixel", l_setPixel },
{ "type", l_type },
{ "__gc", l_gc },
{ "getWidth", l_getWidth },
{ "getHeight", l_getHeight },
{ "getPixel", l_getPixel },
{ "setPixel", l_setPixel },
{ "getDimensions", l_getDimensions },
{ "type", l_type },
{ "__gc", l_gc },
{NULL, NULL}
};
......
......@@ -279,7 +279,8 @@ int win_showMessageBox(lua_State *L)
if (n > 5)
return luaL_error(L, "lutro.window.win_showMessageBox expects at most 5 arguments, %d given.", n);
const char* title = luaL_checkstring(L, 1);
// TODO: lutro.window.showMessageBox() - Prepend the title to the message... "title: message"
// const char* title = luaL_checkstring(L, 1);
const char* message = luaL_checkstring(L, 2);
struct retro_message msg = { message, 600 };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment