Commits

Trammell Hudson  committed c5d1a51

Try triangles for the hour markers. not great yet

  • Participants
  • Parent commits dcf051c

Comments (0)

Files changed (1)

File zulu/src/zulu.c

 #define W PEBBLE_SCREEN_WIDTH
 #define H PEBBLE_SCREEN_WIDTH
 #define R (W/2 - 2)
+#define MOON_RADIUS 16
 
 // Circle points computed at startup and the path is dynamically adjuste
 #define NUM_POINTS 256
 
 // Hour markers
 static GPath hour_path;
-static GPoint hour_points[] = { { 0, R - 2 }, { 0, R + 2 } };
-static GPathInfo hour_info = { 2, hour_points };
+static GPoint hour_points[] = {
+	{ -4, R + 4 },
+	{  4, R + 4 },
+	{  0, R - 4 },
+	{ -4, R + 4 },
+};
+static GPathInfo hour_info = { sizeof(hour_points)/sizeof(*hour_points), hour_points };
 
 // Hour hand
 static GPath hand_path;
 static GPoint hand_points[] = {
-	{  0, 0 },
-	{ -5, -10 },
+	{  0, -5 },
+	{ -5, -15 },
 	{  0, -R },
-	{ +5, -10 },
+	{ +5, -15 },
 	{  0, 0 },
 };
-static GPathInfo hand_info = { 5, hand_points };
+static GPathInfo hand_info = { sizeof(hand_points)/sizeof(*hand_points), hand_points };
 
 
 static void
 
 	// Compute the sun up / sun down time and
 	// draw the semi-circle
-	int sun_up = 120;
-	int sun_down = 140;
+	int sun_up = (7 * NUM_POINTS) / 24;
+	int sun_down = (17 * NUM_POINTS) / 24;;
 
 	circle_path.num_points = sun_down - sun_up;
 	circle_path.points = &circle_points[sun_up];
 	gpath_draw_filled(ctx, &circle_path);
 	circle_path.points[0] = temp;
 
+
+	// Draw the moon phase in a cutout inside the bottom half
+	graphics_context_set_fill_color(ctx, GColorBlack);
+	graphics_fill_circle(ctx, GPoint(w/2,3*h/4), MOON_RADIUS);
+	graphics_draw_circle(ctx, GPoint(w/2,3*h/4), MOON_RADIUS);
+
 	// Draw the hour marks
 	for (int hour = 0 ; hour < 23 ; hour++)
 	{
 		gpath_rotate_to(&hour_path, (hour * TRIG_MAX_ANGLE) / 24);
+		graphics_context_set_fill_color(ctx, GColorBlack);
+		gpath_draw_filled(ctx, &hour_path);
+		graphics_context_set_stroke_color(ctx, GColorWhite);
 		gpath_draw_outline(ctx, &hour_path);
 	}