I just realized 8 still doesn't use all segments... Fixed time mg bitmap

This commit is contained in:
2026-05-30 19:01:12 -04:00
parent 9c05e5cacc
commit 1d4bcebfbb
3 changed files with 18 additions and 11 deletions
+7
View File
@@ -135,6 +135,13 @@
"name": "9",
"spaceOptimization": "storage",
"type": "bitmap"
},
{
"file": "super8.png",
"memoryFormat": "Smallest",
"name": "SUPER8",
"spaceOptimization": "storage",
"type": "bitmap"
}
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

+11 -11
View File
@@ -33,7 +33,7 @@ static GColor s_applied_time_mg = GColorWhite;
// bitmap statics
static GBitmap *s_font_bitmaps[10];
static GBitmap *s_time_mg_8;
static GBitmap *s_time_mg_super8;
static GBitmap *s_c_icon;
static GBitmap *s_h_icon;
static GBitmap *s_e_icon;
@@ -112,8 +112,8 @@ static void apply_settings(bool first_run) {
// TIME MG
if (settings.ShowTimeMG) {
//// load bitmap if not already loaded
if (!s_time_mg_8) {
s_time_mg_8 = gbitmap_create_with_resource(RESOURCE_ID_8);
if (!s_time_mg_super8) {
s_time_mg_super8 = gbitmap_create_with_resource(RESOURCE_ID_SUPER8);
s_applied_time_mg = GColorWhite;
}
//// create and insert any mg layer that does not already exist
@@ -126,7 +126,7 @@ static void apply_settings(bool first_run) {
for (int i = 0; i < 4; ++i) {
if (!s_time_mg_layers[i]) {
s_time_mg_layers[i] = bitmap_layer_create(s_time_grects[i]);
bitmap_layer_set_bitmap(s_time_mg_layers[i], s_time_mg_8);
bitmap_layer_set_bitmap(s_time_mg_layers[i], s_time_mg_super8);
bitmap_layer_set_compositing_mode(s_time_mg_layers[i], GCompOpSet);
if (first_run) {
layer_add_child(sibling_layer, bitmap_layer_get_layer(s_time_mg_layers[i]));
@@ -136,8 +136,8 @@ static void apply_settings(bool first_run) {
}
}
//// set bitmap color and mark layers dirty
if (s_time_mg_8 && settings.ColorMGTime.argb != s_applied_time_mg.argb) {
replace_gbitmap_color(s_applied_time_mg, settings.ColorMGTime, s_time_mg_8, NULL);
if (s_time_mg_super8 && settings.ColorMGTime.argb != s_applied_time_mg.argb) {
replace_gbitmap_color(s_applied_time_mg, settings.ColorMGTime, s_time_mg_super8, NULL);
for (int i = 0; i < 4; ++i) {
if (s_time_mg_layers[i]) {
layer_mark_dirty(bitmap_layer_get_layer(s_time_mg_layers[i]));
@@ -146,13 +146,13 @@ static void apply_settings(bool first_run) {
s_applied_time_mg = settings.ColorMGTime;
}
} else {
if (s_time_mg_8) {
if (s_time_mg_super8) {
for (int i = 0; i < 4; ++i) {
bitmap_layer_destroy(s_time_mg_layers[i]);
s_time_mg_layers[i] = NULL;
}
gbitmap_destroy(s_time_mg_8);
s_time_mg_8 = NULL;
gbitmap_destroy(s_time_mg_super8);
s_time_mg_super8 = NULL;
}
}
@@ -219,8 +219,8 @@ static void main_window_unload() {
bitmap_layer_destroy(s_e_layer);
bitmap_layer_destroy(s_h_layer);
bitmap_layer_destroy(s_c_layer);
if (s_time_mg_8) {
gbitmap_destroy(s_time_mg_8);
if (s_time_mg_super8) {
gbitmap_destroy(s_time_mg_super8);
for (int i = 0; i < 4; ++i) {
bitmap_layer_destroy(s_time_mg_layers[i]);
}