9
« on: June 19, 2020, 08:09:26 AM »
Hi,
Here is the simplest display list where the trouble can be observed. It's dynamically built. Hence it is extracted from our mockup code. Small errors may appear in coordinates (hope not).
CLEAR_COLOR_RGB(10, 10, 60)
CLEAR(1 ,1 ,1)
CLEAR_TAG( 0 )
TAG( CONTENT_TAG_ID ) // Start drawing content
SAVE_CONTEXT()
draw_image(KITE_ICON_ID, 88, 88, 64, 64)
RESTORE_CONTEXT()
SAVE_CONTEXT()
COLOR_RGB(255, 255, 255)
CMD_TEXT(140, 96, 26, 0, "Blablabla")
CMD_TEXT(252, 136, 26, 0, "Blabla: blabla bla bla")
RESTORE_CONTEXT()
SAVE_CONTEXT()
draw_image(SAIL_ICON_ID, 752, 200, 64, 64)
RESTORE_CONTEXT()
TAG( 0 ) // End of the content
SAVE_CONTEXT()
BEGIN(RECTS) );
COLOR_RGB(80, 80, 80) // Title bar background
VERTEX2F(0 * 16, 0 * 16)
VERTEX2F(79 * 16, 799 * 16)
COLOR_RGB(60, 60, 60) // Menu bar background
VERTEX2F(0 * 16, 80 * 16)
VERTEX2F(79 * 16, 479 * 16)
COLOR_RGB(0, 0, 0) // Selection area background
VERTEX2F(0 * 16, y * 16)
VERTEX2F(79 * 16, 79 * 16)
END()
RESTORE_CONTEXT()
SAVE_CONTEXT() // Status led
draw_image(STATUS_GREEN_ID, 704, 16, 40, 40);
RESTORE_CONTEXT()
SAVE_CONTEXT() // Icons
TAG( HOME_TAG_ID ) // Home icon
draw_image(HOME_ICON_ID, 8, 8, 64, 64 );
RESTORE_CONTEXT()
SAVE_CONTEXT()
TAG( BACK_TAG_ID ) // Back icon
draw_image(BACK_ICON_ID, 88, 8, 64, 64);
TAG( SETTINGS_TAG_ID ) // Settings icon
draw_image(SETTINGS_ICON_ID, 712, 8, 64, 64);
TAG( mpCurrentState->tags[i] ) // Function icon
draw_image(FUNCTION_ICON_ID, 8, 88, 64, 64);
RESTORE_CONTEXT()
COLOR_RGB(240, 240, 240) // Title
CMD_TEXT(400, 8, 31, OPT_CENTERX, "Tests")
COLOR_MASK(0 ,0 ,0 ,0) // Content area
TAG(CONTENT_TAG_ID)
BEGIN(RECTS)
VERTEX2F(80 * 16, 80 * 16)
VERTEX2F(799 * 16, 479 * 16)
END()
where the draw_image function acts as this:
draw_image( id, x, y, w, h ):
BITMAP_SOURCE( images[id].ram_address )
BITMAP_LAYOUT( images[id].pImage->format, images[id].pImage->stride, images[id].pImage->height )
BITMAP_SIZE( NEAREST, BORDER, BORDER, images[id].pImage->width, images[id].pImage->height )
BEGIN( BITMAPS )
if ( images[id].pImage->width != w )
{
factor = images[id].pImage->width * 256 / w;
BITMAP_TRANSFORM_A(factor)
}
if ( images[id].pImage->height != h )
{
factor = images[id].pImage->height * 256 / h;
BITMAP_TRANSFORM_E(factor)
}
VERTEX2F( x * 16, y * 16 )
END()
All the icons are ARGB2 images (white drawing on transparent background), but the status led image is an ARGB555 image.
Thanks in advance for your support
Best regards