Path: chuka.playstation.co.uk!news From: "Rikki Prince" Newsgroups: scee.yaroze.freetalk.english Subject: Re: Own BG with GsSPRITES Date: Fri, 19 Jul 2002 14:40:38 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 50 Message-ID: References: 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 "Chris Wallace" wrote in message news:ah93j0$jcc15@www.netyaroze-europe.com... > for(j=0; j<2; j++) file://16 > { > mapcells.y = j*8+100; > > for(i=0; i<2; i++) file://20 > { > a = rik_map_array[(20*j)+i]; > > mapcells.u = 16*a; > file://mapcells.v = 16*0; > mapcells.x = i*8+100; > GsSortSprite(&mapcells, rpOTS(thisGame), 0); > } > } > > ok im a little confused with it so im going to type here while i think over > it, as i've made a BG out of sprites before and it seemed to work ok. > > right, first thing making it difficult is that your using a 1D array for a > grid, if it were defind array[20][16] then it would make it all alot easier. > x would just be j*TILE_SIZE y would i*TILE_SIZE and im not going thru > what everything would me cos i cast remember without looking but the 1D > array is making me confused. I'll look at the code again later and see if i > can spot the errors. I've left it lovely and confusing, haven't I? My 1D array is something to do with my wrapper code, and it just seems easier passing a pointer to a 1D than a 2D. That and block initialising a 1D array is easier. I'll try changing it to see if anything starts working. Another point - it's multiplying by 8 (rather than 16) to place the next sprite along, as I'm scaling the sprites down to half their size (ONE/2 in an earlier part of the code) and as I changed their centres to the midpoint, I'm adding 100 to get them on the screen. :-S Cheers, Rikki