Lesson 20: help...

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
belzebubukas
Posts: 4
Joined: December 22nd, 2012, 1:06 pm
Location: Lithuania

Lesson 20: help...

Post by belzebubukas » December 22nd, 2012, 1:17 pm

I don't know what I did wrong, but when I tried building the program after creating the Sprite structure I got some seriously weird errors on the debugger... It worked fine before that... So I'm posting the code I have here, maybe someone would check it out... I feel kinda retarded, but I just couldn't find the problem :oops:
Attachments
Lesson20.7z
(1.22 MiB) Downloaded 156 times

Cletus
Posts: 18
Joined: December 7th, 2012, 6:56 pm

Re: Lesson 20: help...

Post by Cletus » December 22nd, 2012, 1:50 pm

hey, i found your problem =]...i hope you didnt have to wait for too long.
D3DGraphics.h

#include <d3d9.h>
#include "Game.h" //this is your problem, simply remove it and you should be fine, also after that


struct Sprite
{
unsigned int width, height;
D3DCOLOR key;
D3DCOLOR* surface;
};
now...im not sure why this effects the compiler like it does, but im guessing when 2 files include each other...sht gets wierd, and you start getting wierd errors. Also its good practice to put the .h files into the header file (i noticed your bitmap.h was in game.cpp) because if you put it in the header file it goes to the cpp anyway...its not completely necessary, but its just mo' sexy. and you want your code to be sexy right? =P

P.S. (dont feel bad...i made the same mistake in lesson 20 and it took me a good while to figure it out)
Image
Consistency is the hobgoblin of the small mind ~Terrance McKenna~

Post Reply