mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-15 08:41:59 +00:00
Update DUMB to revision 756ecf2ac0a2b70639193aca55627b64dac8d8d5
- Added interface for inserting extra DUH signals, and fixed searching for IT sigdata when more than one signal is present SVN r4103 (trunk)
This commit is contained in:
parent
b3af94c2a7
commit
2b2a86a13e
4 changed files with 40 additions and 6 deletions
|
@ -233,7 +233,6 @@ int32 DUMBEXPORT duh_get_length(DUH *duh);
|
||||||
|
|
||||||
const char *DUMBEXPORT duh_get_tag(DUH *duh, const char *key);
|
const char *DUMBEXPORT duh_get_tag(DUH *duh, const char *key);
|
||||||
|
|
||||||
|
|
||||||
/* Signal Rendering Functions */
|
/* Signal Rendering Functions */
|
||||||
|
|
||||||
typedef struct DUH_SIGRENDERER DUH_SIGRENDERER;
|
typedef struct DUH_SIGRENDERER DUH_SIGRENDERER;
|
||||||
|
@ -610,6 +609,8 @@ sigdata_t *DUMBEXPORT duh_get_raw_sigdata(DUH *duh, int sig, int32 type);
|
||||||
DUH_SIGRENDERER *DUMBEXPORT duh_encapsulate_raw_sigrenderer(sigrenderer_t *vsigrenderer, DUH_SIGTYPE_DESC *desc, int n_channels, int32 pos);
|
DUH_SIGRENDERER *DUMBEXPORT duh_encapsulate_raw_sigrenderer(sigrenderer_t *vsigrenderer, DUH_SIGTYPE_DESC *desc, int n_channels, int32 pos);
|
||||||
sigrenderer_t *DUMBEXPORT duh_get_raw_sigrenderer(DUH_SIGRENDERER *sigrenderer, int32 type);
|
sigrenderer_t *DUMBEXPORT duh_get_raw_sigrenderer(DUH_SIGRENDERER *sigrenderer, int32 type);
|
||||||
|
|
||||||
|
int DUMBEXPORT duh_add_signal(DUH *duh, DUH_SIGTYPE_DESC *desc, sigdata_t *sigdata);
|
||||||
|
|
||||||
|
|
||||||
/* Standard Signal Types */
|
/* Standard Signal Types */
|
||||||
|
|
||||||
|
|
|
@ -130,3 +130,22 @@ DUH *make_duh(
|
||||||
|
|
||||||
return duh;
|
return duh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int DUMBEXPORT duh_add_signal(DUH *duh, DUH_SIGTYPE_DESC *desc, sigdata_t *sigdata)
|
||||||
|
{
|
||||||
|
DUH_SIGNAL **signal;
|
||||||
|
|
||||||
|
if ( !duh || !desc || !sigdata ) return -1;
|
||||||
|
|
||||||
|
signal = ( DUH_SIGNAL ** ) realloc( duh->signal, ( duh->n_signals + 1 ) * sizeof( *duh->signal ) );
|
||||||
|
if ( !signal ) return -1;
|
||||||
|
duh->signal = signal;
|
||||||
|
|
||||||
|
memmove( signal + 1, signal, duh->n_signals * sizeof( *signal ) );
|
||||||
|
duh->n_signals++;
|
||||||
|
|
||||||
|
signal[ 0 ] = make_signal( desc, sigdata );
|
||||||
|
if ( !signal[ 0 ] ) return -1;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
@ -29,16 +29,30 @@
|
||||||
*/
|
*/
|
||||||
sigdata_t *DUMBEXPORT duh_get_raw_sigdata(DUH *duh, int sig, int32 type)
|
sigdata_t *DUMBEXPORT duh_get_raw_sigdata(DUH *duh, int sig, int32 type)
|
||||||
{
|
{
|
||||||
|
int i;
|
||||||
DUH_SIGNAL *signal;
|
DUH_SIGNAL *signal;
|
||||||
|
|
||||||
if (!duh) return NULL;
|
if (!duh) return NULL;
|
||||||
|
|
||||||
if ((unsigned int)sig >= (unsigned int)duh->n_signals) return NULL;
|
if ( sig >= 0 )
|
||||||
|
{
|
||||||
|
if ((unsigned int)sig >= (unsigned int)duh->n_signals) return NULL;
|
||||||
|
|
||||||
signal = duh->signal[sig];
|
signal = duh->signal[sig];
|
||||||
|
|
||||||
if (signal && signal->desc->type == type)
|
if (signal && signal->desc->type == type)
|
||||||
return signal->sigdata;
|
return signal->sigdata;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for ( i = 0; i < duh->n_signals; i++ )
|
||||||
|
{
|
||||||
|
signal = duh->signal[i];
|
||||||
|
|
||||||
|
if (signal && signal->desc->type == type)
|
||||||
|
return signal->sigdata;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
DUMB_IT_SIGDATA *DUMBEXPORT duh_get_it_sigdata(DUH *duh)
|
DUMB_IT_SIGDATA *DUMBEXPORT duh_get_it_sigdata(DUH *duh)
|
||||||
{
|
{
|
||||||
return duh_get_raw_sigdata(duh, 0, SIGTYPE_IT);
|
return duh_get_raw_sigdata(duh, -1, SIGTYPE_IT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue