PocketMatrix forums

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

PocketFrog 0.7.0 crashing (not my code ??)

Having tested PF0.8.0PHAL version I got a crash so I reverted everything back to 0.7.0 and I'm still getting a similar crash. The line highlighted is in graphicbuffer.h
Code:
Pixel* GetPixels(int x, int y) { return(Pixel*)((char*)(m_pixels + x) + y * m_pitch

x is 16
y is 0
the other variables cannot be evaluated.

so something else has gone very wrong.
The game was running fine up until I tried to debug the notifications thing & changed over to 0.8.0PF + HAL.
The VC6 version (same code) is still running fine.

Any suggestions ?
What is the crash? What error are you getting? What are the values of the variables?

Did you call GetDisplay() before doing any rendering?
I listed the only variables shown ( x & y ). All that was happening was a very simple clear the screen and draw a pattern on it. I always set up the display via DisplayDevice* display = MyGame::GetDisplay();

what is it that your line is doing in graphicbuffer ?

The VC6 project runs fine with identical code
Would be usefull to know the value of m_pixels. It probably points to invalid pixels for some reason.
Or perhaps "this" is NULL. The x and y are parameters to the method and not really useful for debugging.

My best guess is that GetDisplay() wasn't called properly.

Then again, why don't you just revert back to the code you had working and see where the difference is?
This is the working code & as I said it runs fine on PC. I will spend a couple of hours tomorrow trying 2 week old code.
Try this: modify DisplayDevice::Update() to start a new scene automatically. This way the display will always be valid and you will see if the crash goes away or not.