mirror of
https://github.com/opentx/opentx.git
synced 2025-07-16 12:55:12 +03:00
Small fixes
This commit is contained in:
parent
bfd385115f
commit
0600122102
4 changed files with 4 additions and 25 deletions
|
@ -459,19 +459,6 @@ const char * imgLoad(uint8_t * bmp, const char * filename, uint16_t width, uint1
|
|||
}
|
||||
stbi_image_free(data);
|
||||
return 0;
|
||||
// // ... process data if not NULL ...
|
||||
// // ... x = width, y = height, n = # 8-bit components per pixel ...
|
||||
// // ... replace '0' with '1'..'4' to force that many components per pixel
|
||||
// // ... but 'n' will always be the number that it would have been if you said 0
|
||||
// stbi_image_free(data)
|
||||
//
|
||||
// Standard parameters:
|
||||
// int *x -- outputs image width in pixels
|
||||
// int *y -- outputs image height in pixels
|
||||
// int *comp -- outputs # of image components in image file
|
||||
// int req_comp -- if non-zero, # of image components requested in result
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif // if defined(PCBHORUS)
|
||||
|
|
|
@ -311,7 +311,7 @@ void lcdSetContrast();
|
|||
#define lcdOff(...)
|
||||
|
||||
const char * bmpLoad(uint8_t * dest, const char * filename, uint16_t width, uint16_t height);
|
||||
const char * imgLoad(uint8_t * bmp, const char * filename, uint16_t width, uint16_t height);
|
||||
const char * imgLoad(uint8_t * dest, const char * filename, uint16_t width, uint16_t height);
|
||||
|
||||
|
||||
#if defined(BOOT)
|
||||
|
|
|
@ -357,17 +357,7 @@ bool menuGeneralSdManager(evt_t _event)
|
|||
}
|
||||
|
||||
char * ext = getFileExtension(reusableBuffer.sdmanager.lines[index], SD_SCREEN_FILE_LENGTH+1);
|
||||
if (ext && !strcasecmp(ext, BITMAPS_EXT)) {
|
||||
if (lastBitmap != menuVerticalPosition) {
|
||||
lastBitmap = menuVerticalPosition;
|
||||
if (imgLoad(modelBitmap, reusableBuffer.sdmanager.lines[index], MODEL_BITMAP_WIDTH, MODEL_BITMAP_HEIGHT)) {
|
||||
((uint32_t *)modelBitmap)[0] = 0;
|
||||
}
|
||||
}
|
||||
lcdDrawBitmap(LCD_W/2, (LCD_H-MODEL_BITMAP_HEIGHT)/2, modelBitmap);
|
||||
}
|
||||
|
||||
if (ext && (!strcasecmp(ext, ".png") || !strcasecmp(ext, ".jpg"))) {
|
||||
if (ext && (!strcasecmp(ext, BITMAPS_EXT) || !strcasecmp(ext, PNG_EXT) || !strcasecmp(ext, JPG_EXT))) {
|
||||
if (lastBitmap != menuVerticalPosition) {
|
||||
lastBitmap = menuVerticalPosition;
|
||||
if (imgLoad(modelBitmap, reusableBuffer.sdmanager.lines[index], MODEL_BITMAP_WIDTH, MODEL_BITMAP_HEIGHT)) {
|
||||
|
|
|
@ -46,6 +46,8 @@
|
|||
#define LOGS_EXT ".csv"
|
||||
#define SOUNDS_EXT ".wav"
|
||||
#define BITMAPS_EXT ".bmp"
|
||||
#define PNG_EXT ".png"
|
||||
#define JPG_EXT ".jpg"
|
||||
#define SCRIPTS_EXT ".lua"
|
||||
#define TEXT_EXT ".txt"
|
||||
#define FIRMWARE_EXT ".bin"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue