Default value should be current folder, and the make install should set the value.
(you can do something like install(code "[cmake code]") with cmake I think)
Edward_Lii {l Wrote}:I think this is the best solution so far.
The config file should be placed inside the ~/.meandmyshadow/ folder, maybe it can contain more settings like sound enabled?
Edward_Lii {l Wrote}:...
And I think it should be able to changes this with a parameter, something like this:
- {l Code}: {l Select All Code}
meandmyshadow --data-dir /usr/share/meandmyshadow
acme_pjz {l Wrote}:I think so, and it contains sound options, and so on ... (As for screen resolution, I have no idea )
But a big problem is if we put the path of the data folder in the config file, then every user should have the config file created during installing, or when a new user is created and plays meansmyshadow then the game can't get data folder from config file correctly ...
MCMic {l Wrote}:I think you should look what others project do. Probably a lot are easy to install and run with the datas in the right place.
...
if ( getenv ( "SUPERTUXKART_DATADIR" ) != NULL )
m_root_dir= getenv ( "SUPERTUXKART_DATADIR" ) ;
#ifdef __APPLE__
else if( macSetBundlePathIfRelevant( m_root_dir ) ) { /* nothing to do */ }
#endif
else if(m_file_system->existFile("data/stk_config.xml"))
m_root_dir = "." ;
else if(m_file_system->existFile("../data/stk_config.xml"))
m_root_dir = ".." ;
else if(m_file_system->existFile(exe_path+"/data/stk_config.xml"))
m_root_dir = exe_path.c_str();
else if(m_file_system->existFile(exe_path+"/../data/stk_config.xml"))
{
m_root_dir = exe_path.c_str();
m_root_dir += "/..";
}
else
#ifdef SUPERTUXKART_DATADIR
m_root_dir = SUPERTUXKART_DATADIR ;
#else
m_root_dir = "/usr/local/share/games/supertuxkart" ;
#endif
...
Edward_Lii {l Wrote}:...
I looked how SuperTuxKart did it and it's quite similar to what acme_pjz has built in:
...
Basically it tries several directories and some additional things(, environment variable).
Edward_Lii {l Wrote}:I think it's best if we remove the 0.1.1 release and release a 0.1.2 release.
I'll upload the .desktop file and the icon after that I'll try to package it again.
acme_pjz {l Wrote}:Haha, the code I modified is exactly inspired by SuperTuxKart's code
acme_pjz {l Wrote}:I think this time we should make sure there's no bad bug before a new release
music = Mix_LoadMUS((GetDataPath()+"data/sfx/music.mid").c_str());
acme_pjz {l Wrote}:BTW, due to the bad network speed of SourceForge, I can't upload the Windows binary to SourceForge directly Maybe I upload the binary to forum first?
Edward_Lii {l Wrote}:I somehow can't get it to run under Linux, compiling goes well, but it quits with "FATAL ERROR: Failed to load necessary files".
It can find the data path without problem and the loading of the resources goes well except the music.
This line causes the problem: (didn't even know there was background music! )
- {l Code}: {l Select All Code}
music = Mix_LoadMUS((GetDataPath()+"data/sfx/music.mid").c_str());
I'm afraid this could cause problems on more Linux systems, maybe we should throw a warning when loading the background music fails?
acme_pjz {l Wrote}:After checking the file names I found that the source code writes "music.mid" but the actual file name is "Music.mid", and because the file name is case-sensitive under Linux so the game will refused to run under Linux ... I checked the SVN and thought that it's an old mistale ... so either change the file name to "music.mid" or change the source code to "Music.mid" ...
Edward_Lii {l Wrote}:I changed the file to music.mid since most file names are lowercase in M&MS so why not the music file?
Somehow it still doesn't work, I assume this is a problem with my setup, maybe wrong version of SDL_mixer?
acme_pjz {l Wrote}:Because I changed the file name in source code to "Music.mid" in previous revision So the source code should be changed back to "music.mid" ...
MCMic {l Wrote}:#0 0x08083d8f in POASerializer::ReadNode (this=0xbfffe27c, fin=..., objOut=0xbfffe238, bLoadSubNodeOnly=true) at /home/mcmic/dev/meandmyshadow/src/POASerializer.cpp:110
This is still an infinite loop for me.
Users browsing this forum: No registered users and 1 guest