jblanked 1 tahun lalu
induk
melakukan
e695aec48d
15 mengubah file dengan 10 tambahan dan 548 penghapusan
  1. 10 4
      callback/callback.c
  2. 0 14
      callback/callback.h
  3. 0 126
      flip_storage/storage.c
  4. 0 11
      flip_storage/storage.h
  5. 0 15
      game/draw.c
  6. 0 1
      game/draw.h
  7. 0 73
      game/enemy.c
  8. 0 1
      game/enemy.h
  9. 0 133
      game/icon.c
  10. 0 1
      game/icon.h
  11. 0 24
      game/player.c
  12. 0 4
      game/player.h
  13. 0 9
      game/storage.c
  14. 0 130
      game/world.c
  15. 0 2
      game/world.h

+ 10 - 4
callback/callback.c

@@ -1,4 +1,10 @@
 #include <callback/callback.h>
+#include <furi.h>
+#include "engine/engine.h"
+#include "engine/game_engine.h"
+#include "engine/game_manager_i.h"
+#include "engine/level_i.h"
+#include "engine/entity_i.h"
 
 // Below added by Derek Jamison
 // FURI_LOG_DEV will log only during app development. Be sure that Settings/System/Log Device is "LPUART"; so we dont use serial port.
@@ -634,7 +640,7 @@ static char *flip_world_parse_world_list(DataLoaderModel *model)
         view_dispatcher_switch_to_view(app_instance->view_dispatcher, FlipWorldViewSubmenu); // just go back to the main menu for now
         return "app_instance is NULL";
     }
-    FuriThread *thread = furi_thread_alloc_ex("game", 4096, game_app, app_instance);
+    FuriThread *thread = furi_thread_alloc_ex("game", 2048, game_app, app_instance);
     if (!thread)
     {
         view_dispatcher_switch_to_view(app_instance->view_dispatcher, FlipWorldViewSubmenu); // just go back to the main menu for now
@@ -805,7 +811,7 @@ static bool flip_world_fetch_game(DataLoaderModel *model)
                 view_dispatcher_switch_to_view(app_instance->view_dispatcher, FlipWorldViewSubmenu); // just go back to the main menu for now
                 return "app_instance is NULL";
             }
-            FuriThread *thread = furi_thread_alloc_ex("game", 4096, game_app, app_instance);
+            FuriThread *thread = furi_thread_alloc_ex("game", 2048, game_app, app_instance);
             if (!thread)
             {
                 view_dispatcher_switch_to_view(app_instance->view_dispatcher, FlipWorldViewSubmenu); // just go back to the main menu for now
@@ -976,7 +982,7 @@ static char *flip_world_parse_game(DataLoaderModel *model)
                 view_dispatcher_switch_to_view(app_instance->view_dispatcher, FlipWorldViewSubmenu); // just go back to the main menu for now
                 return "app_instance is NULL";
             }
-            FuriThread *thread = furi_thread_alloc_ex("game", 4096, game_app, app_instance);
+            FuriThread *thread = furi_thread_alloc_ex("game", 2048, game_app, app_instance);
             if (!thread)
             {
                 FURI_LOG_E(TAG, "Failed to allocate game thread");
@@ -1013,7 +1019,7 @@ static char *flip_world_parse_game(DataLoaderModel *model)
             view_dispatcher_switch_to_view(app_instance->view_dispatcher, FlipWorldViewSubmenu); // just go back to the main menu for now
             return "app_instance is NULL";
         }
-        FuriThread *thread = furi_thread_alloc_ex("game", 4096, game_app, app_instance);
+        FuriThread *thread = furi_thread_alloc_ex("game", 2048, game_app, app_instance);
         if (!thread)
         {
             FURI_LOG_E(TAG, "Failed to allocate game thread");

+ 0 - 14
callback/callback.h

@@ -2,14 +2,6 @@
 #include <flip_world.h>
 #include <flip_storage/storage.h>
 
-//
-#include <furi.h>
-#include "engine/engine.h"
-#include "engine/game_engine.h"
-#include "engine/game_manager_i.h"
-#include "engine/level_i.h"
-#include "engine/entity_i.h"
-
 void free_all_views(void *context, bool should_free_variable_item_list, bool should_free_submenu_settings);
 void callback_submenu_choices(void *context, uint32_t index);
 uint32_t callback_to_submenu(void *context);
@@ -26,12 +18,6 @@ enum DataState
     DataStateError,
 };
 
-// typedef enum FlipWorldCustomEvent FlipWorldCustomEvent;
-// enum FlipWorldCustomEvent
-// {
-//     FlipWorldCustomEventProcess,
-// };
-
 typedef struct DataLoaderModel DataLoaderModel;
 typedef bool (*DataLoaderFetch)(DataLoaderModel *model);
 typedef char *(*DataLoaderParser)(DataLoaderModel *model);

+ 0 - 126
flip_storage/storage.c

@@ -252,132 +252,6 @@ bool load_char(
     return strlen(value) > 0;
 }
 
-bool save_world(
-    const char *name,
-    const char *world_data)
-{
-    // Create the directory for saving settings
-    char directory_path[256];
-    snprintf(directory_path, sizeof(directory_path), STORAGE_EXT_PATH_PREFIX "/apps_data/flip_world/worlds");
-
-    // Create the directory
-    Storage *storage = furi_record_open(RECORD_STORAGE);
-    storage_common_mkdir(storage, directory_path);
-
-    // Open the settings file
-    File *file = storage_file_alloc(storage);
-    char file_path[256];
-    snprintf(file_path, sizeof(file_path), STORAGE_EXT_PATH_PREFIX "/apps_data/flip_world/worlds/%s.json", name);
-
-    // Open the file in write mode
-    if (!storage_file_open(file, file_path, FSAM_WRITE, FSOM_CREATE_ALWAYS))
-    {
-        FURI_LOG_E(HTTP_TAG, "Failed to open file for writing: %s", file_path);
-        storage_file_free(file);
-        furi_record_close(RECORD_STORAGE);
-        return false;
-    }
-
-    // Write the data to the file
-    size_t data_size = strlen(world_data) + 1; // Include null terminator
-    if (storage_file_write(file, world_data, data_size) != data_size)
-    {
-        FURI_LOG_E(HTTP_TAG, "Failed to append data to file");
-        storage_file_close(file);
-        storage_file_free(file);
-        furi_record_close(RECORD_STORAGE);
-        return false;
-    }
-
-    storage_file_close(file);
-    storage_file_free(file);
-    furi_record_close(RECORD_STORAGE);
-
-    return true;
-}
-
-bool save_world_furi(FuriString *name, FuriString *world_data)
-{
-    // Create the directory for saving settings
-    char directory_path[256];
-    snprintf(directory_path, sizeof(directory_path), STORAGE_EXT_PATH_PREFIX "/apps_data/flip_world/worlds");
-
-    // Create the directory
-    Storage *storage = furi_record_open(RECORD_STORAGE);
-    storage_common_mkdir(storage, directory_path);
-
-    // Open the settings file
-    File *file = storage_file_alloc(storage);
-    char file_path[256];
-    snprintf(file_path, sizeof(file_path), STORAGE_EXT_PATH_PREFIX "/apps_data/flip_world/worlds/%s.json", furi_string_get_cstr(name));
-
-    // Open the file in write mode
-    if (!storage_file_open(file, file_path, FSAM_WRITE, FSOM_CREATE_ALWAYS))
-    {
-        FURI_LOG_E(HTTP_TAG, "Failed to open file for writing: %s", file_path);
-        storage_file_free(file);
-        furi_record_close(RECORD_STORAGE);
-        return false;
-    }
-
-    // Write the data to the file
-    size_t data_size = furi_string_size(world_data) + 1; // Include null terminator
-    if (storage_file_write(file, furi_string_get_cstr(world_data), data_size) != data_size)
-    {
-        FURI_LOG_E(HTTP_TAG, "Failed to append data to file");
-        storage_file_close(file);
-        storage_file_free(file);
-        furi_record_close(RECORD_STORAGE);
-        return false;
-    }
-
-    storage_file_close(file);
-    storage_file_free(file);
-    furi_record_close(RECORD_STORAGE);
-
-    return true;
-}
-
-bool load_world(
-    const char *name,
-    char *json_data,
-    size_t json_data_size)
-{
-    Storage *storage = furi_record_open(RECORD_STORAGE);
-    File *file = storage_file_alloc(storage);
-
-    char file_path[256];
-    snprintf(file_path, sizeof(file_path), STORAGE_EXT_PATH_PREFIX "/apps_data/flip_world/worlds/%s.json", name);
-
-    // Open the file for reading
-    if (!storage_file_open(file, file_path, FSAM_READ, FSOM_OPEN_EXISTING))
-    {
-        storage_file_free(file);
-        furi_record_close(RECORD_STORAGE);
-        return NULL; // Return false if the file does not exist
-    }
-
-    // Read data into the buffer
-    size_t read_count = storage_file_read(file, json_data, json_data_size);
-    if (storage_file_get_error(file) != FSE_OK)
-    {
-        FURI_LOG_E(HTTP_TAG, "Error reading from file.");
-        storage_file_close(file);
-        storage_file_free(file);
-        furi_record_close(RECORD_STORAGE);
-        return false;
-    }
-
-    // Ensure null-termination
-    json_data[read_count - 1] = '\0';
-
-    storage_file_close(file);
-    storage_file_free(file);
-    furi_record_close(RECORD_STORAGE);
-
-    return true;
-}
-
 FuriString *load_furi_world(
     const char *name)
 {

+ 0 - 11
flip_storage/storage.h

@@ -30,17 +30,6 @@ bool load_char(
     char *value,
     size_t value_size);
 
-bool save_world(
-    const char *name,
-    const char *world_data);
-
-bool save_world_furi(FuriString *name, FuriString *world_data);
-
-bool load_world(
-    const char *name,
-    char *json_data,
-    size_t json_data_size);
-
 FuriString *load_furi_world(
     const char *name);
 

+ 0 - 15
game/draw.c

@@ -87,21 +87,6 @@ void draw_icon_line(Canvas *canvas, Vector pos, int amount, bool horizontal, con
         }
     }
 }
-// Draw a half section of icons (16 width)
-void draw_icon_half_world(Canvas *canvas, bool right, const Icon *icon)
-{
-    for (int i = 0; i < 10; i++)
-    {
-        if (right)
-        {
-            draw_icon_line(canvas, (Vector){WORLD_WIDTH / 2 + 6, i * 19 + 2}, 11, true, icon);
-        }
-        else
-        {
-            draw_icon_line(canvas, (Vector){0, i * 19 + 2}, 11, true, icon);
-        }
-    }
-}
 char g_temp_spawn_name[32];
 // Draw an icon at a specific position (with collision detection)
 void spawn_icon(Level *level, const char *icon_id, float x, float y)

+ 0 - 1
game/draw.h

@@ -9,7 +9,6 @@ void draw_background(Canvas *canvas, Vector pos);
 void draw_user_stats(Canvas *canvas, Vector pos, GameManager *manager);
 void draw_username(Canvas *canvas, Vector pos, char *username);
 void draw_icon_line(Canvas *canvas, Vector pos, int amount, bool horizontal, const Icon *icon);
-void draw_icon_half_world(Canvas *canvas, bool right, const Icon *icon);
 void spawn_icon(Level *level, const char *icon_id, float x, float y);
 void spawn_icon_line(Level *level, const char *icon_id, float x, float y, uint8_t amount, bool horizontal);
 extern char g_temp_spawn_name[32];

+ 0 - 73
game/enemy.c

@@ -571,79 +571,6 @@ const EntityDescription *enemy(
     return &_generic_enemy;
 }
 
-void spawn_enemy_json(Level *level, GameManager *manager, char *json)
-{
-    if (!level)
-    {
-        FURI_LOG_E("Game", "Level is NULL");
-        return;
-    }
-    if (!json)
-    {
-        FURI_LOG_E("Game", "JSON is NULL");
-        return;
-    }
-    if (!manager)
-    {
-        FURI_LOG_E("Game", "GameManager is NULL");
-        return;
-    }
-    char *id = get_json_value("id", json);
-    char *_index = get_json_value("index", json);
-    //
-    char *start_position = get_json_value("start_position", json);
-    char *start_position_x = get_json_value("x", start_position);
-    char *start_position_y = get_json_value("y", start_position);
-    //
-    char *end_position = get_json_value("end_position", json);
-    char *end_position_x = get_json_value("x", end_position);
-    char *end_position_y = get_json_value("y", end_position);
-    //
-    char *move_timer = get_json_value("move_timer", json);
-    char *speed = get_json_value("speed", json);
-    char *attack_timer = get_json_value("attack_timer", json);
-    char *strength = get_json_value("strength", json);
-    char *health = get_json_value("health", json);
-    //
-
-    if (!id || !_index || !start_position || !start_position_x || !start_position_y || !end_position || !end_position_x || !end_position_y || !move_timer || !speed || !attack_timer || !strength || !health)
-    {
-        FURI_LOG_E("Game", "Failed to parse JSON values");
-        return;
-    }
-
-    GameContext *game_context = game_manager_game_context_get(manager);
-    if (game_context && game_context->enemy_count < MAX_ENEMIES && !game_context->enemies[game_context->enemy_count])
-    {
-        game_context->enemies[game_context->enemy_count] = level_add_entity(level, enemy(
-                                                                                       manager,
-                                                                                       id,
-                                                                                       atoi(_index),
-                                                                                       (Vector){strtod(start_position_x, NULL), strtod(start_position_y, NULL)},
-                                                                                       (Vector){strtod(end_position_x, NULL), strtod(end_position_y, NULL)},
-                                                                                       strtod(move_timer, NULL),
-                                                                                       strtod(speed, NULL),
-                                                                                       strtod(attack_timer, NULL),
-                                                                                       strtod(strength, NULL),
-                                                                                       strtod(health, NULL)));
-        game_context->enemy_count++;
-    }
-
-    free(id);
-    free(_index);
-    free(start_position);
-    free(start_position_x);
-    free(start_position_y);
-    free(end_position);
-    free(end_position_x);
-    free(end_position_y);
-    free(move_timer);
-    free(speed);
-    free(attack_timer);
-    free(strength);
-    free(health);
-}
-
 void spawn_enemy_json_furi(Level *level, GameManager *manager, FuriString *json)
 {
     if (!level)

+ 0 - 1
game/enemy.h

@@ -55,5 +55,4 @@ const EntityDescription *enemy(
     float strength,
     float health);
 
-void spawn_enemy_json(Level *level, GameManager *manager, char *json);
 void spawn_enemy_json_furi(Level *level, GameManager *manager, FuriString *json);

+ 0 - 133
game/icon.c

@@ -262,139 +262,6 @@ IconContext *get_icon_context(const char *name)
     return NULL;
 }
 
-IconContext *get_icon_context_furi(const FuriString *name)
-{
-    if (furi_string_cmp(name, "earth") == 0)
-    {
-        return icon_generic_alloc("earth", &I_icon_earth_15x16, 15, 16);
-    }
-    else if (furi_string_cmp(name, "home") == 0)
-    {
-        return icon_generic_alloc("home", &I_icon_home_15x16, 15, 16);
-    }
-    else if (furi_string_cmp(name, "house") == 0)
-    {
-        return icon_generic_alloc("house", &I_icon_house_48x32px, 48, 32);
-    }
-    else if (furi_string_cmp(name, "house_3d") == 0)
-    {
-        return icon_generic_alloc("house_3d", &I_icon_house_3d_34x45px, 34, 45);
-    }
-    else if (furi_string_cmp(name, "info") == 0)
-    {
-        return icon_generic_alloc("info", &I_icon_info_15x16, 15, 16);
-    }
-    else if (furi_string_cmp(name, "man") == 0)
-    {
-        return icon_generic_alloc("man", &I_icon_man_7x16, 7, 16);
-    }
-    else if (furi_string_cmp(name, "plant") == 0)
-    {
-        return icon_generic_alloc("plant", &I_icon_plant_16x16, 16, 16);
-    }
-    else if (furi_string_cmp(name, "plant_fern") == 0)
-    {
-        return icon_generic_alloc("plant_fern", &I_icon_plant_fern_18x16px, 18, 16);
-    }
-    else if (furi_string_cmp(name, "plant_pointy") == 0)
-    {
-        return icon_generic_alloc("plant_pointy", &I_icon_plant_pointy_13x16px, 13, 16);
-    }
-    else if (furi_string_cmp(name, "tree") == 0)
-    {
-        return icon_generic_alloc("tree", &I_icon_tree_16x16, 16, 16);
-    }
-    else if (furi_string_cmp(name, "tree_29x30") == 0)
-    {
-        return icon_generic_alloc("tree_29x30", &I_icon_tree_29x30px, 29, 30);
-    }
-    else if (furi_string_cmp(name, "tree_48x48") == 0)
-    {
-        return icon_generic_alloc("tree_48x48", &I_icon_tree_48x48px, 48, 48);
-    }
-    else if (furi_string_cmp(name, "woman") == 0)
-    {
-        return icon_generic_alloc("woman", &I_icon_woman_9x16, 9, 16);
-    }
-    else if (furi_string_cmp(name, "chest_closed") == 0)
-    {
-        return icon_generic_alloc("chest_closed", &I_icon_chest_closed_16x13px, 16, 13);
-    }
-    else if (furi_string_cmp(name, "chest_open") == 0)
-    {
-        return icon_generic_alloc("chest_open", &I_icon_chest_open_16x16px, 16, 16);
-    }
-    else if (furi_string_cmp(name, "fence") == 0)
-    {
-        return icon_generic_alloc("fence", &I_icon_fence_16x8px, 16, 8);
-    }
-    else if (furi_string_cmp(name, "fence_end") == 0)
-    {
-        return icon_generic_alloc("fence_end", &I_icon_fence_end_16x8px, 16, 8);
-    }
-    else if (furi_string_cmp(name, "fence_vertical_end") == 0)
-    {
-        return icon_generic_alloc("fence_vertical_end", &I_icon_fence_vertical_end_6x8px, 6, 8);
-    }
-    else if (furi_string_cmp(name, "fence_vertical_start") == 0)
-    {
-        return icon_generic_alloc("fence_vertical_start", &I_icon_fence_vertical_start_6x15px, 6, 15);
-    }
-    else if (furi_string_cmp(name, "flower") == 0)
-    {
-        return icon_generic_alloc("flower", &I_icon_flower_16x16, 16, 16);
-    }
-    else if (furi_string_cmp(name, "lake_bottom") == 0)
-    {
-        return icon_generic_alloc("lake_bottom", &I_icon_lake_bottom_31x12px, 31, 12);
-    }
-    else if (furi_string_cmp(name, "lake_bottom_left") == 0)
-    {
-        return icon_generic_alloc("lake_bottom_left", &I_icon_lake_bottom_left_24x22px, 24, 22);
-    }
-    else if (furi_string_cmp(name, "lake_bottom_right") == 0)
-    {
-        return icon_generic_alloc("lake_bottom_right", &I_icon_lake_bottom_right_24x22px, 24, 22);
-    }
-    else if (furi_string_cmp(name, "lake_left") == 0)
-    {
-        return icon_generic_alloc("lake_left", &I_icon_lake_left_11x31px, 11, 31);
-    }
-    else if (furi_string_cmp(name, "lake_right") == 0)
-    {
-        // Assuming dimensions 11x31
-        return icon_generic_alloc("lake_right", &I_icon_lake_right_11x31, 11, 31);
-    }
-    else if (furi_string_cmp(name, "lake_top") == 0)
-    {
-        return icon_generic_alloc("lake_top", &I_icon_lake_top_31x12px, 31, 12);
-    }
-    else if (furi_string_cmp(name, "lake_top_left") == 0)
-    {
-        return icon_generic_alloc("lake_top_left", &I_icon_lake_top_left_24x22px, 24, 22);
-    }
-    else if (furi_string_cmp(name, "lake_top_right") == 0)
-    {
-        return icon_generic_alloc("lake_top_right", &I_icon_lake_top_right_24x22px, 24, 22);
-    }
-    else if (furi_string_cmp(name, "rock_large") == 0)
-    {
-        return icon_generic_alloc("rock_large", &I_icon_rock_large_18x19px, 18, 19);
-    }
-    else if (furi_string_cmp(name, "rock_medium") == 0)
-    {
-        return icon_generic_alloc("rock_medium", &I_icon_rock_medium_16x14px, 16, 14);
-    }
-    else if (furi_string_cmp(name, "rock_small") == 0)
-    {
-        return icon_generic_alloc("rock_small", &I_icon_rock_small_10x8px, 10, 8);
-    }
-
-    // If no match is found
-    FURI_LOG_E("Game", "Icon not found: %s", furi_string_get_cstr(name));
-    return NULL;
-}
-
 const char *icon_get_id(const Icon *icon)
 {
     if (icon == &I_icon_earth_15x16)

+ 0 - 1
game/icon.h

@@ -12,5 +12,4 @@ typedef struct
 
 extern const EntityDescription icon_desc;
 IconContext *get_icon_context(const char *name);
-IconContext *get_icon_context_furi(const FuriString *name);
 const char *icon_get_id(const Icon *icon);

+ 0 - 24
game/player.c

@@ -276,28 +276,4 @@ SpriteContext *get_sprite_context(const char *name)
     // If no match is found
     FURI_LOG_E("Game", "Sprite not found: %s", name);
     return NULL;
-}
-
-SpriteContext *get_sprite_context_furi(const FuriString *name)
-{
-    if (furi_string_cmp(name, "axe") == 0)
-    {
-        return sprite_generic_alloc("axe", 15, 11);
-    }
-    else if (furi_string_cmp(name, "bow") == 0)
-    {
-        return sprite_generic_alloc("bow", 13, 11);
-    }
-    else if (furi_string_cmp(name, "naked") == 0)
-    {
-        return sprite_generic_alloc("naked", 10, 10);
-    }
-    else if (furi_string_cmp(name, "sword") == 0)
-    {
-        return sprite_generic_alloc("sword", 15, 11);
-    }
-
-    // If no match is found
-    FURI_LOG_E("Game", "Sprite not found: %s", furi_string_get_cstr(name));
-    return NULL;
 }

+ 0 - 4
game/player.h

@@ -3,9 +3,6 @@
 #include <flip_world.h>
 #include <game/game.h>
 
-#define PLAYER_COLLISION_VERTICAL 0   // was 5
-#define PLAYER_COLLISION_HORIZONTAL 0 // was 5
-
 // Maximum enemies
 #define MAX_ENEMIES 10
 
@@ -72,4 +69,3 @@ typedef struct
 extern const EntityDescription player_desc;
 void player_spawn(Level *level, GameManager *manager);
 SpriteContext *get_sprite_context(const char *name);
-SpriteContext *get_sprite_context_furi(const FuriString *name);

+ 0 - 9
game/storage.c

@@ -1,13 +1,4 @@
 #include <game/storage.h>
-#include <stdio.h>
-#include <furi.h>
-#include <furi_hal.h>
-#include <stdint.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
 
 bool save_uint32(const char *path_name, uint32_t value)
 {

+ 0 - 130
game/world.c

@@ -8,77 +8,6 @@ void draw_bounds(Canvas *canvas)
     canvas_draw_frame(canvas, -camera_x, -camera_y, WORLD_WIDTH, WORLD_HEIGHT);
 }
 
-bool draw_json_world(Level *level, const char *json_data)
-{
-    int levels_added = 0;
-    for (int i = 0; i < MAX_WORLD_OBJECTS; i++)
-    {
-        char *data = get_json_array_value("json_data", i, json_data);
-        if (!data)
-        {
-            break;
-        }
-
-        char *icon = get_json_value("icon", data);
-        char *x = get_json_value("x", data);
-        char *y = get_json_value("y", data);
-        char *amount = get_json_value("amount", data);
-        char *horizontal = get_json_value("horizontal", data);
-
-        if (!icon || !x || !y || !amount || !horizontal)
-        {
-            FURI_LOG_E("Game", "Failed Data: %s", data);
-
-            // Free everything carefully
-            if (data)
-                free(data);
-            if (icon)
-                free(icon);
-            if (x)
-                free(x);
-            if (y)
-                free(y);
-            if (amount)
-                free(amount);
-            if (horizontal)
-                free(horizontal);
-
-            level_clear(level);
-            return false;
-        }
-
-        int count = atoi(amount);
-        if (count < 2)
-        {
-            // Just one icon
-            spawn_icon(
-                level,
-                icon,
-                atoi(x),
-                atoi(y));
-        }
-        else
-        {
-            bool is_horizontal = (strcmp(horizontal, "true") == 0);
-            spawn_icon_line(
-                level,
-                icon,
-                atoi(x),
-                atoi(y),
-                count,
-                is_horizontal);
-        }
-        free(data);
-        free(icon);
-        free(x);
-        free(y);
-        free(amount);
-        free(horizontal);
-        levels_added++;
-    }
-    return levels_added > 0;
-}
-
 bool draw_json_world_furi(Level *level, const FuriString *json_data)
 {
     if (!json_data)
@@ -158,65 +87,6 @@ bool draw_json_world_furi(Level *level, const FuriString *json_data)
     return levels_added > 0;
 }
 
-void draw_tree_world(Level *level)
-{
-    // Spawn two full left/up tree lines
-    for (int i = 0; i < 2; i++)
-    {
-        // Horizontal line of 22 icons
-        spawn_icon_line(level, "tree", 5, 2 + i * 17, 22, true);
-        // Vertical line of 11 icons
-        spawn_icon_line(level, "tree", 5 + i * 17, 2, 11, false);
-    }
-
-    // Spawn two full down tree lines
-    for (int i = 9; i < 11; i++)
-    {
-        // Horizontal line of 22 icons
-        spawn_icon_line(level, "tree", 5, 2 + i * 17, 22, true);
-    }
-
-    // Spawn two full right tree lines
-    for (int i = 20; i < 22; i++)
-    {
-        // Vertical line of 8 icons starting further down (y=50)
-        spawn_icon_line(level, "tree", 5 + i * 17, 50, 8, false);
-    }
-
-    // Labyrinth lines
-    // Third line (14 left, then a gap, then 3 middle)
-    spawn_icon_line(level, "tree", 5, 2 + 2 * 17, 14, true);
-    spawn_icon_line(level, "tree", 5 + 16 * 17, 2 + 2 * 17, 3, true);
-
-    // Fourth line (3 left, 6 middle, 4 right)
-    spawn_icon_line(level, "tree", 5, 2 + 3 * 17, 3, true);           // 3 left
-    spawn_icon_line(level, "tree", 5 + 7 * 17, 2 + 3 * 17, 6, true);  // 6 middle
-    spawn_icon_line(level, "tree", 5 + 15 * 17, 2 + 3 * 17, 4, true); // 4 right
-
-    // Fifth line (6 left, 7 middle)
-    spawn_icon_line(level, "tree", 5, 2 + 4 * 17, 6, true);
-    spawn_icon_line(level, "tree", 5 + 7 * 17, 2 + 4 * 17, 7, true);
-
-    // Sixth line (5 left, 3 middle, 7 right)
-    spawn_icon_line(level, "tree", 5, 2 + 5 * 17, 5, true);           // 5 left
-    spawn_icon_line(level, "tree", 5 + 7 * 17, 2 + 5 * 17, 3, true);  // 3 middle
-    spawn_icon_line(level, "tree", 5 + 15 * 17, 2 + 5 * 17, 7, true); // 7 right
-
-    // Seventh line (0 left, 7 middle, 4 right)
-    spawn_icon_line(level, "tree", 5 + 6 * 17, 2 + 6 * 17, 7, true);  // 7 middle
-    spawn_icon_line(level, "tree", 5 + 14 * 17, 2 + 6 * 17, 4, true); // 4 right
-
-    // Eighth line (4 left, 3 middle, 4 right)
-    spawn_icon_line(level, "tree", 5, 2 + 7 * 17, 4, true);           // 4 left
-    spawn_icon_line(level, "tree", 5 + 7 * 17, 2 + 7 * 17, 3, true);  // 3 middle
-    spawn_icon_line(level, "tree", 5 + 15 * 17, 2 + 7 * 17, 4, true); // 4 right
-
-    // Ninth line (3 left, 1 middle, 3 right)
-    spawn_icon_line(level, "tree", 5, 2 + 8 * 17, 3, true);           // 3 left
-    spawn_icon_line(level, "tree", 5 + 5 * 17, 2 + 8 * 17, 1, true);  // 1 middle
-    spawn_icon_line(level, "tree", 5 + 11 * 17, 2 + 8 * 17, 3, true); // 3 right
-}
-
 void draw_town_world(Level *level)
 {
 

+ 0 - 2
game/world.h

@@ -12,8 +12,6 @@
 #define MAX_WORLD_OBJECTS 25 // any more than that and we may run out of heap when switching worlds
 
 void draw_bounds(Canvas *canvas);
-void draw_tree_world(Level *level);
 void draw_town_world(Level *level);
-bool draw_json_world(Level *level, const char *json_data);
 bool draw_json_world_furi(Level *level, const FuriString *json_data);
 FuriString *fetch_world(const char *name);