Mercurial > hg > dmlib
diff tools/ppl.c @ 809:eba3b87f3f84
Add some separate macros for 64/32 precision fixed point types.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 14 May 2014 21:28:14 +0300 |
parents | f066e9dccf29 |
children | daebbf28953d |
line wrap: on
line diff
--- a/tools/ppl.c Tue May 13 18:18:10 2014 +0300 +++ b/tools/ppl.c Wed May 14 21:28:14 2014 +0300 @@ -261,9 +261,9 @@ if (yh < 10 || chn == NULL) return; - int xc, ym = y0 + (y1 - y0) / 2, vol = FP_GETH(chn->chVolume); + int xc, ym = y0 + (y1 - y0) / 2, vol = FP_GETH32(chn->chVolume); int pitch = screen->pitch / sizeof(Uint32); - int len = FP_GETH(chn->chSize); + int len = FP_GETH32(chn->chSize); DMFixedPoint offs = chn->chPos; Uint32 coln = dmCol(0.0, 0.8, 0.0), colx = dmCol(1.0, 0, 0); Uint32 *pix = screen->pixels; @@ -282,9 +282,9 @@ { for (xc = x0 + 1; xc < x1 - 1; xc++) { - if (FP_GETH(offs) >= len) + if (FP_GETH32(offs) >= len) break; - Sint16 val = ym + (data[FP_GETH(offs)] * yh * vol) / (65535 * 255); + Sint16 val = ym + (data[FP_GETH32(offs)] * yh * vol) / (65535 * 255); pix[xc + val * pitch] = coln; FP_ADD(offs, chn->chDeltaO); } @@ -293,9 +293,9 @@ { for (xc = x0 + 1; xc < x1 - 1; xc++) { - if (FP_GETH(offs) < 0) + if (FP_GETH32(offs) < 0) break; - Sint16 val = ym + (data[FP_GETH(offs)] * yh * vol) / (65535 * 255); + Sint16 val = ym + (data[FP_GETH32(offs)] * yh * vol) / (65535 * 255); pix[xc + val * pitch] = coln; FP_SUB(offs, chn->chDeltaO); }