mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- Increased maximum number of per-pattern rows for the XM loader from
256 to 1024 to deal with a module that otherwise would not load. - Removed the artificial restriction on not supporting Vorbis-compressed samples in XMs if they are stereo, since it turns out that OggMod does support them. SVN r1316 (trunk)
This commit is contained in:
parent
bd9e318863
commit
f435576f1d
3 changed files with 13 additions and 7 deletions
|
@ -1,3 +1,10 @@
|
|||
December 15, 2008
|
||||
- Increased maximum number of per-pattern rows for the XM loader from
|
||||
256 to 1024 to deal with a module that otherwise would not load.
|
||||
- Removed the artificial restriction on not supporting Vorbis-compressed
|
||||
samples in XMs if they are stereo, since it turns out that OggMod does
|
||||
support them.
|
||||
|
||||
December 12, 2008 (Changes by Graf Zahl)
|
||||
- Added a SECF_NORESPAWN flag for sectors that prevents players from being respawned
|
||||
in such a sector. As a workaround for current map formats a new actor
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <malloc.h>
|
||||
#include <assert.h>
|
||||
|
||||
#define MAX_COLUMN_MEMORY (1024*5)
|
||||
|
||||
extern short *DUMBCALLBACK dumb_decode_vorbis(int outlen, const void *oggstream, int sizebytes);
|
||||
|
||||
|
@ -211,8 +212,8 @@ static int it_xm_read_pattern(IT_PATTERN *pattern, DUMBFILE *f, int n_channels,
|
|||
if (size == 0)
|
||||
return 0;
|
||||
|
||||
if (size > 1280 * n_channels) {
|
||||
TRACE("XM error: pattern data size > %d bytes\n", 1280 * n_channels);
|
||||
if (size > MAX_COLUMN_MEMORY * n_channels) {
|
||||
TRACE("XM error: pattern data size > %d bytes\n", MAX_COLUMN_MEMORY * n_channels);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -636,8 +637,7 @@ static int it_xm_read_sample_data(IT_SAMPLE *sample, unsigned char roguebytes, D
|
|||
return -1;
|
||||
|
||||
/* FMOD extension: Samples compressed with Ogg Vorbis */
|
||||
if (!(sample->flags & IT_SAMPLE_STEREO) &&
|
||||
!memcmp((char *)sample->data + 4, "OggS", 4) &&
|
||||
if (!memcmp((char *)sample->data + 4, "OggS", 4) &&
|
||||
!memcmp((char *)sample->data + 33, "vorbis", 7))
|
||||
{
|
||||
int32 outlen = ((unsigned char *)(sample->data))[0] |
|
||||
|
@ -859,7 +859,7 @@ static DUMB_IT_SIGDATA *it_xm_load_sigdata(DUMBFILE *f, int * version)
|
|||
sigdata->pattern[i].entry = NULL;
|
||||
|
||||
{
|
||||
unsigned char *buffer = malloc(1280 * n_channels); /* 256 rows * 5 bytes */
|
||||
unsigned char *buffer = malloc(MAX_COLUMN_MEMORY * n_channels); /* 256 rows * 5 bytes */
|
||||
if (!buffer) {
|
||||
_dumb_it_unload_sigdata(sigdata);
|
||||
return NULL;
|
||||
|
@ -1054,7 +1054,7 @@ static DUMB_IT_SIGDATA *it_xm_load_sigdata(DUMBFILE *f, int * version)
|
|||
sigdata->pattern[i].entry = NULL;
|
||||
|
||||
{
|
||||
unsigned char *buffer = malloc(1280 * n_channels); /* 256 rows * 5 bytes */
|
||||
unsigned char *buffer = malloc(MAX_COLUMN_MEMORY * n_channels); /* 256 rows * 5 bytes */
|
||||
if (!buffer) {
|
||||
free(roguebytes);
|
||||
_dumb_it_unload_sigdata(sigdata);
|
||||
|
|
|
@ -2397,7 +2397,6 @@ short *FMODSoundRenderer::DecodeSample(int outlen, const void *coded, int sizeby
|
|||
}
|
||||
result = sound->getFormat(NULL, &format, &channels, NULL);
|
||||
// TODO: Handle more formats if it proves necessary.
|
||||
// Does OggMod work with stereo samples?
|
||||
if (result != FMOD_OK || format != FMOD_SOUND_FORMAT_PCM16 || channels != 1)
|
||||
{
|
||||
sound->release();
|
||||
|
|
Loading…
Reference in a new issue