Change main.c to timetracker, and executable.
This commit is contained in:
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,5 +1,4 @@
|
|||||||
main
|
timetracker
|
||||||
main.dSYM
|
timetracker.dSYM
|
||||||
third_party
|
third_party
|
||||||
sourcecodepro.ttf
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|||||||
2
Makefile
2
Makefile
@@ -36,7 +36,7 @@ else
|
|||||||
FRAMEWORKS =
|
FRAMEWORKS =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
EXE=main
|
EXE=timetracker
|
||||||
|
|
||||||
$(EXE): $(EXE).c
|
$(EXE): $(EXE).c
|
||||||
$(CC) $(FLAGS) $(UFLAGS) $(INCLUDE) $^ $(LIBS) $(FRAMEWORKS) -o $@
|
$(CC) $(FLAGS) $(UFLAGS) $(INCLUDE) $^ $(LIBS) $(FRAMEWORKS) -o $@
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "sourcecodepro.h"
|
#include "opensans.h"
|
||||||
#include "raylib.h"
|
#include "raylib.h"
|
||||||
|
|
||||||
#ifndef true
|
#ifndef true
|
||||||
@@ -321,9 +321,10 @@ int main(int argc, char *argv[])
|
|||||||
InitWindow(state.window_w, state.window_h, "Time Tracker");
|
InitWindow(state.window_w, state.window_h, "Time Tracker");
|
||||||
SetWindowState(FLAG_MSAA_4X_HINT|FLAG_WINDOW_RESIZABLE);
|
SetWindowState(FLAG_MSAA_4X_HINT|FLAG_WINDOW_RESIZABLE);
|
||||||
|
|
||||||
SetTargetFPS(30);
|
//SetTargetFPS(30);
|
||||||
|
//SetTargetFPS(1);
|
||||||
|
|
||||||
state.font = LoadFontFromMemory(".ttf", sourcecodepro_ttf, sourcecodepro_ttf_len, 96, NULL, 0);
|
state.font = LoadFontFromMemory(".ttf", opensans_ttf, opensans_ttf_len, 96, NULL, 0);
|
||||||
if(!IsFontValid(state.font)) {
|
if(!IsFontValid(state.font)) {
|
||||||
fprintf(stderr, "Unable to load font\n");
|
fprintf(stderr, "Unable to load font\n");
|
||||||
return 1;
|
return 1;
|
||||||
@@ -338,8 +339,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
state.font_size = 30;
|
state.font_size = 30;
|
||||||
|
|
||||||
// DisableEventWaiting();
|
//DisableEventWaiting();
|
||||||
// EnableEventWaiting();
|
//EnableEventWaiting();
|
||||||
while(!WindowShouldClose()) {
|
while(!WindowShouldClose()) {
|
||||||
U64 now_s = now();
|
U64 now_s = now();
|
||||||
|
|
||||||
@@ -445,7 +446,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if(CheckCollisionPointRec(state.mouse_pos, rect)) {
|
if(CheckCollisionPointRec(state.mouse_pos, rect)) {
|
||||||
// TOOD: A general popup should be its own component.
|
// TOOD: A general popup should be its own component.
|
||||||
char *str_activity_type = activity_type_string_representation[i];
|
char *str_activity_type = activity_type_string_representation[activities[i].type];
|
||||||
|
|
||||||
Vector2 activity_type_d = MeasureTextEx(state.font, str_activity_type, state.font_size - 5.0f, 2);
|
Vector2 activity_type_d = MeasureTextEx(state.font, str_activity_type, state.font_size - 5.0f, 2);
|
||||||
Vector2 activity_time_d = MeasureTextEx(state.font, activities_stats[i].seconds_str, state.font_size - 10.0f, 2);
|
Vector2 activity_time_d = MeasureTextEx(state.font, activities_stats[i].seconds_str, state.font_size - 10.0f, 2);
|
||||||
@@ -455,8 +456,9 @@ int main(int argc, char *argv[])
|
|||||||
DrawRectangleRoundedLinesEx((Rectangle){ start_x, 40, rect_w, (F32)(activity_time_d.y + activity_type_d.y) }, 0.3f, 100, 2.0f, DARKGRAY);
|
DrawRectangleRoundedLinesEx((Rectangle){ start_x, 40, rect_w, (F32)(activity_time_d.y + activity_type_d.y) }, 0.3f, 100, 2.0f, DARKGRAY);
|
||||||
|
|
||||||
// FIXME: We are pulling the aggregate seconds here from the activity statisctics. This is wrong.
|
// FIXME: We are pulling the aggregate seconds here from the activity statisctics. This is wrong.
|
||||||
|
// FIXME: The moreover
|
||||||
DrawTextEx(state.font, str_activity_type, (Vector2){ start_x, 40.0f }, state.font_size - 5.0f, 2, WHITE);
|
DrawTextEx(state.font, str_activity_type, (Vector2){ start_x, 40.0f }, state.font_size - 5.0f, 2, WHITE);
|
||||||
DrawTextEx(state.font, activities_stats[i].seconds_str, (Vector2){ start_x, 40.0f + (F32)(activity_type_d.y) }, state.font_size - 10.0f, 2, WHITE);
|
DrawTextEx(state.font, activities_stats[activities[i].type].seconds_str, (Vector2){ start_x, 40.0f + (F32)(activity_type_d.y) }, state.font_size - 10.0f, 2, WHITE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
Reference in New Issue
Block a user