I am too stoopid to live.

Published September 01, 2004
Advertisement
Oh man. What a dumb bug. I gotta make a post just about this stupid bug.

Okay, Bola has functionality to handle "shared" bitmaps. See Cammy down there? A lot of Street Fighter animations, I found, used a frame of animation more than once in the same sequence. Like if you throw a punch, the punch animation can be just the fist being thrown, then the same frames in reverse as the fist comes back. Rather than waste memory on duplicate frames, the same image is just recycled for multiple frames. It's a useful feature and my animation engine supports it.

So I'm trying to load these images en masse into Bola and I can't figure out why it's crashing whenever I try to draw one or access the bitmap member variables. I even tried to save a bitmap immediately after loading it, and it still crashed! So I go look at the shared bitmap class and what do I see?


     CSharedImage(BITMAP* img = NULL, int n = 0): numofuses(n), index(0), image(NULL) { }


... yeah. Where did THAT come from? No wonder my bitmaps wouldn't stay loaded. Like I said before, that's what you get for coming back to year-old code. Needless to say, I simply replaced "NULL" with "img" and everything works now, and I need to go clean out all the mess I added to the code to check for errors across half my source files. Now I'll just nip off and shoot myself.

Don't worry. I'll be very humane.


Just before I do that though, I need to direct your attention here. It's a new shareware game by a friend of mine who's been working on it in secret for several months now. The demo is highly cool and the whole package is very slick and professional; check it out. Us shareware folks need all the attention we can get ...
Previous Entry Ugh
0 likes 1 comments

Comments

jmutch
[imwithstupid]
HAHAHAHAHAHAHAH! Setting it to NULL! HAHAHAHAHAHA!


...I've probably done the same thing ten times.
September 01, 2004 09:49 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement

Latest Entries

Advertisement