Skip to content

Commit dd8d700

Browse files
committed
Updated the envelopes, so there are two separate handlers. One for XM/IMF and one for IT.
1 parent 1ea53f6 commit dd8d700

3 files changed

Lines changed: 209 additions & 144 deletions

File tree

libmikmod/include/mikmod_internals.h

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ typedef struct FILTER {
415415
#define EF_SUSTAIN 2
416416
#define EF_LOOP 4
417417
#define EF_VOLENV 8
418+
#define EF_ITMODE 16
418419

419420
/* New Note Action Flags */
420421
#define NNA_CUT 0
@@ -452,17 +453,17 @@ typedef struct FILTER {
452453
#define LAST_PATTERN (UWORD)(-1) /* special ``end of song'' pattern */
453454

454455
typedef struct ENVPR {
455-
UBYTE flg; /* envelope flag */
456-
UBYTE pts; /* number of envelope points */
457-
UBYTE susbeg; /* envelope sustain index begin */
458-
UBYTE susend; /* envelope sustain index end */
459-
BOOL susactive;/* Indicate if sustain is active (no interpolation) */
460-
UBYTE beg; /* envelope loop begin */
461-
UBYTE end; /* envelope loop end */
462-
SWORD p; /* current envelope counter */
463-
UWORD index; /* envelope index for the point after the current one */
464-
SWORD lastvalue;/* the last calculated value */
465-
ENVPT* env; /* envelope points */
456+
UBYTE flg; /* envelope flag */
457+
UBYTE pts; /* number of envelope points */
458+
UBYTE susbeg; /* envelope sustain index begin */
459+
UBYTE susend; /* envelope sustain index end */
460+
UBYTE loopbeg; /* envelope loop begin */
461+
UBYTE loopend; /* envelope loop end */
462+
SWORD tick; /* current envelope counter */
463+
UWORD index; /* envelope index for the point after the current one */
464+
BOOL interpolate; /* Indicate if interpolation should be done */
465+
SWORD lastvalue; /* the last calculated value */
466+
ENVPT* env; /* envelope points */
466467
} ENVPR;
467468

468469
typedef struct MP_CHANNEL {

libmikmod/loaders/load_it.c

Lines changed: 3 additions & 1 deletion
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)