diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2025-04-16 15:22:40 +1200 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2025-04-16 15:22:40 +1200 |
commit | b3455e502f4491af22e190a14aba9565f534bb59 (patch) | |
tree | 23b823b177e8639fb5d42e17311bdc2d70a016b2 /src/misc.ads | |
parent | e62c2e2403d072640f0400c499f1dfd99e938c16 (diff) |
Sokoban can now find itself to find shared data after install
Diffstat (limited to 'src/misc.ads')
-rw-r--r-- | src/misc.ads | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/misc.ads b/src/misc.ads index fb99d95..ad64b46 100644 --- a/src/misc.ads +++ b/src/misc.ads @@ -1,22 +1,21 @@ -with +private with - Ada.Command_Line, - Ada.Directories; + Ada.Directories, + Here_I_Am; package Misc is - Origin : constant String; + Origin, Image_Path, Level_Path : constant String; function Max (A, B : in Integer) return Integer; - function Min (A, B : in Integer) return Integer; @@ -25,9 +24,24 @@ package Misc is private - Origin : constant String := Ada.Directories.Containing_Directory - (Ada.Directories.Full_Name (Ada.Command_Line.Command_Name)); + package ADir renames Ada.Directories; + + + Origin : constant String := ADir.Containing_Directory (Here_I_Am.Executable); + + Image_Path : constant String := + ADir.Compose + (ADir.Compose + (ADir.Compose + (ADir.Compose (Origin, ".."), "share"), "sokoban"), "img"); + + Level_Path : constant String := + ADir.Compose + (ADir.Compose + (ADir.Compose + (ADir.Compose (Origin, ".."), "share"), "sokoban"), "level"); end Misc; + |