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.
This commit is contained in:
parent
87462fd7b0
commit
44eaaf5985
5 changed files with 172 additions and 167 deletions
|
@ -197,12 +197,12 @@ SoundBuffer *SoundEmitter::allocateBuffer(const std::string &filename)
|
|||
{
|
||||
/* Buffer not in cashe, needs to be loaded */
|
||||
SDL_RWops dataSource;
|
||||
const char *extension;
|
||||
char ext[8];
|
||||
|
||||
shState->fileSystem().openRead(dataSource, filename.c_str(),
|
||||
FileSystem::Audio, false, &extension);
|
||||
false, ext, sizeof(ext));
|
||||
|
||||
Sound_Sample *sampleHandle = Sound_NewSample(&dataSource, extension, 0, STREAM_BUF_SIZE);
|
||||
Sound_Sample *sampleHandle = Sound_NewSample(&dataSource, ext, 0, STREAM_BUF_SIZE);
|
||||
|
||||
if (!sampleHandle)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue