I'm busy with lesson 20.
I followed every step but somehow my code reads the pixel data wrong.
It reads the whole file instead of just one pixel. It gives a blue red and green value of 3435973836.
please help!
Stuck again
Stuck again
- Attachments
-
- Sprite - TUT.rar
- here is my code
- (6.22 MiB) Downloaded 164 times
-
- Posts: 53
- Joined: January 7th, 2013, 8:09 am
Re: Stuck again
Code: Select all
//inside Bitmap.h
struct Pixel24
{ //all these unsigned int should be unsigned char
unsigned int blue;
unsigned int green;
unsigned int red;
}
Re: Stuck again
I think it is because of the padding. Don't know in which tut Chili mentioned, that *almost* every picture has padding at the end of one row. You need to jump over this padding because it's just some junk data and you don't want to load it. Maybe it is explained in the next tut.
-
- Posts: 53
- Joined: January 7th, 2013, 8:09 am
Re: Stuck again
The padding is mentioned in this tutorial, but i wasn't sure how far along he was in the video. The image should still load without padding.. it would just be distorted.
Re: Stuck again
Yeah, I was judging by the look of drawn picture and the loading code.