cxong / cdogs-sdl

Classic overhead run-and-gun game
https://cxong.github.io/cdogs-sdl/
GNU General Public License v2.0
891 stars 114 forks source link

MOD music not playing in Windows #389

Closed cxong closed 8 years ago

cxong commented 8 years ago

The problem was that SDL2 mixer includes different DLLs; it uses libmodplug instead of libmikmod, and I didn't include the DLL in the windows build. They can be downloaded from https://www.libsdl.org/projects/SDL_mixer/

ghost commented 8 years ago

@cxong I should have mentioned I tested it on Ubuntu (libmodplug is pulled as dependency automatically) using the precompiled packages.

I tried to run sudo make install but there is no rule for install.

Is C-Dogs supposed to be installed otherwise?

EDIT: I also forgot to mention: There are other problems, apparently I can't start levels into the editor by drag and drop, but it works by command line.

cxong commented 8 years ago

I'm afraid I can't reproduce either of those problems. On my linux VM (mint 17.3) both functions work.

Have you tried installing from an ubuntu repo, e.g. playdeb?

ghost commented 8 years ago

@cxong Not yet, but at the moment I'm back at my Windows environment, so it might take a while until I get to test the package.

BTW: I sent you an extended version of Space Pirates to your GMail account.

ghost commented 8 years ago

@cxong I cloned the repository and compiled it using

cmake . make sudo make install

Now, when I start the installed executable, I get

INFO  [MAIN ] [files.c:605] SetupConfigDir(): Creating config dir /home/clemens/.config/cdogs-sdl/... 
INFO  [MAIN ] [files.c:610] SetupConfigDir(): Config dir already exists.
internal error: cannot create temp file /home/clemens/../doc/CREDITS
Internal error: cannot delete temp file /home/clemens/../doc/CREDITS
Cannot resolve relative path /home/clemens/../doc/CREDITS: No such file or directory
INFO  [MAIN ] [cdogs.c:253] main(): Command line (1 args): cdogs-sdl
INFO  [MAIN ] [cdogs.c:388] main(): data dir(/home)
INFO  [MAIN ] [cdogs.c:389] main(): config dir(/home/clemens/.config/cdogs-sdl/)
internal error: cannot create temp file /home/clemens/../sounds
Internal error: cannot delete temp file /home/clemens/../sounds
Cannot resolve relative path /home/clemens/../sounds: No such file or directory
ERROR [MAIN ] [sounds.c:165] SoundLoadDirImpl(): Cannot open sound dir '/home/clemens/../sounds'
internal error: cannot create temp file /home/clemens/../data/gamecontrollerdb.txt
Internal error: cannot delete temp file /home/clemens/../data/gamecontrollerdb.txt
Cannot resolve relative path /home/clemens/../data/gamecontrollerdb.txt: No such file or directory
ERROR [INPUT] [joystick.c:47] JoyInit(): cannot load controller mappings file: Invalid RWops
internal error: cannot create temp file /home/clemens/../data/gamecontrollerbuttondb.txt
Internal error: cannot delete temp file /home/clemens/../data/gamecontrollerbuttondb.txt
Cannot resolve relative path /home/clemens/../data/gamecontrollerbuttondb.txt: No such file or directory

And then I get a core dump.

However, when starting from the original repository directory that doesn't happen. Custom music even works.

cxong commented 8 years ago

I've been running into lots of error messages under linux, will need to look into it. However the game still manages to run.

From your logs, this line is a problem: INFO [MAIN ] [cdogs.c:388] main(): data dir(/home)

Obviously, data dir shouldn't be that; it should be the directory that has data folders as children, e.g. missions, sounds, graphics etc.

I think the reason is that CDOGS_DATA_DIR is being set to .., which allows the program to run in-source, i.e. when the game data and executable are together. However if you are doing make install, you should set CDOGS_DATA_DIR to something else e.g. /usr/share/games/cdogs-sdl; I'm not sure of the exact location but package managers should be doing so.

But you can run make and run src/cdogs-sdl, that should still work.

ghost commented 8 years ago

Thanks for looking into it. Guess I'll just use the src/cdogs-sdl version, to test new things/bug fixes in the repository.

BTW: I sent you two versions of the space pirate campaign and I'll need your feedback to continue working on it.

Am 30.03.2016 um 01:26 schrieb Cong:

I've been running into lots of error messages under linux, will need to look into it. However the game still manages to run.

From your logs, this line is a problem: |INFO [MAIN ] [cdogs.c:388] main(): data dir(/home)|

Obviously, data dir shouldn't be that; it should be the directory that has data folders as children, e.g. |missions|, |sounds|, |graphics| etc.

I think the reason is that |CDOGS_DATA_DIR| is being set to |..|, which allows the program to run in-source, i.e. when the game data and executable are together. However if you are doing |make install|, you should set |CDOGS_DATA_DIR| to something else e.g. |/usr/share/games/cdogs-sdl|; I'm not sure of the exact location but package managers should be doing so.

But you can run |make| and run |src/cdogs-sdl|, that should still work.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/cxong/cdogs-sdl/issues/389#issuecomment-203155840