quietcoder
July 4th, 2002, 01:38 PM
i'm using Dev-C++ 4
any help in resolving these errors is very much appreciated
1st error: 285 txt2bmp.cpp
case label `'n'' within scope of cleanup or variable array
2nd error: 285 txt2bmp.cpp
jump to case label
3rd error: 53 txt2bmp.cpp
crosses initialization of `class ifstream fin'
although its currently producing 9 errors and 9 warnings
I did find an example windows bmp program at
http://www.csse.monash.edu.au/~tonyj/raytracing/
that did compile. :)
in bitmap.h i modified
void setPixel(int, int, unsigned char, unsigned char, unsigned char);
to
void setPixel(int, int, unsigned char[3], unsigned char[3], unsigned char[3]);
and in bitmap.cpp i modified
void Bitmap::setPixel(int x, int y, unsigned char r, unsigned char g, unsigned char b)
to
void Bitmap::setPixel(int x, int y, unsigned char r[], unsigned char g[], unsigned char b[])
and
red[index(x,y)] = r;
green[index(x,y)] = g;
blue[index(x,y)] = b;
to
red[index(x, y)] = r[3];
green[index(x, y)] = g[3];
blue[index(x, y)] = b[3];
any help in resolving these errors is very much appreciated
1st error: 285 txt2bmp.cpp
case label `'n'' within scope of cleanup or variable array
2nd error: 285 txt2bmp.cpp
jump to case label
3rd error: 53 txt2bmp.cpp
crosses initialization of `class ifstream fin'
although its currently producing 9 errors and 9 warnings
I did find an example windows bmp program at
http://www.csse.monash.edu.au/~tonyj/raytracing/
that did compile. :)
in bitmap.h i modified
void setPixel(int, int, unsigned char, unsigned char, unsigned char);
to
void setPixel(int, int, unsigned char[3], unsigned char[3], unsigned char[3]);
and in bitmap.cpp i modified
void Bitmap::setPixel(int x, int y, unsigned char r, unsigned char g, unsigned char b)
to
void Bitmap::setPixel(int x, int y, unsigned char r[], unsigned char g[], unsigned char b[])
and
red[index(x,y)] = r;
green[index(x,y)] = g;
blue[index(x,y)] = b;
to
red[index(x, y)] = r[3];
green[index(x, y)] = g[3];
blue[index(x, y)] = b[3];