#define vram VIDEO(baseAddr)␊ |
␊ |
int lasttime = 0; // we need this for animating maybe␊ |
//bool useRollOver = false;␊ |
␊ |
extern int gDeviceCount;␊ |
␊ |
|
#ifdef EMBED_THEME␊ |
static int getEmbeddedImageIndexByName(const char *name)␊ |
{␊ |
␉int upperLimit = sizeof(embeddedImages) / sizeof(embeddedImages[0]) - 1;␊ |
␉int lowerLimit = 0;␊ |
␉int compareIndex = (upperLimit - lowerLimit + 1) >> 1; // Midpoint␊ |
␉int result;␊ |
␉␊ |
␉// NOTE: This algorithm assumes that the embeddedImages is sorted.␊ |
␉// This is currently done using the make file. If the array is every ␊ |
␉// manualy generated, this *will* fail to work properly.␊ |
␉while((result = strcmp(name, embeddedImages[compareIndex].name)) != 0)␊ |
int i;␊ |
␉for (i = 0; i < sizeof(embeddedImages) / sizeof(embeddedImages[0]); i++)␊ |
␉{␊ |
␊ |
␉␉if(result > 0)␉// We need to search a HIGHER index␊ |
␉␉{␊ |
␉␉␉if(compareIndex != upperLimit - 1)␊ |
␉␉␉{␊ |
␉␉␉␉lowerLimit = compareIndex;␊ |
␉␉␉}␊ |
␉␉␉else␊ |
␉␉␉{␊ |
␉␉␉␉return -1;␊ |
␉␉␉}␊ |
␊ |
␉␉}␊ |
␉␉else //if(result < 0) // We Need to search a LOWER index␊ |
␉␉{␊ |
␉␉␉if(compareIndex != lowerLimit + 1)␊ |
␉␉␉{␊ |
␉␉␉␉upperLimit = compareIndex;␊ |
␉␉␉}␊ |
␉␉␉else␊ |
␉␉␉{␊ |
␉␉␉␉return -1;␊ |
␉␉␉}␊ |
␉␉}␊ |
␉␉compareIndex = (upperLimit + lowerLimit + 1) >> 1;␉// Midpoint␊ |
␉ if (strcmp(name, embeddedImages[i].name) == 0)␊ |
␉ return i; // found the name␊ |
␉}␊ |
␉␊ |
␉return compareIndex;␊ |
␉return -1;␊ |
}␊ |
#endif␊ |
␊ |
|
␉␉colorFont(&font_small, gui.screen.font_small_color);␊ |
␉␉colorFont(&font_console, gui.screen.font_console_color);␊ |
␊ |
// use the alternate images for the selected item if available.␊ |
//useRollOver = (images[iDeviceGeneric].image->pixels != images[iDeviceGeneric_o].image->pixels) ? true : false;␊ |
␊ |
␉␉// create the screen & window buffers␊ |
␉␉if (createBackBuffer(&gui.screen) == 0) {␊ |
␉␉␉if (createWindowBuffer(&gui.screen) == 0) {␊ |
|
␉␉}␊ |
␉}␊ |
␉␊ |
␉// Use the next (device_*_o) image for the selected item if available.␊ |
if (isSelected/* && useRollOver*/) devicetype++;␊ |
␉// Use the next (device_*_o) image for the selected item.␊ |
if (isSelected) devicetype++;␊ |
␊ |
␉// draw icon␊ |
␉blend( images[devicetype].image, buffer, centeredAt( images[devicetype].image, p ));␊ |