PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Ripple Effect...

Does anyone still have Invicible's ripple effect somewhere?

Here is the post where he mentions it. I used to have it but I can no longer find it.

http://www.pocketmatrix.com/forums/view ... highlight=
Here you go...

If anyone needs anything else from the old PocketFrog Developer's Corner site, let me know, I still have it all archived.
Attachments:
ripple.zip (58 KB)
Thanks Frank!! And thanks for keeping the examples around. Thery really do help.

The exe runs fine, but when I try to compile it and run it, I get an Access Violation, (C000005) error. I'm attempting to run it with PF7.0. It seems to be dying in the DrawRippleEffect() and it's in the for loops when it dies. I tracked it down to the this link of code:
Code:
buffer.pixels[i * dy + j] = srcbuffer.pixels[ (i+yoff) * dy + j + xoff ];


Any ideas why this would be causing an error?
No help from me. I just ran it on the PC and it worked fine, but that's as far as I tried (because I had never seen it before).

Is the original author still floating around here to ask?
Yeah I ran the EXE and it works fine, but when I try running it with PF7.0 it crashes with the C000005 error. I'm going to try to figure it out later on today, but if anyone has an idea please post it here. Likewise, if I figure it out, I'll post the solution.

If Invicible is still around, that would be great if he could point me in the right direction.
Well... I got it working but I'm using the following for the desktop compile:

Code:
m_config.desktopZoom = 2;


And when I use the zoom it cuts my screen in half if I use the ripple effect. Now if I remove the zoom it works perfectly. Is it becuase of the way it's locking / unlocking the back buffer? Is there a better way to accomplish this?
I think it's the line just above the buffer.pixels...


should be
Code:

if ((i + yoff ) < 0 || (i + yoff ) >= height || (j + xoff ) < 0 || (j + xoff ) >= width)


The difference is the >= instead of just >.

Valid width and height is 0 through width-1, and the way it was written, it would still blit if it was equal to width/height.

I don't get the crash, but I did notice some black pixels toward the bottom that were caused by this and fixed by the code change.

I hope it fixes it on your side as well.
Yeah I noticed that as well. Does your actually run under the ARM processor? I have it (more or less) working on the desktop, but when I compile with eVC for ARM and then run it on my X30, it dies. It loads and then dumps out. I'm trying to rewrite it so I have a better understanding of whats going on, but I can't figure out why it's dumping out on the ARM and not on the x86.
Well, I didn't try the device...

I'm using PF 0.8.1, BTW.

You may want to try that. There's only a few changes. If I remember corectly,
change pf path to pocketfrog/pocketfrog.h
change DisplayDevice to Display
Change orientation keywords (ORIENTATION_WEST = ORIENTATION_ROTATE_CCW or something)
remove splashscreen time.
Thanks, with your notes it wasn't too hard to convert to PF 0.8.1, but I get the exact same results. It works fine on x86 using VC6, but when I use eVC to compile for ARM and then run on my Axim X30, it dumps to the main screen.
Well, I got the zip file and compared what I had on my harddrive.

At some time, I must have added this line as well

Code:

if(k>=width)
yoff = m_pBuf1[k - width] - m_pBuf1[k + width];


Using a 'continue' statement may make more sense, but you obviously need to keep from addressing m_pBuf1 with a negative index...


BTW, take the time to register for the forum.
Ahahaha that did the trick! Why didn't I see that. That is such a balent overrun. I really should have seen that. Thank you for the fix. I have it working great under x86 and ARM. Now time to tweak it to do what I wanted.

Help like this is what makes PocketFrog an aweasome library! Thanks again for all the help.