Skip to content
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

Make it so CMake now grabs the latest dr_wav version instead of 0.8.1 #105

Open
wants to merge 3 commits into
base: standalone
Choose a base branch
from

Conversation

hourai-dev
Copy link

I made it so CMake now grabs the latest dr_wav version instead of 0.8.1, and changed sound.c so it is now compatible with the new API introduced in 0.9.0. This shouldn't not be a problem unless the API changes again. I tested it with the latest version and it works correctly. Is there any specific reason as to why it uses dr_wav 0.8.1?
Also, I am running Fedora 32 with GCC version 10.0.1 (Red Hat 10.0.1-0.11), GNU make version 4.2.1 and cmake version 3.17.2, and I ran into an error when building the project. When building utils.c, the build terminates with "unknown type name 'size_t'". I simply just made it so that utils.h includes stddef.h (which includes the definition for size_t), which fixes the errors and makes it so that the project builds fine.

Added a soundtest feature. It can be enabled by defining
ENABLE_SOUNDTEST when running cmake. For example:
'cmake .. -DENABLE_SOUNDTEST=1'
A new entry will appear in settings and it can be used to access the
soundtest menu. The number represents the sound id, and you can change
the current sound using the arrows. Clicking on 'play' plays the
selected sound. This feature is useful when testing if all sounds are
read, loaded and played correctly, specially useful for checking if
dr_wav works correctly after an update. It also prints the name of the
sound to the console when it plays.
At the time of this commit, there are currently 40 sounds in total
loaded and used by BetterSpades.
If more sounds are added, the soundtest.c file must be modified to add
new entries. Perhaps this could be improved in the future to allow
automatic detection/loading of sounds, without having to manually add
entries to the soundtest.c file.
@hourai-dev
Copy link
Author

I implemented a new soundtest feature in the latest commit. It can be enabled by defining ENABLE_SOUNDTEST when running cmake, for example:
cmake .. -DENABLE_SOUNDTEST=1
If enabled, the feature will appear in the settings screen. I used this soundtest feature to test all the sound files extensively with the latest version of dr_wav (currently v0.12.3) grabbed by cmake. All the sounds load and play correctly. The soundtest feature will be handy whenever there is a major change to dr_wav, so it can be tested easily.
I amended the latest commit and had to force push because of an important typo, I hope that doesn't become a problem in case this PR gets merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant