mmatyas / supermariowar

A fan-made multiplayer Super Mario Bros. style deathmatch game
http://smwstuff.net
440 stars 74 forks source link

Level editor & World editor doesn't launch #237

Closed Thanatermesis closed 1 year ago

Thanatermesis commented 1 year ago
❯ smw-leveledit
ERROR: Empty directory.  /usr/games/data/gfx/packs/Classic/tilesets/

Binary is installed as: /usr/games/smw the missing directory is installed in: /usr/share/games/smw/gfx/packs/Classic/tilesets/ I assume the code should search for these files/data in SMW_DATADIR instead of SMW_BINDIR ?

mmatyas commented 1 year ago

Hi, for historical reasons the game is portable by default, ie. looks for the datadir next to the executable. You can use the --datadir option to set its path. This is handled by the desktop entry, but not by the executable itself at the moment.

Thanatermesis commented 1 year ago

Hi @mmatyas , I tried adding these options but gives the same error, the files are correctly installed but the binary seems to not find the correct place :thinking:

mmatyas commented 1 year ago

The command here should be smw-leveledit --datadir /usr/share/games/smw/; does this not work in your case?

Thanatermesis commented 1 year ago

Ah yes, this one does, mmh... I just created a patch for my build, maybe you want to add something similar:

--- a/src/common/MapList.cpp
+++ b/src/common/MapList.cpp
@@ -125,7 +125,7 @@ MapList::MapList(bool fWorldEditor)

     //TODO: add proper test via size
     if (maps.empty()) {
-        printf("ERROR: Empty map directory!\n");
+        printf("ERROR: Empty map directory! Try adding the --datadir parameter\n");
         throw std::runtime_error("ERROR: Empty map directory!");
     }