Archived

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

Fletch

sigh.........

Recommended Posts

Tricks Of WIN GP Gurus, anyone else have this book? I bought it and must say, i actually like it, but the problem is that there wasnt a real clear stressing between stupid little things like UCHAR and USHORT. Now in hindsight, i realize it should have been obvious, but when i was trying to create a 16bit surface using UCHAR video buffer pointer, obviously my code would only fill half my screen. This was quite a thorn in my side for a while and i couldnt understand the difference, or see the difference between his code and mine. Finally, when i got an access violation using the lock() function, i understood i needed to make sure all of my pointers would allow for the 16bit mode. These little problems seem to hold me back more than anything, and it''s frustrating to say the least. I get so discouraged when i spend hours on tiny bugs that should seem obvious, and probably are to most. Anyhow, the real point, and my question is... does anyone else ever experience these little bugs that slow your development to a halt?

Share this post


Link to post
Share on other sites
Yeah, that book is great...

I know what you mean, though, about having to hunt through your code endlessly to figure out what in the hell is going wrong. It''s always so frustrating when it takes you two hours to find the problem and it turns out to be something stupid!

-Ironblayde
 Aeon Software

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
hehehehehehyeeheeh

I spent six hours over two days tracking down this:

    
void CPacket:<img src="tongue.gif" width=15 height=15 align=middle>ack(const void* vp, long n)
{
length = n+sizeof(CPacket) - sizeof(data);
//data = new char[n];

data = new char[n+1];//forgot to add one for termination

data[n]=0;//this is frivilous too!

memcpy(data, vp, n);//it doesnt get copied!

serialnum = GenerateSerial(serialnum);
ecc = GenerateECC();
}


it caused an assertion failure, and the debugger wasn''t terriblly helpful in locating the true source.

Share this post


Link to post
Share on other sites
The thing that really pissed me off was Andre''s Macro for converting 24 bit data to 16 bit. His macro
RGB565(((r%32)<<11) + ((g%64)<<6) + (b%32)) is wrong

The green component should only be shifted by 5. That had me stuck for about an hour. I just couldn''t figure our why I got strange colors on the screen btw, I think it would be faster to use & instead of % which his macro does.

Share this post


Link to post
Share on other sites