summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorveradec <glitchmill.dyj3d@simplelogin.co>2026-10-23 12:35:27 +0530
committerveradec <glitchmill.dyj3d@simplelogin.co>2026-10-23 12:35:27 +0530
commit3847e8498dfaf80b04e5968bda4c53492c4f6d11 (patch)
treee72d79abc2a410e22d2ffe03c8b0a9b148ef2476
parent72c2caf876a97abb783ea79752a64346906a5b03 (diff)
add: Makefile
-rw-r--r--Makefile4
-rw-r--r--TODO.md2
-rw-r--r--main.c53
3 files changed, 54 insertions, 5 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..428e43a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,4 @@
+main: main.c main.h
+ gcc main.c -lraylib -o output/main
+
+
diff --git a/TODO.md b/TODO.md
index d3abc79..37e4ff1 100644
--- a/TODO.md
+++ b/TODO.md
@@ -1,5 +1,5 @@
-[] Cmatrix for the Title Menu Background
[] Write Values to Configuration File
+[] Cmatrix for the Title Menu Background
[] Find a good secondary font (pixel)
[] find a wood-click sfx for clicks
[] hold FPS settings when vsync_check is true \ No newline at end of file
diff --git a/main.c b/main.c
index b8e378d..e68bbe2 100644
--- a/main.c
+++ b/main.c
@@ -176,10 +176,6 @@ void SettingsMenu() {
WriteDrawText("Master Level", width / 2 - (width / 6),
height / 2 + (height / 10), (font_size * 2), BLACK);
- /* Rectangle master_rec = {width / 2 + (width / 5), height / 2 + (height / 10), */
- /* MeasureText("[]", font_size * 3) * master_level, */
- /* font_size * 2, BLACK}; */
-
Rectangle master_rec = MakeRect(width/2+(width/5), height/2 + (height/10), MeasureText("[]", font_size * 3) * master_level, font_size*2);
Rectangle master_bg = MakeRect(width/2+(width/5), height/2 + (height/10), MeasureText("[]", font_size * 3) * 9, font_size*2);
DrawRectangleRec(master_bg, RAYWHITE);
@@ -354,10 +350,59 @@ void LoadConfiguration() {
}
void WriteConfiguration(char *key, int value) {
+
+ chdir(getenv("HOME"));
+ int check = mkdir(".config/raycar", 0777);
+
+ chdir(".config/raycar");
+
+ FILE *fptr = fopen("settings.conf", "rw");
+
+ if (!fptr) {
+ LoadConfiguration();
+ }
+
+ if (strcmp(key, "resolution") == 0) {
+
+ return;
+ }
+
+ if (strcmp(key, "vsync") == 0) {
+ if (value == 1) {
+ // Write True to File
+ }
+
+ if (value == 0){
+ // Write False to File
+ }
+ return;
+ }
+
+ if (strcmp(key, "master_level") == 0) {
+ if (value < 10 && value > -1) {
+ // Write value to file
+ }
+ return;
+ }
+
+ if (strcmp(key, "music_level") == 0) {
+ if (value < 10 && value > -1) {
+ // Write value to file
+ }
+ return;
+ }
+
+ if (strcmp(key, "sfx_level") == 0) {
+ if (value < 10 && value > -1) {
+ // Write value to file
+ }
+ return;
+ }
}
int main() {
+ /* WriteConfiguration("resolution", 1); */
SetConfigFlags(FLAG_VSYNC_HINT);
InitWindow(width, height, "Leetaro");
title_font = LoadFontEx("/home/san/code/raylib_car/assets/Pixelout.ttf", 32, NULL,0);