mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
alpha values for ImageData:mapPixel default to 255 (issue #603)
This commit is contained in:
@@ -49,7 +49,7 @@ void *CompressedData::getData() const
|
||||
{
|
||||
// Data for different mipmap levels is not stored contiguously in memory, so
|
||||
// getData() won't work properly for CompressedData.
|
||||
if (dataImages.size() > 0)
|
||||
if (dataImages.size() > 0 && dataImages[0].size > 0)
|
||||
return (void *) &(dataImages[0].data[0]);
|
||||
else
|
||||
return 0;
|
||||
|
||||
@@ -85,7 +85,7 @@ int w_ImageData_setPixel(lua_State *L)
|
||||
c.r = luaL_checkint(L, 4);
|
||||
c.g = luaL_checkint(L, 5);
|
||||
c.b = luaL_checkint(L, 6);
|
||||
c.a = luaL_optint(L,7,255);
|
||||
c.a = luaL_optint(L, 7, 255);
|
||||
try
|
||||
{
|
||||
t->setPixel(x, y, c);
|
||||
@@ -123,7 +123,7 @@ int w_ImageData_mapPixel(lua_State *L)
|
||||
c.r = luaL_optint(L, -4, 0);
|
||||
c.g = luaL_optint(L, -3, 0);
|
||||
c.b = luaL_optint(L, -2, 0);
|
||||
c.a = luaL_optint(L, -1, 0);
|
||||
c.a = luaL_optint(L, -1, 255);
|
||||
t->setPixel(i, j, c);
|
||||
lua_pop(L, 4);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user