// Draws a given hand on the face, using the vector and/or bitmap // structures. A given hand may be represented by a bitmap or a // vector, or a combination of both. void draw_hand(struct HandCache *hand_cache, struct HandDef *hand_def, int hand_index, GContext *ctx) { if (hand_def->vector_hand != NULL) { draw_vector_hand(hand_cache, hand_def, hand_index, ctx); } if (hand_def->bitmap_table != NULL) { draw_bitmap_hand(hand_cache, hand_def, hand_index, ctx); } }
void chrono_second_layer_update_callback(Layer *me, GContext* ctx) { (void)me; #ifdef VECTOR_CHRONO_SECOND_HAND draw_vector_hand(&chrono_second_hand_vector_table, current_placement.chrono_second_hand_index, NUM_STEPS_CHRONO_SECOND, CHRONO_SECOND_HAND_X, CHRONO_SECOND_HAND_Y, ctx); #endif #ifdef BITMAP_CHRONO_SECOND_HAND draw_bitmap_hand(&chrono_second_hand_bitmap_table[current_placement.chrono_second_hand_index], CHRONO_SECOND_HAND_X, CHRONO_SECOND_HAND_Y, ctx); #endif }
void minute_layer_update_callback(Layer *me, GContext* ctx) { (void)me; #ifdef VECTOR_MINUTE_HAND draw_vector_hand(&minute_hand_vector_table, current_placement.minute_hand_index, NUM_STEPS_MINUTE, MINUTE_HAND_X, MINUTE_HAND_Y, ctx); #endif #ifdef BITMAP_MINUTE_HAND draw_bitmap_hand(&minute_hand_bitmap_table[current_placement.minute_hand_index], MINUTE_HAND_X, MINUTE_HAND_Y, ctx); #endif }
void hour_layer_update_callback(Layer *me, GContext* ctx) { (void)me; #ifdef VECTOR_HOUR_HAND draw_vector_hand(&hour_hand_vector_table, current_placement.hour_hand_index, NUM_STEPS_HOUR, HOUR_HAND_X, HOUR_HAND_Y, ctx); #endif #ifdef BITMAP_HOUR_HAND draw_bitmap_hand(&hour_hand_bitmap_table[current_placement.hour_hand_index], HOUR_HAND_X, HOUR_HAND_Y, ctx); #endif }