Corrupt .bmp fix?

The Partridge Family were neither partridges nor a family. Discuss.
User avatar
Asimov
Posts: 814
Joined: May 19th, 2012, 11:38 pm

Re: Corrupt .bmp fix?

Post by Asimov » June 5th, 2012, 12:14 pm

Hi Lux,

Actually knowing what lessons people have watched won't be able to tell you the level of competance though.

I have watched all 21 lessons and even though they are the best C++ tutorials I have ever seen, there is still lots I am vague on. Mainly the maths.

Even though I don't understand 90% of the maths I like the that that Chilli does explain. I will re-watch tutorials later.

I really want to be better at maths, but I had a rubbish maths teacher at school.

I did go on to do level N1 electronics, and there was pretty intensive maths in that, but not like geometry maths heh heh.

Asimov
----> Asimov
"You know no matter how much I think I have learnt. I always end up hitting brick walls"
http://www.asimoventerprises.co.uk

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Corrupt .bmp fix?

Post by LuX » June 5th, 2012, 12:20 pm

Possibly, but it still gives a better picture of the persons nollage, and underline the word "roughly".

For mathematics I recommend buying a book with the basic mathematics in it. I always have some here near this book I use which has the most used math formulas and stuff like that. Pretty useful, and of course a good symbolic and geometic calculator.
ʕ •ᴥ•ʔ

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Corrupt .bmp fix?

Post by LuX » June 5th, 2012, 1:50 pm

:lol:
Attachments
ItWurkz.png
ItWurkz.png (22.71 KiB) Viewed 3003 times
ʕ •ᴥ•ʔ

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Corrupt .bmp fix?

Post by LuX » June 5th, 2012, 3:02 pm

Hmm... I got to the part where you wrote the text string, but something really funky happens.
I write "gfx.DrawString("Works!", f, 20, &fixedSys, D3DCOLOR_XRGB(255, 255, 255));"
And it outputs on the screen "Works! c:\users\...path...\Chili Directx Framework BMP\assets\Bitmap.cpp Fixedsys16x28.bmp rb ! FAILED ( result) pDirect3D != NULL c:\users\...\Chili Directx Framework BMP\assets\d3dgraphics.cpp"

As if I wrote that as a string... No errors, nothing that just gets printed on the screen... hmm.

Then I changed the "for (int n = 0; string[n] != "\n"; n += 1)" to "for (int n = 0; string[n] != 0; n += 1)" and works like a charm! Weird...
ʕ •ᴥ•ʔ

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Corrupt .bmp fix?

Post by chili » June 5th, 2012, 3:45 pm

Not weird at all. If you think about it, that is the logical result of the code you wrote.

Can you figure out why? ;)
Chili

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Corrupt .bmp fix?

Post by LuX » June 5th, 2012, 4:35 pm

I tried, but I'm allergic to figuring stuff out : -(

Maybe the '\n' somehow didn't detect the ending of the string.
Doubt you do, but if you think the "f" is causing it, its a variable declared to scroll the text around to see what the full string is saying.

Other than that, I have no idea why its "\n" when it should be '\n'? I copy pasted that part from the code, but now as I try to recreate the "\n" situation I can't even debug it unless I put '\n' Which strangely now works?!

Or does the variable "n" and string '\n' somehow collide as both have n?
ʕ •ᴥ•ʔ

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Corrupt .bmp fix?

Post by chili » June 6th, 2012, 4:54 am

'\n' is the escape code for a newline character (ASCII code 10). '\0' is the escape code for a null character (ASCII code 0). Got it now LuX? ;)
Chili

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Corrupt .bmp fix?

Post by LuX » June 6th, 2012, 9:09 am

: -O I mustn't have payed enough attention. Strangely the \n seems to work now anyways, but I sticked to the plain 0.
ʕ •ᴥ•ʔ

Post Reply