1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-25 09:15:38 +03:00

Add scale to lcd.drawBitmap. Scale is like in % (50 divides by two, 200 doubles) (#3592)

Default scale to 0 to allow DMA in target function (thx Bertrand)
This commit is contained in:
3djc 2016-06-12 16:01:05 +02:00 committed by Bertrand Songis
parent f415f38ba6
commit 5a3fc73946

View file

@ -395,13 +395,15 @@ void registerBitmapClass(lua_State * L)
}
/*luadoc
@function lcd.drawBitmap(bitmap, x, y)
@function lcd.drawBitmap(bitmap, x, y [, scale])
Displays a bitmap at (x,y)
@param bitmap (pointer) point to a bitmap previously opened with Bipmap.open()
@param x,y (positive numbers) starting coordinate
@param x,y (positive numbers) starting coordinates
@param scale (positive numbers) scale in %, 50 divides size by two, 100 is unchanged, 200 doubles size
@notice Only available on color screens
@ -413,9 +415,10 @@ static int luaLcdDrawBitmap(lua_State *L)
const BitmapBuffer * bitmap = checkBitmap(L, 1);
int x = luaL_checkinteger(L, 2);
int y = luaL_checkinteger(L, 3);
unsigned scale = luaL_optunsigned(L, 4, 0);
if (bitmap) {
lcd->drawBitmap(x, y, bitmap);
lcd->drawBitmap(x, y, bitmap, 0, 0, 0, 0, (float) scale/100);
}
return 0;
@ -426,7 +429,7 @@ static int luaLcdDrawBitmap(lua_State *L)
Draw a bitmap at (x,y)
@param x,y (positive numbers) starting coordinate
@param x,y (positive numbers) starting coordinates
@param name (string) full path to the bitmap on SD card (i.e. /IMAGES/test.bmp)