Skip to content

Commit

Permalink
Updated the envelopes, so there are two separate handlers. One for XM…
Browse files Browse the repository at this point in the history
…/IMF and one for IT.
  • Loading branch information
neumatho authored and sezero committed Feb 28, 2022
1 parent 8af9a7d commit 4a630a9
Show file tree
Hide file tree
Showing 3 changed files with 209 additions and 144 deletions.
23 changes: 12 additions & 11 deletions libmikmod/include/mikmod_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ typedef struct FILTER {
#define EF_SUSTAIN 2
#define EF_LOOP 4
#define EF_VOLENV 8
#define EF_ITMODE 16

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

typedef struct ENVPR {
UBYTE flg; /* envelope flag */
UBYTE pts; /* number of envelope points */
UBYTE susbeg; /* envelope sustain index begin */
UBYTE susend; /* envelope sustain index end */
BOOL susactive;/* Indicate if sustain is active (no interpolation) */
UBYTE beg; /* envelope loop begin */
UBYTE end; /* envelope loop end */
SWORD p; /* current envelope counter */
UWORD index; /* envelope index for the point after the current one */
SWORD lastvalue;/* the last calculated value */
ENVPT* env; /* envelope points */
UBYTE flg; /* envelope flag */
UBYTE pts; /* number of envelope points */
UBYTE susbeg; /* envelope sustain index begin */
UBYTE susend; /* envelope sustain index end */
UBYTE loopbeg; /* envelope loop begin */
UBYTE loopend; /* envelope loop end */
SWORD tick; /* current envelope counter */
UWORD index; /* envelope index for the point after the current one */
BOOL interpolate; /* Indicate if interpolation should be done */
SWORD lastvalue; /* the last calculated value */
ENVPT* env; /* envelope points */
} ENVPR;

typedef struct MP_CHANNEL {
Expand Down
4 changes: 3 additions & 1 deletion libmikmod/loaders/load_it.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,9 @@ static BOOL IT_Load(BOOL curious)
return 0;
}

d->volflg|=EF_VOLENV;
d->volflg|=(EF_VOLENV | EF_ITMODE);
d->panflg|=EF_ITMODE;
d->pitflg|=EF_ITMODE;
d->insname = DupStr(ih.name,26,0);
d->nnatype = ih.nna & NNA_MASK;

Expand Down
Loading

0 comments on commit 4a630a9

Please sign in to comment.