diff options
| author | veradec <glitchmill.dyj3d@simplelogin.co> | 2026-10-23 12:35:27 +0530 |
|---|---|---|
| committer | veradec <glitchmill.dyj3d@simplelogin.co> | 2026-10-23 12:35:27 +0530 |
| commit | 3847e8498dfaf80b04e5968bda4c53492c4f6d11 (patch) | |
| tree | e72d79abc2a410e22d2ffe03c8b0a9b148ef2476 /main.c | |
| parent | 72c2caf876a97abb783ea79752a64346906a5b03 (diff) | |
add: Makefile
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 53 |
1 files changed, 49 insertions, 4 deletions
@@ -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); |
