Add Basalt support, completing support of color Pebbles
This commit is contained in:
24
src/c/main.c
24
src/c/main.c
@@ -30,7 +30,7 @@ static GRect s_guy_head_grect_on_screen_resting;
|
||||
static GRect s_guy_butt_grect_on_screen_raised;
|
||||
static GRect s_guy_butt_grect_off_screen_raised;
|
||||
static GRect s_guy_butt_grect_on_screen_resting;
|
||||
#if PBL_DISPLAY_WIDTH == 180
|
||||
#if PBL_DISPLAY_WIDTH <= 180
|
||||
// 8x+20(4-x)+20,
|
||||
// where x=one_count,
|
||||
// 8=width of "1",
|
||||
@@ -65,7 +65,7 @@ static Animation *s_butt_raise_template;
|
||||
static Animation *s_butt_out_template;
|
||||
|
||||
// declare lookup tables
|
||||
#if PBL_DISPLAY_WIDTH == 180
|
||||
#if PBL_DISPLAY_WIDTH <= 180
|
||||
static const uint8_t s_ones_offset[] = {0, 3, 6, 9, 12};
|
||||
#else
|
||||
static const uint8_t s_ones_offset[] = {0, 4, 7, 11, 15};
|
||||
@@ -124,7 +124,11 @@ static void update_minute_1() {
|
||||
|
||||
// write the current date into a buffer & format
|
||||
static char s_date_buffer[16];
|
||||
#if PBL_DISPLAY_WIDTH <= 144
|
||||
strftime(s_date_buffer, sizeof(s_date_buffer), "%m .%d", tick_time);
|
||||
#else
|
||||
strftime(s_date_buffer, sizeof(s_date_buffer), "%m.%d", tick_time);
|
||||
#endif
|
||||
|
||||
// update layers
|
||||
text_layer_set_text(s_time_layer, s_time_buffer);
|
||||
@@ -373,7 +377,7 @@ static void init() {
|
||||
s_random_color_next = s_dark_bg_colors[rand() % s_color_count];
|
||||
|
||||
// load custom font
|
||||
#if PBL_DISPLAY_WIDTH == 180
|
||||
#if PBL_DISPLAY_WIDTH <= 180
|
||||
s_custom_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_RETRO_COMPUTER_28));
|
||||
#else
|
||||
s_custom_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_RETRO_COMPUTER_34));
|
||||
@@ -382,11 +386,15 @@ static void init() {
|
||||
// load bluetooth indicator
|
||||
s_bt_icon = gbitmap_create_with_resource(RESOURCE_ID_BT);
|
||||
|
||||
// dynamically calculate coordinates for date/bt indicators
|
||||
// dynamically calculate coordinates for date/bt indicators
|
||||
#if PBL_DISPLAY_WIDTH <= 144
|
||||
s_date_pos_y = PBL_DISPLAY_HEIGHT / 2 - 6;
|
||||
#else
|
||||
s_date_pos_y = PBL_DISPLAY_HEIGHT / 2 - 9;
|
||||
#endif
|
||||
s_date_bt_width = (PBL_DISPLAY_WIDTH - s_max_time_width) / 2;
|
||||
s_date_grect_a = GRect(s_date_pos_x, s_date_pos_y, s_date_bt_width, s_date_height);
|
||||
#if PBL_DISPLAY_WIDTH == 180
|
||||
#if PBL_DISPLAY_WIDTH <= 180
|
||||
s_bt_pos_x = s_date_bt_width + s_max_time_width;
|
||||
#else
|
||||
s_bt_pos_x = s_date_bt_width + s_max_time_width + 1;
|
||||
@@ -396,7 +404,7 @@ static void init() {
|
||||
|
||||
// pre-create layers used in update_minute_1
|
||||
//// time
|
||||
#if PBL_DISPLAY_WIDTH == 180
|
||||
#if PBL_DISPLAY_WIDTH <= 180
|
||||
s_time_layer = text_layer_create(GRect(0, (PBL_DISPLAY_HEIGHT / 2) - 18, PBL_DISPLAY_WIDTH, 28));
|
||||
#else
|
||||
s_time_layer = text_layer_create(GRect(0, (PBL_DISPLAY_HEIGHT / 2) - 21, PBL_DISPLAY_WIDTH, 34));
|
||||
@@ -407,7 +415,11 @@ static void init() {
|
||||
//// date
|
||||
s_date_layer = text_layer_create(s_date_grect_a);
|
||||
text_layer_set_background_color(s_date_layer, GColorClear);
|
||||
#if PBL_DISPLAY_WIDTH <= 144
|
||||
text_layer_set_font(s_date_layer, fonts_get_system_font(FONT_KEY_GOTHIC_09));
|
||||
#else
|
||||
text_layer_set_font(s_date_layer, fonts_get_system_font(FONT_KEY_GOTHIC_14_BOLD));
|
||||
#endif
|
||||
text_layer_set_text_alignment(s_date_layer, GTextAlignmentCenter);
|
||||
//// bt
|
||||
s_bt_layer = bitmap_layer_create(s_bt_grect_a);
|
||||
|
||||
Reference in New Issue
Block a user