Skip to content

Commit 60e374e

Browse files
committed
build fixes.
1 parent 4a630a9 commit 60e374e

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

libmikmod/playercode/mplayer.c

+14-11
Original file line numberDiff line numberDiff line change
@@ -379,16 +379,17 @@ static void StartEnvelope(ENVPR *t,UBYTE flg,UBYTE pts,UBYTE susbeg,UBYTE susend
379379
static void SetEnvelopePosition(ENVPR *t, ENVPT *p, SWORD pos)
380380
{
381381
if (t->flg & EF_ON) {
382-
t->tick = pos - 1;
383-
384382
SWORD idx = 0;
385383
BOOL envUpdate = TRUE;
386384
SWORD tick = pos;
387385

386+
t->tick = pos - 1;
387+
388388
if (t->pts > 1) {
389+
UWORD i;
389390
idx++;
390391

391-
for (UWORD i = 0; i < t->pts - 1; i++) {
392+
for (i = 0; i < t->pts - 1; i++) {
392393
if (tick < p[idx].pos) {
393394
idx--;
394395

@@ -446,7 +447,7 @@ static void SetPanningEnvelopePosition(MODULE *mod, INSTRUMENT *i, ENVPR *t, ENV
446447
/* Calculates the next envelope value the XM way, based on the implementation from ft2-clone */
447448
static inline void ProcessEnvelopeXm(MP_VOICE *aout, ENVPR *t)
448449
{
449-
WORD idx = t->index;
450+
UWORD idx = t->index;
450451
const BOOL keyOff = aout->main.keyoff & KEY_OFF;
451452

452453
if (keyOff) {
@@ -506,11 +507,14 @@ static inline void ProcessEnvelopeXm(MP_VOICE *aout, ENVPR *t)
506507
/* Calculates the next envelope value the IT way, based on the implementation from Schismtracker */
507508
static inline void ProcessEnvelopeIt(MP_VOICE *aout, ENVPR *t)
508509
{
509-
t->tick++;
510-
511510
SWORD start, end;
512511
const BOOL keyOff = aout->main.keyoff & KEY_OFF;
513512
BOOL fadeFlag = FALSE;
513+
SWORD pointPos, newPos;
514+
SWORD tick;
515+
UWORD i, idx;
516+
517+
t->tick++;
514518

515519
if ((t->flg & EF_SUSTAIN) && !keyOff) {
516520
start = t->env[t->susbeg].pos;
@@ -537,19 +541,18 @@ static inline void ProcessEnvelopeIt(MP_VOICE *aout, ENVPR *t)
537541
t->tick = start;
538542
}
539543

540-
SWORD tick = t->tick;
541-
WORD idx = t->pts - 1;
544+
tick = t->tick;
545+
idx = t->pts - 1;
542546

543547
// Find the right point to use
544-
for (WORD i = 0; i < t->pts - 1; i++) {
548+
for (i = 0; i < t->pts - 1; i++) {
545549
if (tick <= t->env[i].pos) {
546550
idx = i;
547551
break;
548552
}
549553
}
550554

551-
const SWORD pointPos = t->env[idx].pos;
552-
SWORD newPos;
555+
pointPos = t->env[idx].pos;
553556

554557
if (tick >= pointPos) {
555558
t->lastvalue = t->env[idx].val;

0 commit comments

Comments
 (0)