-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Barony next user data #86
Barony next user data #86
Conversation
I tried merging, but I got errors:
It looks like somebody changed the parameters lists for Also, shouldn't the header files have a header? Also also, I noticed multiple violations of the coding style guidelines, such as:
and
|
I'll take a look at it this weekend hopefully. |
Ok. I think I'm going to put off merging the PR until I can test it on a Mac again, when I get back home in August. |
Since they are inlined, their implementation needs to be included in every source file that uses them, otherwise it will go missing entirely and fail to link.
cppfuncs.hpp:getLinesFromFile → files.cpp:getLinesFromDataFile Also rewrite most of its implementation to provide useful errors when the file cannot be opened.
- Add the openUserFile function, analogous to openDataFile, which opens files containing user data, i.e. config, saves and scores. - Make the default location for user files $XDG_CONFIG_HOME/barony or $HOME/.config/barony if those variables are found. This should probably be replaced with behaviour more suitable for OSX ($HOME/Library/Application Support/barony?) and windows (%APPDATA%/barony?) - Add -userdir= option which allows overriding the aforementioned behaviour - Add setUserDir and setDataDir to the files module, so the knowledge of the static storage for these paths can be limited to files.cpp. Correspondingly, - Remove public datadir variable
Also sort them! Yay!
Move all openal/FMOD-specific functionality into src/sound_{fmod,openal}.cpp. Now everything else should depend on the common backend-agnostic interface provided in sound.hpp and the backend is determined purely by linkage.
227f30f
to
806eafa
Compare
Rebased, so it should merge cleanly now. I've also added some other niceties. |
What? |
and add -Werror=write-strings so they won't be reintroduced!
E.g.:
|
Aah, right. Will add. |
Done! |
Awesome. I'll pop open the Mac this weekend and do that last (hopefully) testing run, finally :) |
I'll test it on a Mac too, probably before this weekend — just need to reinstall macOS on it which is a bit of a bootstrap problem, because apparently you can't make an installer USB without a macOS installation -_-
|
typo wasintroduced in f7d96cd
Ah, good catch.
Oh? What's the issue? |
The usual when working OSX/Windows… not having a package manager to sort out all the dependencies for me. |
This reverts commit c9d8248.
This allows fixing sound_null to enable the game (although it will be broken in a few ways, particularly when it comes to ranged weapons. These should probably rely on time values rather than sound effects.).
cc8c83b
to
662bed6
Compare
There, now this PR has a negative net lines-of-code balance and the game builds with sound_null :) Still haven't built it on windows though. |
When building the editor (with OpenAL):
|
Error also occurs with FMOD, but works fine with sound null. |
This allows the editor to link successfully without having sound_common.cpp (which would introduce a dependency on net.cpp). This results in a little duplication — setting levelmusicplaying = false on every in-game map load — which is not ideal, but still IMHO better than making loadMap care so much about where it's called from. I hope to improve this more later on.
That should fix it. |
Any further issues? |
I will review it this weekend. |
FMOD and sound_null build now. OpenAL should probably be changed to the default sound library instead of FMOD. Will text under Windows and Mac later this weekend. |
Found an issue with FMOD: When I start up the game and enter a new level, the level music doesn't start playing. Rather, the main menu's music drops to very low volume and keeps playing. Then when I back out to the main menu, the main menus music keeps playing (very quietly), although barely slightly louder. Then when I try to start a new game again, the main menu music starts blasting back at full volume. |
@lheckemann Have you had a chance to look into the FMOD issue? |
Just got back from a trip to Munich for a conference so I haven't had the time. I should get around to it this weekend though. Very strange problem though, not sure how far I'll get especially considering how cooperative FMOD has been in the past :/ |
Ah, I see. Thanks. |
This has become pretty much unworkable. I'll split it into smaller changes and PR them separately eventually. |
Same as #85 but for barony-next, I've resolved all the conflicts.