diff --git a/source/core.adb b/source/core.adb index 4e0b6d2..48b046c 100644 --- a/source/core.adb +++ b/source/core.adb @@ -195,18 +195,6 @@ package body core is ------------------------------------------------------------------------------------------ - function import_text (file_path : in string) return text_box_data is - this : text_box_data; - begin - this.data := ray.load_text (c_string (file_path)); - this.text := null_unbounded_string; - this.size := (0, 0); - -- - return this; - end import_text; - - ------------------------------------------------------------------------------------------ - procedure create_image (width, height : in integer) is begin global_mapshot := ray.image_colour (width * base, height * base, (0, 0, 0, 255)); diff --git a/source/core.ads b/source/core.ads index d73a504..0ff2e4c 100644 --- a/source/core.ads +++ b/source/core.ads @@ -127,7 +127,6 @@ package core is function import_sprite (file_path : in string; frames, states : in integer) return sprite; function import_font (file_path : in string; scale, space : in integer) return font; function import_song (file_path : in string) return song; - function import_text (file_path : in string) return text_box_data; procedure create_image (width, height : in integer); procedure render_image (data : in sprite; x, y, u, v, width, height : in integer); diff --git a/source/main.adb b/source/main.adb index cff91ca..e13a1b2 100644 --- a/source/main.adb +++ b/source/main.adb @@ -49,6 +49,8 @@ procedure main is game_title : sprite; game_preview : array (world.biome) of sprite; -- sand, grass, rough, snow, swamp + switch : natural := 0; + choose : world.biome := world.ash; ------------------------------------------------------------------------------------------ procedure check_move_camera_up is @@ -108,16 +110,6 @@ procedure main is ------------------------------------------------------------------------------------------ - procedure introduction is - begin - draw (game_preview (world.ash), center_x (game_preview (world.ash).width * 2), center_y (game_preview (world.ash).height * 2), factor => 2); - draw (game_title, center_x (game_title.width * 2), center_y (game_title.height * 2), factor => 2); - -- - ui.write ("[-- Please press Spacebar to continue]", 0, center_y (24), (102, 102, 102, 255)); - end introduction; - - ------------------------------------------------------------------------------------------ - procedure main_menu is begin draw (game_preview (world.ash), center_x (game_preview (world.ash).width * 2), center_y (game_preview (world.ash).height * 2), factor => 2); @@ -232,7 +224,17 @@ begin -- exit when signal_mode = signal_space; -- - introduction; + case signal_mode is + when signal_none => null; + when signal_space => null; + when others => switch := (switch + 1) mod world.biome_count; + choose := world.biome'val (switch); + end case; + -- + draw (game_preview (choose), center_x (game_preview (choose).width * 2), center_y (game_preview (choose).height * 2), factor => 2); + draw (game_title, center_x (game_title.width * 2), center_y (game_title.height * 2), factor => 2); + -- + ui.write ("[-- Please press Spacebar to continue]", 0, center_y (24), (102, 102, 102, 255)); end loop introduction_loop; main_menu_loop: loop diff --git a/source/ray.ads b/source/ray.ads index c601f41..91d2239 100644 --- a/source/ray.ads +++ b/source/ray.ads @@ -171,9 +171,8 @@ package ray is --~void ShowCursor(void); --~void HideCursor(void); --~double GetTime(void); - --~void TakeScreenshot(const char *fileName); --~void OpenURL(const char *url); - function load_text (file : in string) return access string with import => true, convention => c, external_name => "LoadFileText"; + --~function load_text (file : in string) return access string with import => true, convention => c, external_name => "LoadFileText"; --~procedure unload_file (data : in access string) with import => true, convention => c, external_name => "UnloadFileText"; --~bool SaveFileText(const char *fileName, char *text); --~FilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs); diff --git a/source/world.ads b/source/world.ads index 2e5797c..8e0b4c1 100644 --- a/source/world.ads +++ b/source/world.ads @@ -50,6 +50,8 @@ package world is ------------------------------------------------------------------------------------------ + biome_count : constant natural := biome'pos (biome'last) + 1; + tiles : core.sprite; landmarks : array (landmark_index) of core.sprite; diff --git a/sprite/grassland_preview.png b/sprite/grassland_preview.png new file mode 100644 index 0000000..c4aaacb Binary files /dev/null and b/sprite/grassland_preview.png differ diff --git a/sprite/roughland_preview.png b/sprite/roughland_preview.png new file mode 100644 index 0000000..a86160d Binary files /dev/null and b/sprite/roughland_preview.png differ diff --git a/sprite/sandland_preview.png b/sprite/sandland_preview.png new file mode 100644 index 0000000..c33b6cb Binary files /dev/null and b/sprite/sandland_preview.png differ diff --git a/sprite/snowland_preview.png b/sprite/snowland_preview.png new file mode 100644 index 0000000..8cae0d5 Binary files /dev/null and b/sprite/snowland_preview.png differ diff --git a/sprite/swampland_preview.png b/sprite/swampland_preview.png new file mode 100644 index 0000000..2e4023a Binary files /dev/null and b/sprite/swampland_preview.png differ