Commit Graph

12 Commits

Author SHA1 Message Date
Jonas Kulla 54c1107f19 FileSystem: Fix file lookup if unrelated files with same name exist
Before, even though we did match all possible extensions,
we only took the first match and tried opening it.
If we were looking for a .png image, but there was an unrelated
.txt file with the same name (as it actually happens in RTPs),
we would potentially see the .txt first, try opening it,
and fail alltogether, even though the image file existed.

Now we try opening all matching files until we find one that
we can parse.

This fixes #101.
2015-07-09 15:38:50 +02:00
Jonas Kulla e72bced0f7 'snprintf()' guarantees null termination of buffer
Thanks @cremno.
2015-03-27 08:21:47 +01:00
Jonas Kulla 531441d4e3 Make audio asset decoding failures non-fatal
Matches RMXP behavior. This is also useful in case midi files
are to be played, but fluidsynth isn't available.
2015-02-17 02:09:55 +01:00
Jonas Kulla 0f91bdefea Fix indentation 2015-02-17 01:48:05 +01:00
Jonas Kulla 44eaaf5985 FileSystem: Change file lookup to match all extensions
Previously, file lookup (ie. extension supplementing) would only
try out a few predetermined extensions based on the asset type.
This was not accurate in regard to RMXP's behavior, which will
happily match "some_asset" against "some_asset.abcef" and try
to open it.

Some games make use of this quirk and rename their ogg audio files
to "*.dat" or similar to thwart users from copying them.

This change also makes it easier to read arbitrary formats
supported by SDL_image without modifying mkxp.
2015-02-17 01:42:11 +01:00
Jonas Kulla 4560589e25 Audio: Set overall volume of OpenAL output to 0.8 2014-12-31 18:52:20 +01:00
Jonas Kulla f665d8b41c BoostSet: Add 'remove' and rename BoostHash::erase to remove
This is more consistent with Qt's method naming.
2014-09-05 01:06:08 +02:00
Jonas Kulla 18c74e0f24 SoundEmitter: Only detach/attach buffer if necessary 2014-08-25 05:35:46 +02:00
Jonas Kulla b1ebc655f9 SoundEmitter: Make SE source count configurable
Default is still 6.
2014-08-25 05:34:19 +02:00
Jonas Kulla 5ee62ba0fd SoundEmitter: Optimize source allocation strategy a bit
If no source is free, instead of seizing the lowest priority one,
first try to find the lowest priority source with the same buffer
that is about to be played and use it. Otherwise, take lowest priority
one as before.
2014-08-24 09:19:54 +02:00
Jonas Kulla c5c58fa9cd SoundEmitter: Show filename that caused the SDL_Sound error 2014-08-22 23:50:52 +02:00
Jonas Kulla f73b0ba4b5 audio.cpp: Split up into smaller parts 2014-07-23 17:28:20 +02:00