Path: chuka.playstation.co.uk!news From: "Nick Slaven" Newsgroups: scea.yaroze.programming.2d_graphics Subject: Re: BG Problem Date: Sun, 6 Sep 1998 21:18:14 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 83 Message-ID: <6suqri$66616@chuka.playstation.co.uk> References: <35f2c71f.16917324@news.playstation.co.uk> NNTP-Posting-Host: ld03-075.lon.compuserve.com X-Newsreader: Microsoft Outlook Express 4.72.3110.1 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Khan <2bad@lineone.net> wrote in message <35f2c71f.16917324@news.playstation.co.uk>... >But I am still stuck with adding a 2D background to my 3D racing game. >I've got George Bain's stuff but thats just for displaying sprites, >isnt it? Well I must admit I havn't read through all of Georges stuff, but I know for certain there is some code that shows how to use the BG functions ( there was a bit of controversy on this code about a month ago amongst Yarozers) keep looking. >By the way I made some added a backrond code to my game, which >compiles and links ok but when the auto file tells it to go it >freezes. I really dont know whats going wrong. Did it work before you added the code ?? Golden rule number 1 in coding - _always_ check the last thing you did, & work back when things stop working. You may have run out of packet space, try increasing the size of your packet area. >Sorry about the messy code! no probs, - why not stick your entire project on your web site for us to look at, I find bugs easier to find with a debugger, don't worry no one here is going to steal your ideas. The one thing that really stands out a mile is the way you typedef your structures. for instance : >typedef struct > > long numberObjects; > GsDOBJ2 Object_Handler[GROUND_MAX_OBJECTS]; > GsCOORDINATE2 Object_Coord[GROUND_MAX_OBJECTS]; > u_long *Back_Pointer[GROUND_MAX_OBJECTS]; > u_long *Object_Pointer[GROUND_MAX_OBJECTS]; > } Track_Header0,Track_Header1,Track_Header2,Track_Header3,Track_Header4; >Track_Header0 TrackData; // create instance of structure for use >Track_Header1 Track1Data; >Track_Header2 Track2Data; >Track_Header3 Track3Data; >Track_Header4 Track4Data; You've created 5 different typedefs for the same structure typedef struct { long numberObjects; GsDOBJ2 Object_Handler[GROUND_MAX_OBJECTS]; GsCOORDINATE2 Object_Coord[GROUND_MAX_OBJECTS]; u_long *Back_Pointer[GROUND_MAX_OBJECTS]; u_long *Object_Pointer[GROUND_MAX_OBJECTS]; } Track_Header0; Track_Header0 TrackData; // create instance of structure for use Track_Header0 Track1Data; Track_Header0 Track2Data; Track_Header0 Track3Data; Track_Header0 Track4Data; is a lot more readable. As I said earlier it would be easier to diagnose the problem with your code if we can see it in action. Nick S