I'm having a problem with MyImage.LoadFromFile function. There are two variants of the code:
variant 1:MyImage.LoadFromFile('help.jpg');
variant 2:MyImage.LoadFromFile('/home/eugene/HELENA-130606-1/help.jpg');
('/home/eugene/HELENA-130606-1/' is a project folder, containing help.jpg file)
Both variants work perfectly when game is launched from the Lazarus GUI (debugged). BUT when I launch a pre-compiled game, variant 1 replies "unable to open file help.jpg", while variant 2 works as intended. By trial and error I've found that variant 1 looks for '/home/eugene/help.jpg' which is my home folder (when I copy the file there it works fine).
I use Lazarus 1.0.8 and Debian Squeeze.
I want that the game to be folder-independent (i.e. use the variant 1) and requiring only that help.jpg would be in the same folder with the compiled game... How can I set the working folder to the compiled file folder?
The complete source&game (if that helps...):
https://sourceforge.net/projects/projecthelena/