aboutsummaryrefslogtreecommitdiff
path: root/src/calp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/calp.c')
-rw-r--r--src/calp.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/calp.c b/src/calp.c
index 6748fd0..893b5f4 100644
--- a/src/calp.c
+++ b/src/calp.c
@@ -35,9 +35,6 @@ int main (void) {
int num_of_months = 12;
extern int days_in_month[12];
- // TBD: Add ability to choose filename
- char *filename;
- filename = "output.pdf";
// Create dimensions struct to hold measurements
struct dimensions dim;
@@ -55,6 +52,10 @@ int main (void) {
}
+ // TBD: Add ability to choose filename
+ char filename[20];
+ snprintf(filename, sizeof(filename), "%d.pdf", year);
+ //filename = "output.pdf";
// Initialization
// --------------
@@ -83,16 +84,8 @@ int main (void) {
// Construction
// ------------
// Print dimensions, for debugging
- //print_dimensions(&dim);
-
- // Draw all months
- //struct RGB color;
+ print_dimensions(&dim);
- //color = hex_to_rgb("81bbd3");
-
- //printf("red: %f\n", color.r);
- //printf("green: %f\n", color.g);
- //printf("blue: %f\n", color.b);
// Range of months to be rendered (Default: Full calendar year, 12 months)
int first_month = 0;
@@ -111,6 +104,11 @@ int main (void) {
set_color(paper, BLACK);
draw_month_title(paper, &dim, months[i]);
+ char path[20];
+
+ snprintf(path, 20, "assets/%d.png", i + 1);
+
+ draw_month_art(paper, &dim, path);
draw_month(paper, cd, day, &month, &dim);
draw_month_grid(paper, &month, &dim);