Skip to content

Commit 4a630a9

Browse files
neumathosezero
authored andcommitted
Updated the envelopes, so there are two separate handlers. One for XM/IMF and one for IT.
1 parent 8af9a7d commit 4a630a9

File tree

3 files changed

+209
-144
lines changed

3 files changed

+209
-144
lines changed

libmikmod/include/mikmod_internals.h

+12-11
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ typedef struct FILTER {
424424
#define EF_SUSTAIN 2
425425
#define EF_LOOP 4
426426
#define EF_VOLENV 8
427+
#define EF_ITMODE 16
427428

428429
/* New Note Action Flags */
429430
#define NNA_CUT 0
@@ -461,17 +462,17 @@ typedef struct FILTER {
461462
#define LAST_PATTERN (UWORD)(-1) /* special ``end of song'' pattern */
462463

463464
typedef struct ENVPR {
464-
UBYTE flg; /* envelope flag */
465-
UBYTE pts; /* number of envelope points */
466-
UBYTE susbeg; /* envelope sustain index begin */
467-
UBYTE susend; /* envelope sustain index end */
468-
BOOL susactive;/* Indicate if sustain is active (no interpolation) */
469-
UBYTE beg; /* envelope loop begin */
470-
UBYTE end; /* envelope loop end */
471-
SWORD p; /* current envelope counter */
472-
UWORD index; /* envelope index for the point after the current one */
473-
SWORD lastvalue;/* the last calculated value */
474-
ENVPT* env; /* envelope points */
465+
UBYTE flg; /* envelope flag */
466+
UBYTE pts; /* number of envelope points */
467+
UBYTE susbeg; /* envelope sustain index begin */
468+
UBYTE susend; /* envelope sustain index end */
469+
UBYTE loopbeg; /* envelope loop begin */
470+
UBYTE loopend; /* envelope loop end */
471+
SWORD tick; /* current envelope counter */
472+
UWORD index; /* envelope index for the point after the current one */
473+
BOOL interpolate; /* Indicate if interpolation should be done */
474+
SWORD lastvalue; /* the last calculated value */
475+
ENVPT* env; /* envelope points */
475476
} ENVPR;
476477

477478
typedef struct MP_CHANNEL {

libmikmod/loaders/load_it.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,9 @@ static BOOL IT_Load(BOOL curious)
811811
return 0;
812812
}
813813

814-
d->volflg|=EF_VOLENV;
814+
d->volflg|=(EF_VOLENV | EF_ITMODE);
815+
d->panflg|=EF_ITMODE;
816+
d->pitflg|=EF_ITMODE;
815817
d->insname = DupStr(ih.name,26,0);
816818
d->nnatype = ih.nna & NNA_MASK;
817819

0 commit comments

Comments
 (0)