Просмотр исходного кода

switch to int8_t when applicable

jblanked 9 месяцев назад
Родитель
Сommit
8f159d9df8
1 измененных файлов с 8 добавлено и 8 удалено
  1. 8 8
      game/player.h

+ 8 - 8
game/player.h

@@ -12,7 +12,7 @@
 typedef struct
 typedef struct
 {
 {
     char id[32];                // Unique ID for the entity type
     char id[32];                // Unique ID for the entity type
-    int index;                  // Index for the specific entity instance
+    int8_t index;               // Index for the specific entity instance
     Vector size;                // Size of the entity
     Vector size;                // Size of the entity
     Sprite *sprite_right;       // Entity sprite when looking right
     Sprite *sprite_right;       // Entity sprite when looking right
     Sprite *sprite_left;        // Entity sprite when looking left
     Sprite *sprite_left;        // Entity sprite when looking left
@@ -26,7 +26,7 @@ typedef struct
     float speed;                // Speed of the entity
     float speed;                // Speed of the entity
     float attack_timer;         // Cooldown duration between attacks
     float attack_timer;         // Cooldown duration between attacks
     float elapsed_attack_timer; // Time elapsed since the last attack
     float elapsed_attack_timer; // Time elapsed since the last attack
-    float strength;             // Damage the entity deals
+    int8_t strength;            // Damage the entity deals
     float health;               // Health of the entity
     float health;               // Health of the entity
     char message[64];           // Message to display when interacting with the entity
     char message[64];           // Message to display when interacting with the entity
     bool is_user;               // Flag to indicate if the entity is a live player or not
     bool is_user;               // Flag to indicate if the entity is a live player or not
@@ -79,10 +79,10 @@ typedef struct
     Entity *player;
     Entity *player;
     //
     //
     float fps;
     float fps;
-    int level_count;
-    int enemy_count;
-    int npc_count;
-    int current_level;
+    int8_t level_count;
+    int8_t enemy_count;
+    int8_t npc_count;
+    int8_t current_level;
     bool ended_early;
     bool ended_early;
     Imu *imu;
     Imu *imu;
     bool imu_present;
     bool imu_present;
@@ -98,8 +98,8 @@ typedef struct
     //
     //
     GameMode game_mode;
     GameMode game_mode;
     //
     //
-    int icon_count;
-    int icon_offset;
+    uint32_t icon_count;
+    uint16_t icon_offset;
     //
     //
     char message[64];
     char message[64];
     //
     //