Cannot run Linux build - Potential fixes
After applying the fixes I described in #113, there seems to be an error with the FILEPATH variable appearing in main.cpp.
The Linux build fails to boot and the console outputs an error message, an excerpt of which is shown below:
ERROR::initGraphics - could not open '/home/$USER/$DIR/rockbot//fonts/pressstart2p.ttf' font. This made me think that there's something wrong with either the FILEPATH or the GAMEPATH variables in main.cpp.
I made the following change and it seems to work:
- in main.cpp, line 263 of the 9337229 commit, instead of
FILEPATH += "/";, I changed it toFILEPATH += "/build/";
However, this change works only for Rockbot 1. By choosing Rockboot2 in the Select Game menu, I received the following error messages (excerpt):
DEBUG.SDLSurfaceFromFile - Error in graphicsLib::SDLSurfaceFromFile - file '/home/$USER/$DIR/rockbot/build/games/Rockbot2/images/tilesets/anim/lab_lava.png' not found and
surfaceFromFile - error loading file: '/home/$USER/$DIR/rockbot/build//games/Rockbot2/images/tilesets/anim/lab_lava.png'
The first line seems "fine".
The second line, however, includes an additional slash between build and games. I tried to fix this error by adding, in method graphicsLib::surfaceFromFile in graphicslib.cpp:
filename = StringUtils::clean_filename(filename); I don't know if this line should be in another place, but, at least for me, it seems to work.
Lastly, about the first line. It says that the file is missing, and maybe that's why Rockboot2 never boots. By running grep -rnw . -e 'lab_lava.png' where . is the root of the repository, it shows me that the only reference to this file is in ./build/games/Rockbot2/anim_block_list.dat, which is a binary file.
Is there any way to add the missing tilesets? Or, is it safe to manually remove these references from the .dat file?
Are you still having issues? I remember I did some changes and fixes for missing files, but I forgot to update the issue here - sorry about that.
@GeoVa19 try out https://github.com/protoman/rockbot/pull/144