Path: chuka.playstation.co.uk!news From: Christoph Luerig Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: tiled background Date: Wed, 01 Apr 1998 11:21:02 +0200 Organization: PlayStation Net Yaroze (SCEE) Lines: 51 Message-ID: <352206FD.69CAF71@immd9.informatik.uni-erlangen.de> References: <350E9D4D.4E08@telecom.at> NNTP-Posting-Host: faui90.informatik.uni-erlangen.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.04C-SGI [en] (X11; I; IRIX 6.3 IP32) Hello Harald! I stumbled over the background problem also and there have been some threads around here, where quite a few peoples said, to use sprites instead. Thats the way I also did it. To generate the background I actually use three ordering tables. One table is for the scene without the backgorund, with a high z resolution, one table is for the background with a low z resolution, as is the ordering table for the complete scene. You could initialize the ordering tables as follows: GsClearOt(0,0,&ForeGround[ActiveBuffer]); GsClearOt(0,1,&BackGround[ActiveBuffer]); GsClearOt(0,0,&CompleteScene[ActiveBuffer]); The second parameter in the background initialization indicates, that the background should appear behind the foreground. You sort every primitive you want to draw normally into the ForeGround Buffer. In order to generate the background, you initialize a sprite for every different tile in advance. These sprites are then sorted into the Background Buffer with GsSortSprite or GsSortFastSprite, depending on the effects you would like to achieve. If one image tile is displayed several times in the background, you can use the same sprite structure and just change the x,y coordinates before sorting the sprite into the Background Buffer. If you have generated the background and the fore ground, you compose the result by sorting these tables into the Compelte Scene by GsSortOt(&ForeGround[ActiveBuffer],&CompleteScene[ActiveBuffer]); GsSortOt(&BackGround[ActiveBuffer],&CompleteScene[ActiveBuffer]); Finally you can draw the complete scene by GsDrawOt(&CompleteScene[ActiveBuffer]); Harald Ploch wrote: > Hi! > > How to I render a tiled background. I found out that there is a GsBG > structure (GsMAP, GsCELL) and I initialized it, but I don't know how to > render it. I don't want to use GsSortFixBg16(...). > > Please Help!!!! > > Thanx, > > Harald. Christoph Luerig