Wintermute Engine Forum

Wintermute Engine => WME Lite => Development => Topic started by: HCDaniel on March 05, 2014, 10:18:24 AM

Title: Using more SDL projects?
Post by: HCDaniel on March 05, 2014, 10:18:24 AM
I'm wondering why wmelite uses "separate" libraries for font rendering, image loading and audio processing, and not "SDL_ttf", "SDL_image" and "SDL_mixer".

It surely makes no sense to change the first two now, as they work fine on all platforms. I wonder whether it would make sense to have SDL_mixer as replacement for BASS, allowing packages for several Linux distributions to be built (and accepted).

Mnemonic, do you have any insights how difficult the BASS replacement might be?
Title: Re: Using more SDL projects?
Post by: Mnemonic on March 06, 2014, 06:15:43 PM
Unfortunately, I know next to nothing about SDL mixer. I will have to take a look one of those days.
Title: Re: Using more SDL projects?
Post by: HCDaniel on March 07, 2014, 10:55:47 AM
Ok, I'll look into it and see if I can get it to work somehow.
Title: Re: Using more SDL projects?
Post by: HCDaniel on March 08, 2014, 03:48:22 PM
I put all my changes into this repo:

https://bitbucket.org/hardcoredaniel/freewmelite

It requires a modified SDL_mixer from here:

https://bitbucket.org/hardcoredaniel/wmelite-dependencies-for-linux-and-android

The other dependencies are unchanged.

The WME touch demo seems to work. Bigger projects start behaving funny when the mixer channels are all used up. So this will require some more work until it is usable.
Title: Re: Using more SDL projects?
Post by: HCDaniel on March 21, 2014, 11:30:40 AM
Hi Mnemonic,

I want to integrate the SDL_mixer variant into regular wmelite. It does not make sense to keep the fork around if there are in fact just 2 files "replaced".

Here's my idea for integration, please let me know what you think:

1) Add dedicated macros for LOBYTE/HIWORD/MAKEWORD... into BPersistMgr.cpp. Currently the #defines from BASS are used, but the non-bass version should not depend on that. The Macro's names should be different to not be redefinitions in case bass.h is there. Once that is done, wmelite is prepared to cope with different sound system implementations :)

2) Move the BSoundBuffer.* and BSoundMgr.* files into a "BASS" subdirectory, and place the "SDL_mixer" counterparts into its dedicated subdirectory as well. Regular wmelite now includes the former, the SDL_mixer based implementation uses the latter sources and header files.

As a result, every platform would now have a "default" build target (BASS) after some small path adaptations. For those who want SDL_mixer, a separate build target/Makefile/whatever would be required.

I hope that with this approach it will be possible to package wmelite for Linux distributions (without BASS), up to the point where a distribution might decide to add it to their official repositories (sometime in the distant future). There's still a lot of work to be done before the implementation is ready though.

What is your opinion on that?
Title: Re: Using more SDL projects?
Post by: Mnemonic on March 22, 2014, 12:53:11 PM
Sounds good to me! As long as the change really happens in just the two classes this should be easy enough to maintain.
Possibly less disruptive for starters might be to keep the BASS files where they are now and only add the subdir for SDL_mixer, so that we don't have to change all the existing project files for win/osx/ios.