src/driver/glcd: code formatting

Origin commit data
------------------
Commit: 39cfc018db
Author: max_10 <max_10@gmx.de>
Date: 2023-08-14 (Mon, 14 Aug 2023)

Origin message was:
------------------
- src/driver/glcd: code formatting

Signed-off-by: Thilo Graf <dbt@novatux.de>

# Conflicts:
#	src/driver/glcd/glcd.cpp
This commit is contained in:
max_10
2023-08-15 20:55:34 +02:00
committed by Thilo Graf
parent 2434e49cdc
commit db21ead167
10 changed files with 427 additions and 319 deletions

View File

@@ -1,8 +1,7 @@
/*
analog clock - DBoxII-Project
Copyright (C) 2001 Steffen Hehn 'McClean',
2003 thegoodguy
Copyright (C) 2001 Steffen Hehn 'McClean', 2003 thegoodguy
License: GPL

View File

@@ -4,8 +4,6 @@
Copyright (C) 2001 Steffen Hehn 'McClean'
Homepage: http://dbox.cyberphoria.org/
License: GPL
This program is free software; you can redistribute it and/or modify

View File

@@ -4,8 +4,6 @@
Copyright (C) 2001 Steffen Hehn 'McClean'
Homepage: http://dbox.cyberphoria.org/
License: GPL
This program is free software; you can redistribute it and/or modify

View File

@@ -3,7 +3,6 @@
(C) 2012-2014 by martii
License: GPL
This program is free software; you can redistribute it and/or modify
@@ -184,9 +183,12 @@ uint32_t cGLCD::ColorConvert3to1(uint32_t red, uint32_t green, uint32_t blue)
unsigned int color_green_tmp = (static_cast<int>(green) * 2.55) + 1;
unsigned int color_blue_tmp = (static_cast<int>(blue) * 2.55) + 1;
uint32_t color = 0xff; color <<= 8;
color |= color_red_tmp; color <<= 8;
color |= color_green_tmp; color <<= 8;
uint32_t color = 0xff;
color <<= 8;
color |= color_red_tmp;
color <<= 8;
color |= color_green_tmp;
color <<= 8;
color |= color_blue_tmp;
return color;
@@ -325,19 +327,28 @@ void cGLCD::Exec()
g_PicViewer->getSize(Logo.c_str(), &icon_start_width, &icon_start_height);
if (t.glcd_logo && percent_logo &&
showImage(channel_id, Channel, t.glcd_logo_x_position+(bitmap->Width()-(percent_logo_width * bitmap->Width()/100))/2, t.glcd_logo_y_position, percent_logo_width * bitmap->Width()/100, percent_logo * bitmap->Height()/100, true, false)) {
showImage(channel_id, Channel, t.glcd_logo_x_position + (bitmap->Width() - (percent_logo_width * bitmap->Width() / 100)) / 2, t.glcd_logo_y_position, percent_logo_width * bitmap->Width() / 100, percent_logo * bitmap->Height() / 100, true, false))
{
doScrollChannel = false;
scrollChannelSkip = 0;
} else if (percent_logo && icon_start_width && icon_start_height &&
doShowLcdIcon && showImage(Logo, icon_start_width, icon_start_height, t.glcd_logo_x_position, t.glcd_logo_y_position, bitmap->Width(), percent_logo * bitmap->Height()/100, true, false)) {
}
else if (percent_logo && icon_start_width && icon_start_height &&
doShowLcdIcon && showImage(Logo, icon_start_width, icon_start_height, t.glcd_logo_x_position, t.glcd_logo_y_position, bitmap->Width(), percent_logo * bitmap->Height() / 100, true, false))
{
doScrollChannel = false;
scrollChannelSkip = 0;
} else if (percent_channel) {
if (ChannelWidth) {
if (scrollChannelForward) {
}
else if (percent_channel)
{
if (ChannelWidth)
{
if (scrollChannelForward)
{
if (ChannelWidth - scrollChannelSkip < bitmap->Width())
scrollChannelForward = false;
} else if (scrollChannelSkip <= 0) {
}
else if (scrollChannelSkip <= 0)
{
scrollChannelSkip = 0;
doScrollChannel = false;
}
@@ -352,7 +363,8 @@ void cGLCD::Exec()
if (scrollChannelOffset < 0)
scrollChannelOffset = 0;
if (scrollChannelOffset == 0) {
if (scrollChannelOffset == 0)
{
if (scrollChannelForward)
scrollChannelSkip += g_settings.glcd_scroll_speed;
else
@@ -365,10 +377,13 @@ void cGLCD::Exec()
{
if (EpgWidth)
{
if (scrollEpgForward) {
if (scrollEpgForward)
{
if (EpgWidth - scrollEpgSkip < bitmap->Width())
scrollEpgForward = false;
} else if (scrollEpgSkip <= 0) {
}
else if (scrollEpgSkip <= 0)
{
scrollEpgSkip = 0;
doScrollEpg = false;
}
@@ -383,7 +398,8 @@ void cGLCD::Exec()
if (scrollEpgOffset < 0)
scrollEpgOffset = 0;
if (scrollEpgOffset == 0) {
if (scrollEpgOffset == 0)
{
if (scrollEpgForward)
scrollEpgSkip += g_settings.glcd_scroll_speed;
else
@@ -453,7 +469,8 @@ void cGLCD::Exec()
&font_end, ColorConvert3to1(t.glcd_foreground_color_red, t.glcd_foreground_color_green, t.glcd_foreground_color_blue), GLCD::cColor::Transparent, true, 0, t.glcd_end_align);
}
if (percent_smalltext && !doStandby) {
if (percent_smalltext && !doStandby)
{
Lock();
SmalltextWidth = font_smalltext.Width(Smalltext);
Unlock();
@@ -473,11 +490,14 @@ void cGLCD::Exec()
if (t.glcd_icon_rec_x_position)
{
smalltext = "REC";
if (recLocked) {
if (recLocked)
{
drawText(t.glcd_icon_rec_x_position, t.glcd_icons_y_position,
bitmap->Width() - 1, SmalltextWidth, smalltext, &font_smalltext, GLCD::cColor::Red,
GLCD::cColor::Transparent, true, 0, 0);
} else {
}
else
{
drawText(t.glcd_icon_rec_x_position, t.glcd_icons_y_position,
bitmap->Width() - 1, SmalltextWidth, smalltext, &font_smalltext, GLCD::cColor::Gray,
GLCD::cColor::Transparent, true, 0, 0);
@@ -487,11 +507,14 @@ void cGLCD::Exec()
if (t.glcd_icon_mute_x_position)
{
smalltext = "MUTE";
if (muteLocked) {
if (muteLocked)
{
drawText(t.glcd_icon_mute_x_position, t.glcd_icons_y_position,
bitmap->Width() - 1, SmalltextWidth, smalltext, &font_smalltext, GLCD::cColor::Red,
GLCD::cColor::Transparent, true, 0, 0);
} else {
}
else
{
drawText(t.glcd_icon_mute_x_position, t.glcd_icons_y_position,
bitmap->Width() - 1, SmalltextWidth, smalltext, &font_smalltext, GLCD::cColor::Gray,
GLCD::cColor::Transparent, true, 0, 0);
@@ -501,24 +524,48 @@ void cGLCD::Exec()
if (t.glcd_icon_ts_x_position)
{
smalltext = "TS";
if (tsLocked) {
if (tsLocked)
{
drawText(t.glcd_icon_ts_x_position, t.glcd_icons_y_position,
bitmap->Width() - 1, SmalltextWidth, smalltext, &font_smalltext, GLCD::cColor::Yellow,
GLCD::cColor::Transparent, true, 0, 0);
} else {
}
else
{
drawText(t.glcd_icon_ts_x_position, t.glcd_icons_y_position,
bitmap->Width() - 1, SmalltextWidth, smalltext, &font_smalltext, GLCD::cColor::Gray,
GLCD::cColor::Transparent, true, 0, 0);
}
}
#if 0
if (t.glcd_icon_ecm_x_position)
{
smalltext = "ECM";
if (ecmLocked)
{
drawText(t.glcd_icon_ecm_x_position, t.glcd_icons_y_position,
bitmap->Width() - 1, SmalltextWidth, smalltext, &font_smalltext, GLCD::cColor::Green,
GLCD::cColor::Transparent, true, 0, 0);
}
else
{
drawText(t.glcd_icon_ecm_x_position, t.glcd_icons_y_position,
bitmap->Width() - 1, SmalltextWidth, smalltext, &font_smalltext, GLCD::cColor::Gray,
GLCD::cColor::Transparent, true, 0, 0);
}
}
#endif
if (t.glcd_icon_timer_x_position)
{
smalltext = "TIMER";
if (timerLocked) {
if (timerLocked)
{
drawText(t.glcd_icon_timer_x_position, t.glcd_icons_y_position,
bitmap->Width() - 1, SmalltextWidth, smalltext, &font_smalltext, GLCD::cColor::Yellow,
GLCD::cColor::Transparent, true, 0, 0);
} else {
}
else
{
drawText(t.glcd_icon_timer_x_position, t.glcd_icons_y_position,
bitmap->Width() - 1, SmalltextWidth, smalltext, &font_smalltext, GLCD::cColor::Gray,
GLCD::cColor::Transparent, true, 0, 0);
@@ -528,11 +575,14 @@ void cGLCD::Exec()
if (t.glcd_icon_dd_x_position)
{
smalltext = "DD";
if (ddLocked) {
if (ddLocked)
{
drawText(t.glcd_icon_dd_x_position, t.glcd_icons_y_position,
bitmap->Width() - 1, SmalltextWidth, smalltext, &font_smalltext, GLCD::cColor::Green,
GLCD::cColor::Transparent, true, 0, 0);
} else {
}
else
{
drawText(t.glcd_icon_dd_x_position, t.glcd_icons_y_position,
bitmap->Width() - 1, SmalltextWidth, smalltext, &font_smalltext, GLCD::cColor::Gray,
GLCD::cColor::Transparent, true, 0, 0);
@@ -541,24 +591,33 @@ void cGLCD::Exec()
if (t.glcd_icon_txt_x_position)
{
if (ismediaplayer) {
if (ismediaplayer)
{
smalltext = "SUB";
if (subLocked) {
if (subLocked)
{
drawText(t.glcd_icon_txt_x_position, t.glcd_icons_y_position,
bitmap->Width() - 1, SmalltextWidth, smalltext, &font_smalltext, GLCD::cColor::Green,
GLCD::cColor::Transparent, true, 0, 0);
} else {
}
else
{
drawText(t.glcd_icon_txt_x_position, t.glcd_icons_y_position,
bitmap->Width() - 1, SmalltextWidth, smalltext, &font_smalltext, GLCD::cColor::Gray,
GLCD::cColor::Transparent, true, 0, 0);
}
} else {
}
else
{
smalltext = "TXT";
if (txtLocked) {
if (txtLocked)
{
drawText(t.glcd_icon_txt_x_position, t.glcd_icons_y_position,
bitmap->Width() - 1, SmalltextWidth, smalltext, &font_smalltext, GLCD::cColor::Green,
GLCD::cColor::Transparent, true, 0, 0);
} else {
}
else
{
drawText(t.glcd_icon_txt_x_position, t.glcd_icons_y_position,
bitmap->Width() - 1, SmalltextWidth, smalltext, &font_smalltext, GLCD::cColor::Gray,
GLCD::cColor::Transparent, true, 0, 0);
@@ -569,11 +628,14 @@ void cGLCD::Exec()
if (t.glcd_icon_cam_x_position)
{
smalltext = "CAM";
if (camLocked) {
if (camLocked)
{
drawText(t.glcd_icon_cam_x_position, t.glcd_icons_y_position,
bitmap->Width() - 1, SmalltextWidth, smalltext, &font_smalltext, GLCD::cColor::Green,
GLCD::cColor::Transparent, true, 0, 0);
} else {
}
else
{
drawText(t.glcd_icon_cam_x_position, t.glcd_icons_y_position,
bitmap->Width() - 1, SmalltextWidth, smalltext, &font_smalltext, GLCD::cColor::Gray,
GLCD::cColor::Transparent, true, 0, 0);
@@ -609,55 +671,69 @@ void cGLCD::updateFonts()
int fontsize_end_new = percent_end * cglcd->lcd->Height() / 100;
int fontsize_smalltext_new = percent_smalltext * cglcd->lcd->Height() / 100;
if (!fonts_initialized || (fontsize_channel_new != fontsize_channel)) {
if (!fonts_initialized || (fontsize_channel_new != fontsize_channel))
{
fontsize_channel = fontsize_channel_new;
if (!font_channel.LoadFT2(t.glcd_font, "UTF-8", fontsize_channel)) {
if (!font_channel.LoadFT2(t.glcd_font, "UTF-8", fontsize_channel))
{
t.glcd_font = g_settings.font_file;
font_channel.LoadFT2(t.glcd_font, "UTF-8", fontsize_channel);
}
}
if (!fonts_initialized || (fontsize_epg_new != fontsize_epg)) {
if (!fonts_initialized || (fontsize_epg_new != fontsize_epg))
{
fontsize_epg = fontsize_epg_new;
if (!font_epg.LoadFT2(t.glcd_font, "UTF-8", fontsize_epg)) {
if (!font_epg.LoadFT2(t.glcd_font, "UTF-8", fontsize_epg))
{
t.glcd_font = g_settings.font_file;
font_epg.LoadFT2(t.glcd_font, "UTF-8", fontsize_epg);
}
}
if (!fonts_initialized || (fontsize_time_new != fontsize_time)) {
if (!fonts_initialized || (fontsize_time_new != fontsize_time))
{
fontsize_time = fontsize_time_new;
if (!font_time.LoadFT2(t.glcd_font, "UTF-8", fontsize_time)) {
if (!font_time.LoadFT2(t.glcd_font, "UTF-8", fontsize_time))
{
t.glcd_font = g_settings.font_file;
font_time.LoadFT2(t.glcd_font, "UTF-8", fontsize_time);
}
}
if (!fonts_initialized || (fontsize_duration_new != fontsize_duration)) {
if (!fonts_initialized || (fontsize_duration_new != fontsize_duration))
{
fontsize_duration = fontsize_duration_new;
if (!font_duration.LoadFT2(t.glcd_font, "UTF-8", fontsize_duration)) {
if (!font_duration.LoadFT2(t.glcd_font, "UTF-8", fontsize_duration))
{
t.glcd_font = g_settings.font_file;
font_duration.LoadFT2(t.glcd_font, "UTF-8", fontsize_duration);
}
}
if (!fonts_initialized || (fontsize_start_new != fontsize_start)) {
if (!fonts_initialized || (fontsize_start_new != fontsize_start))
{
fontsize_start = fontsize_start_new;
if (!font_start.LoadFT2(t.glcd_font, "UTF-8", fontsize_start)) {
if (!font_start.LoadFT2(t.glcd_font, "UTF-8", fontsize_start))
{
t.glcd_font = g_settings.font_file;
font_start.LoadFT2(t.glcd_font, "UTF-8", fontsize_start);
}
}
if (!fonts_initialized || (fontsize_end_new != fontsize_end)) {
if (!fonts_initialized || (fontsize_end_new != fontsize_end))
{
fontsize_end = fontsize_end_new;
if (!font_end.LoadFT2(t.glcd_font, "UTF-8", fontsize_end)) {
if (!font_end.LoadFT2(t.glcd_font, "UTF-8", fontsize_end))
{
t.glcd_font = g_settings.font_file;
font_end.LoadFT2(t.glcd_font, "UTF-8", fontsize_end);
}
}
if (!fonts_initialized || (fontsize_smalltext_new != fontsize_smalltext)) {
if (!fonts_initialized || (fontsize_smalltext_new != fontsize_smalltext))
{
fontsize_smalltext = fontsize_smalltext_new;
if (!font_smalltext.LoadFT2(t.glcd_font, "UTF-8", fontsize_smalltext)) {
if (!font_smalltext.LoadFT2(t.glcd_font, "UTF-8", fontsize_smalltext))
{
t.glcd_font = g_settings.font_file;
font_smalltext.LoadFT2(t.glcd_font, "UTF-8", fontsize_smalltext);
}
@@ -670,7 +746,8 @@ void cGLCD::updateFonts()
bool cGLCD::getBoundingBox(uint32_t *buffer, int width, int height, int &bb_x, int &bb_y, int &bb_w, int &bb_h)
{
if (!width || !height) {
if (!width || !height)
{
bb_x = bb_y = bb_w = bb_h = 0;
return false;
}
@@ -679,7 +756,8 @@ bool cGLCD::getBoundingBox(uint32_t *buffer, int width, int height, int &bb_x, i
uint32_t *b = buffer;
for (int y = 0; y < height; y++)
for (int x = 0; x < width; x++, b++)
if (*b) {
if (*b)
{
y_min = y;
goto out1;
}
@@ -688,26 +766,31 @@ out1:
b = buffer + height * width - 1;
for (int y = height - 1; y_min < y; y--)
for (int x = 0; x < width; x++, b--)
if (*b) {
if (*b)
{
y_max = y;
goto out2;
}
out2:
int x_min = width;
for (int x = 0; x < width; x++) {
for (int x = 0; x < width; x++)
{
b = buffer + x + y_min * width;
for (int y = y_min; y < y_max; y++, b += width)
if (*b) {
if (*b)
{
x_min = x;
goto out3;
}
}
out3:
int x_max = x_min;
for (int x = width - 1; x_min < x; x--) {
for (int x = width - 1; x_min < x; x--)
{
b = buffer + x + y_min * width;
for (int y = y_min; y < y_max; y++, b += width)
if (*b) {
if (*b)
{
x_max = x;
goto out4;
}
@@ -833,7 +916,8 @@ void cGLCD::Run(void)
break;
if (!g_settings.glcd_enable)
continue;
} else
}
else
while ((doSuspend || doStandby || !g_settings.glcd_enable) && !doExit)
sem_wait(&sem);
@@ -846,7 +930,8 @@ void cGLCD::Run(void)
g_settings.glcd_selected_config = 0;
lcd = GLCD::CreateDriver(GLCD::Config.driverConfigs[g_settings.glcd_selected_config].id, &GLCD::Config.driverConfigs[g_settings.glcd_selected_config]);
if (!lcd) {
if (!lcd)
{
#ifdef GLCD_DEBUG
fprintf(stderr, "CreateDriver failed.\n");
#endif
@@ -987,7 +1072,8 @@ void cGLCD::Run(void)
doScrollEpg = EpgWidth > bitmap->Width();
scrollEpgSkip = 0;
scrollEpgForward = true;
if (doScrollEpg) {
if (doScrollEpg)
{
scrollEpgOffset = bitmap->Width() / 4;
EpgWidth += scrollEpgOffset;
}
@@ -999,7 +1085,9 @@ void cGLCD::Run(void)
scrollChannelForward = true;
Scale = g_settings.current_volume;
//epg_id = -1;
} else {
}
else
{
Epg = "";
if (Channel.compare(g_Locale->getText(LOCALE_GLCD_VOLUME)))
{
@@ -1008,7 +1096,8 @@ void cGLCD::Run(void)
doScrollChannel = ChannelWidth > bitmap->Width();
scrollChannelForward = true;
scrollChannelSkip = 0;
if (doScrollChannel) {
if (doScrollChannel)
{
scrollChannelOffset = bitmap->Width() / 4;
ChannelWidth += scrollChannelOffset;
}
@@ -1079,7 +1168,8 @@ void cGLCD::Run(void)
doScrollChannel = ChannelWidth > bitmap->Width();
scrollChannelForward = true;
scrollChannelSkip = 0;
if (doScrollChannel) {
if (doScrollChannel)
{
scrollChannelOffset = bitmap->Width() / 4;
ChannelWidth += scrollChannelOffset;
}
@@ -1104,7 +1194,8 @@ void cGLCD::Run(void)
{
scrollEpgOffset = bitmap->Width() / 4;
EpgWidth += scrollEpgOffset;
} else
}
else
scrollEpgOffset = 0;
}
@@ -1165,7 +1256,8 @@ void cGLCD::Run(void)
{
scrollEpgOffset = bitmap->Width() / 4;
EpgWidth += scrollEpgOffset;
} else
}
else
scrollEpgOffset = 0;
}
}
@@ -1205,7 +1297,8 @@ void cGLCD::Run(void)
lcd->DeInit();
delete lcd;
lcd = NULL;
} while(!doExit);
}
while (!doExit);
}
void cGLCD::Update()
@@ -1497,10 +1590,12 @@ void cGLCD::unlockIcon(int type)
bool cGLCD::showProgressBarBorder(uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t scale, uint32_t color_border, uint32_t color_progress)
{
cglcd->bitmap->DrawRectangle(x1, y1, x1 + (x2 - x1 - 1), y2, color_border, false);
if (scale) {
if (scale)
{
cglcd->bitmap->DrawRectangle(x1 + 1, y1 + 1, x1 + (scale * (x2 - x1 - 1) / 100), y2 - 1, color_progress, true);
return true;
} else
}
else
return false;
}
@@ -1517,7 +1612,9 @@ bool cGLCD::showImage(fb_pixel_t *s, uint32_t sw, uint32_t sh, uint32_t dx, uint
uint32_t dw_new = dh * bb_w / bb_h;
dx += (dw - dw_new) >> 1;
dw = dw_new;
} else {
}
else
{
uint32_t dh_new = dw * bb_h / bb_w;
dy += (dh - dh_new) >> 1;
dh = dh_new;
@@ -1574,8 +1671,7 @@ bool cGLCD::imageShow(const std::string & filename, uint32_t dx, uint32_t dy, ui
cglcd->bitmap->Clear(GLCD::cColor::Black);
if (maximize)
ret = showImage(filename, (uint32_t) sw, (uint32_t) sh, (uint32_t) dx, (uint32_t) dy, (uint32_t) cglcd->bitmap->Width(), (uint32_t) cglcd->bitmap->Height(), transp, false);
else
if (center_sw || center_sh)
else if (center_sw || center_sh)
{
int move_sw = 0;
int move_sh = 0;
@@ -1592,8 +1688,7 @@ bool cGLCD::imageShow(const std::string & filename, uint32_t dx, uint32_t dy, ui
else
ret = showImage(filename, (uint32_t) sw, (uint32_t) sh, (uint32_t) move_sw, (uint32_t) move_sh, (uint32_t) sw, (uint32_t) sh, transp, false);
}
else
if (dw > 0 && dh > 0)
else if (dw > 0 && dh > 0)
ret = showImage(filename, (uint32_t) sw, (uint32_t) sh, (uint32_t) dx, (uint32_t) dy, (uint32_t) dw, (uint32_t) dh, transp, false);
else
ret = showImage(filename, (uint32_t) sw, (uint32_t) sh, (uint32_t) dx, (uint32_t) dy, (uint32_t) sw, (uint32_t) sh, transp, false);
@@ -1644,20 +1739,31 @@ bool cGLCD::dumpBuffer(fb_pixel_t *s, int format, const char *filename)
if (cglcd)
cglcd->Lock();
if (format == BMP) {
if (format == BMP)
{
// write bmp
unsigned char hdr[14 + 40];
int i = 0;
#define PUT32(x) hdr[i++] = ((x)&0xFF); hdr[i++] = (((x)>>8)&0xFF); hdr[i++] = (((x)>>16)&0xFF); hdr[i++] = (((x)>>24)&0xFF);
#define PUT16(x) hdr[i++] = ((x)&0xFF); hdr[i++] = (((x)>>8)&0xFF);
#define PUT8(x) hdr[i++] = ((x)&0xFF);
PUT8('B'); PUT8('M');
PUT8('B');
PUT8('M');
PUT32((((xres * yres) * 3 + 3) & ~ 3) + 14 + 40);
PUT16(0); PUT16(0); PUT32(14 + 40);
PUT32(40); PUT32(xres); PUT32(yres);
PUT16(0);
PUT16(0);
PUT32(14 + 40);
PUT32(40);
PUT32(xres);
PUT32(yres);
PUT16(1);
PUT16(output_bytes * 8); // bits
PUT32(0); PUT32(0); PUT32(0); PUT32(0); PUT32(0); PUT32(0);
PUT32(0);
PUT32(0);
PUT32(0);
PUT32(0);
PUT32(0);
PUT32(0);
#undef PUT32
#undef PUT16
#undef PUT8
@@ -1666,7 +1772,9 @@ bool cGLCD::dumpBuffer(fb_pixel_t *s, int format, const char *filename)
int y;
for (y = yres - 1; y >= 0 ; y -= 1)
fwrite(output + (y * xres * output_bytes), xres * output_bytes, 1, fd);
} else if (format == JPG) {
}
else if (format == JPG)
{
const int row_stride = xres * output_bytes;
// write jpg
if (output_bytes == 3) // swap bgr<->rgb
@@ -1726,7 +1834,9 @@ bool cGLCD::dumpBuffer(fb_pixel_t *s, int format, const char *filename)
}
jpeg_finish_compress(&cinfo);
jpeg_destroy_compress(&cinfo);
} else if (format == PNG) {
}
else if (format == PNG)
{
// write png
png_bytep *row_pointers;
png_structp png_ptr;

View File

@@ -158,18 +158,21 @@ class cGLCD
static void Unlock();
bool config_mode;
public:
enum {
enum
{
BMP = 0,
JPG = 1,
PNG = 2,
};
enum {
enum
{
ALIGN_NONE = 0,
ALIGN_LEFT = 1,
ALIGN_CENTER = 2,
ALIGN_RIGHT = 3,
};
enum {
enum
{
REC = 0,
MUTE = 1,
TS = 2,
@@ -180,7 +183,8 @@ class cGLCD
SUB = 7,
CAM = 8,
};
enum {
enum
{
CLOCK_OFF = 0,
CLOCK_SIMPLE = 1,
CLOCK_LED = 2,

View File

@@ -20,7 +20,6 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -53,16 +52,17 @@ void SimpleClockUpdateFonts(int mode)
break;
case cGLCD::CLOCK_SIMPLE:
default:
font = t.glcd_font
;
font = t.glcd_font;
}
int fontsize_time_standby = 0;
int percent_time_standby = std::min(t.glcd_standby_clock_simple_size, 100);
int fontsize_time_standby_new = percent_time_standby * cglcd->lcd->Height() / 100;
if (fontsize_time_standby_new != fontsize_time_standby) {
if (fontsize_time_standby_new != fontsize_time_standby)
{
fontsize_time_standby = fontsize_time_standby_new;
if (!font_time_standby.LoadFT2(font, "UTF-8", fontsize_time_standby)) {
if (!font_time_standby.LoadFT2(font, "UTF-8", fontsize_time_standby))
{
font_time_standby.LoadFT2(g_settings.font_file, "UTF-8", fontsize_time_standby);
}
}

View File

@@ -4,8 +4,6 @@
Copyright (C) 2001 Steffen Hehn 'McClean'
Homepage: http://dbox.cyberphoria.org/
License: GPL
This program is free software; you can redistribute it and/or modify

View File

@@ -20,7 +20,6 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <config.h>
#include <cstdio>
#include "weather.h"
@@ -62,16 +61,20 @@ void WeatherUpdateFonts()
standby_weather_percent = std::min(t.glcd_standby_weather_percent, 100);
int standby_weather_fontsize_new = standby_weather_percent * cglcd->lcd->Height() / 100;
if (!fonts_initialized || (weather_fontsize_new != weather_fontsize)) {
if (!fonts_initialized || (weather_fontsize_new != weather_fontsize))
{
weather_fontsize = weather_fontsize_new;
if (!font_temperature.LoadFT2(t.glcd_font, "UTF-8", weather_fontsize)) {
if (!font_temperature.LoadFT2(t.glcd_font, "UTF-8", weather_fontsize))
{
font_temperature.LoadFT2(g_settings.font_file, "UTF-8", weather_fontsize);
}
}
if (!fonts_initialized || (standby_weather_fontsize_new != standby_weather_fontsize)) {
if (!fonts_initialized || (standby_weather_fontsize_new != standby_weather_fontsize))
{
standby_weather_fontsize = standby_weather_fontsize_new;
if (!font_temperature_standby.LoadFT2(t.glcd_font, "UTF-8", standby_weather_fontsize)) {
if (!font_temperature_standby.LoadFT2(t.glcd_font, "UTF-8", standby_weather_fontsize))
{
font_temperature_standby.LoadFT2(g_settings.font_file, "UTF-8", standby_weather_fontsize);
}
}

View File

@@ -4,8 +4,6 @@
Copyright (C) 2001 Steffen Hehn 'McClean'
Homepage: http://dbox.cyberphoria.org/
License: GPL
This program is free software; you can redistribute it and/or modify