Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: Elliott Lee Newsgroups: scea.yaroze.programming.2d_graphics Subject: Re: Big Sprite ? Date: Tue, 10 Mar 1998 14:41:39 -0800 Organization: Cisco Systems Lines: 97 Message-ID: <3505C1A3.29CCEC4E@netmagic.net> References: <35047742.522A@hotmail.com> <3504AF57.559F@concentric.net> <35050925.6C5B@hotmail.com> Reply-To: tenchi@cisco.com NNTP-Posting-Host: dhcp-e-39-245.cisco.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.03 [en] (Win95; U) Well, there is one visual effect that you can take advantage of by doing it this way: you could use it to make the background "fly" apart at the end of the game, or you could make it bounce together in the beginning. e.g. suppose you loaded the background into sprites BGLeft and BGRight each being 160x240, had an OT with 1<<14 levels, and were dealing with 320x240 res: void BgBounce( void ) { int x_vel = 0; // set sprites to be off the edge of the screen BGLeft.x = -160; BGRight.x = 160-BGLeft.x; BGLeft.y = 0; BGRight.y = 0; while( x_vel!=0 && BGLeft.x!=0 ) { // do the buffer switch and clear the ordering table // (you may do it differently) activeBuff = GsGetActiveBuff(); GsSetWorkBase((PACKET *)GpuPacketArea[activeBuff]); GsClearOt(0,0,&WorldOT[activeBuff]); // accellerate the graphic towards 0. if( BGLeft.x<0 ) x_vel++; // add the velocity to current position BGLeft.x += x_vel; // make sure we don't pass 0! if( BGLeft.x>0 ) { // reverse thrust! also minimize the effect by about 2/3 x_vel= 0-((x_vel*2)/3); // reset the "ground" level BGLeft.x = 0; } // if( BGLeft.x>0 ) // mirror the effect to the right sprite BGRight.x = 160-BGLeft.x; // paint the sprites into the background GsSortFastSprite( &BGLeft,&WorldOrderTable[activeBuff],1<<14 ); GsSortFastSprite( &BGRight,&WorldOrderTable[activeBuff],1<<14 ); // // *** insert other drawing stuff here... *** // // draw to buffer DrawSync(0); VSync(0); GsSwapDispBuff(); GsSortClear(0,0,0,&WorldOrderTable[activeBuff]); GsDrawOt(&WorldOrderTable[activeBuff]); } // while( x_vel!=0 && BGLeft.x!=0 ) } I dunno if the above works---I haven't tested it---but I use something similar in my current project. ^_^ - e! tenchi@netmagic.net http://www.netmagic.net/~tenchi/yaroze/ Alex wrote: > > Scott Cartier wrote: > > > > Alex, > > > > The maximum size for a sprite is 256x256 so you'll need to break it > > up into two sprites. > > > > Scott > > But there is no other way to have a BIG image in background?! > I *MUST* set up a Sprite ? :( uh! > > > > > > Now another prob.. ;( > > > > > > In my game i must set a big picture in the background (320*240)! > > > > > > I defined this as a Sprite set to position 0,0! > > > But at the edges the image was screwed up :( > > > > > > is there an other way to put this BIG picture in the background else > > > than to define it as a Sprite ?! > > > > > > Alex.