Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Switch problem?

This topic is 6964 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am 'trying' to make my program work better, but it just doesn't work. I stumbled upon a real weird problem.

I've got 2 unsigned char arrays like

unsigned char *bit = new unsigned char[width * height * 3]; // 24 bits bitmap
unsigned char *Buffer = new unsigned char[width * height * 3];

These two arrays are used for 24 bits bitmap storage. And one of them is temporarily. Anyway.

I used a switch statement like:

case 0:
FFindEdges(bits, Buffer);
case 1:
FBOOLMap(bits, Buffer);
case 2:
F3DFILE World;

In which UseFilter is an integer number representing which filter to use.

Now, if I use onle 0, it shows a nice Edge detected Image on the screen. if I use both 0 and 1, it shows a grayscale image (black or white) ont he screen.
And if I use 0, 1 and 2......it represents a black screen.

it is called like

CPictureDoc *pDoc;
pDoc = GetDocument();
if(pDoc->Filter(0) == FALSE) MessageBox("oops","again");
if(pDoc->Filter(1) == FALSE) MessageBox("oops","again");
if(pDoc->Filter(2) == FALSE) MessageBox("oops","again");


And the F3DFILE doesn't do anything, it's just a

class F3DFILE


So, what can be the problem here?

Dance with me......

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!