I have run numerous plasmas on my m505, one from Aaron Ardiri, and some
others from his mobilewizardry site. I need to write my own plasma for a
paint program I am working on. So far I came up with the following, which
runs okay on the emulator or simulator, but is really slow on my m505.
cos_fx and Addfx are macros. What is making this loop run so slowly? And is
there some other way to write a sin/cos based plasma that is better?
Brandon
for (curY=0; curY < ySize; curY++) {
destPtr = rowStart;
for (curX=0; curX < xSize; curX++) {
curPhaseX = curX + offsets[flowPos[0]] +
offsets[flowPos[1]];
curPhaseY = curY + offsets[flowPos[2]] +
offsets[flowPos[3]];
result = Addfx(cos_fx(curPhaseX), cos_fx(curPhaseY));
curPhaseX = curX + offsets[flowPos[4]] +
offsets[flowPos[5]];
curPhaseY = curY + offsets[flowPos[6]] +
offsets[flowPos[7]];
result += Addfx(cos_fx(curPhaseX),
cos_fx(curPhaseY));
result <<= 8;
*destPtr++ = palette[fxtoi(result) & 0xff];
}
rowStart += 160;
}
-------------------------
Get SproutPaint for PalmOS
http://www.sproutworks.com/sproutpaint
--
For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
- Re: PalmOS plasma Brandon Smith
- Re: PalmOS plasma Aaron Ardiri
- Re: PalmOS plasma Brandon Smith
- Re: PalmOS plasma Aaron Ardiri
- Re: PalmOS plasma Matthew Bevan
- Re: PalmOS plasma s1796217
- Re: PalmOS plasma Brandon Smith
- Re: PalmOS plasma Aaron Ardiri
