فهرست منبع

switch to uint8_t from int

jblanked 9 ماه پیش
والد
کامیت
4a5b2eb5c0
2فایلهای تغییر یافته به همراه16 افزوده شده و 16 حذف شده
  1. 8 8
      flip_world.c
  2. 8 8
      flip_world.h

+ 8 - 8
flip_world.c

@@ -1,16 +1,16 @@
 #include <flip_world.h>
 char *fps_choices_str[] = {"30", "60", "120", "240"};
-int fps_index = 0;
+uint8_t fps_index = 0;
 char *yes_or_no_choices[] = {"No", "Yes"};
-int screen_always_on_index = 1;
-int sound_on_index = 1;
-int vibration_on_index = 1;
+uint8_t screen_always_on_index = 1;
+uint8_t sound_on_index = 1;
+uint8_t vibration_on_index = 1;
 char *player_sprite_choices[] = {"naked", "sword", "axe", "bow"};
-int player_sprite_index = 1;
+uint8_t player_sprite_index = 1;
 char *vgm_levels[] = {"-2", "-1", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"};
-int vgm_x_index = 2;
-int vgm_y_index = 2;
-int game_mode_index = 0;
+uint8_t vgm_x_index = 2;
+uint8_t vgm_y_index = 2;
+uint8_t game_mode_index = 0;
 float atof_(const char *nptr) { return (float)strtod(nptr, NULL); }
 float atof_furi(const FuriString *nptr) { return atof_(furi_string_get_cstr(nptr)); }
 bool is_str(const char *src, const char *dst) { return strcmp(src, dst) == 0; }

+ 8 - 8
flip_world.h

@@ -92,17 +92,17 @@ typedef struct
 } FlipWorldApp;
 
 extern char *fps_choices_str[];
-extern int fps_index;
+extern uint8_t fps_index;
 extern char *yes_or_no_choices[];
-extern int screen_always_on_index;
-extern int sound_on_index;
-extern int vibration_on_index;
+extern uint8_t screen_always_on_index;
+extern uint8_t sound_on_index;
+extern uint8_t vibration_on_index;
 extern char *player_sprite_choices[];
-extern int player_sprite_index;
+extern uint8_t player_sprite_index;
 extern char *vgm_levels[];
-extern int vgm_x_index;
-extern int vgm_y_index;
-extern int game_mode_index;
+extern uint8_t vgm_x_index;
+extern uint8_t vgm_y_index;
+extern uint8_t game_mode_index;
 float atof_(const char *nptr);
 float atof_furi(const FuriString *nptr);
 bool is_str(const char *src, const char *dst);