Path: chuka.playstation.co.uk!news From: "Rikki Prince" Newsgroups: scee.yaroze.freetalk.english Subject: Re: Own BG with GsSPRITES Date: Sat, 20 Jul 2002 11:20:32 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 71 Message-ID: References: <01c22fc7$fedba4c0$5087933e@pal-s-omnibook> NNTP-Posting-Host: pc-62-31-230-115-ba.blueyonder.co.uk X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.3018.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 "pal" wrote in message news:01c22fc7$fedba4c0$5087933e@pal-s-omnibook... > Cant find the bug. I'd suggest you post all files so that we can compile > and experiment with the nasty code. > > A few comments anyway: > > - is it on purpose that CreateMiniMap is not called here? Also, the > variable minimap in this function is initialised but never used. The only > part of the function which has an effect is MoveImage(&src,576,0). Yup, and old function, where I tried a different method, and it didn't work. I reused the main code and didn't get around to deleting that function. > - the line "mapcells.v = 16*0;" is commented out... so mapcells.v is not > properly initialised (you may expect it to be zero but it's not > guaranteed). OK. I'll see if that makes a difference. > - I'd recommend using named constants. 20 and 16 are evil, change them to > MAP_W, MAP_H or whatever. For ease of reading? This was only meant to be a brief test! I didn't expect I'd need all this help.. :-S > - using a 1d array is as Chris pointed out confusing. I can't see where the > trouble is with 2d arrays (see examples below), could you be more specific? > > init: > u_short rik_map_array[16][20] = > {1, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7}, > {2,10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 7, 7, 7}, Yeh, that was part laziness on my part, not wanting to add all those curly brackets. I eventually did it though. Not that it helped. Again, it's just a programming technique, and though I see your point that it could increase the likelyhood of errors, I'm sure the error is somewhere else.. > ... > arg: > myfunc(u_short[16][] array); > or myfunc(u_short** array); I said that, as it would have taken me hours to work out which pointer I wanted, especially as my original wrappers probably expected a pointer of some sort, and and and... Well no real reason, but I couldn't get my head around it at the time, and I didn't fancy trying, as it'd distract me from the problem at hand... As you'll see from my reply to my original post, it seems it may be a initialisation problem. I'm not sure now though, as my original method (the one I posted) only initialised the sprite once. I've written a test program which tries to initialise and display 5 sprites, and I can only display 3 before it stops running. If I only initialise 3, and display them multiple times (so 5 or 6 are actually being sorted) it works, so that would suggest the initialisation is to blame, but then why did the original method fail? Rikki