Path: chuka.playstation.co.uk!news From: ScoTT Campbell Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: LoadImaga and FntPrint Date: Sat, 03 Oct 1998 18:10:20 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 62 Message-ID: <36165A7C.773C47C2@escotia.freeserve.co.uk> References: <6ug1n0$ja96@chuka.playstation.co.uk> <6uidgd$ja915@chuka.playstation.co.uk> <360CCEB5.F14D6B01@scee.sony.co.uk> NNTP-Posting-Host: 200-121-39.ipt.aol.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.05 [en] (Win95; I) I'm trying to use MoveImage() to create a tiled background. The solutuion you give does work, but I'm totally confused as to why. Also, I want to clear the screen every loop since the background will not take up the whole screen, so how would I do that? If I use GsSortClear() I clear away what I've just moved in. Cheers ScoTT James Russell wrote: > Ok, solved. > > The problem is twofold: > > 1) You are LoadImaging the image into the right area at the wrong time. > 2) You were doing a GsSortClear, which is only necessary if you are using a large image as the > background. > > This meant that you were clearing the screen, drawing the drawing the debug text, then loading the > image over the top of it all. > > The GsDRAWENV variable holds information about the CURRENT drawing area. This can get quite > confusing, because the current drawing area (which is what the GPU is using), is NOT the same as the > area which the CPU is building its packets for in the OT. Remember, the screen is displaying buffer > X, the GPU's drawing area is set to buffer 1-X, and the CPU is building packets up for the new > buffer X. The following code works fine: > > Maurice Sibrandi wrote: > > > > GsClearOt(0, 0, &otWorld[nActiveBuf]); // Clear the OT for buffer X > > > > FntPrint(nFontstream[0], "~c090No problem : this text is visible"); > > > > // Create packets and sort objects in here... > > > > // wait for end of non-blocking routines and wait for vsync > > DrawSync(0); > > VSync(0); > > GsSwapDispBuff(); > > // Load in the new background > > setRECT(&rc, 0, GsDRAWENV.clip.y, imgBack.pw, imgBack.ph); > > LoadImage(&rc, imgBack.pixel); > > // Draw the new objects on top of the background > > GsDrawOt(&otWorld[nActiveBuf]); > > // Draw the debug info on top of that. > > FntFlush(-1); > > Cheers, > > James > > -- > == James_Russell@scee.sony.co.uk +44 (171) 447-1626 > == Developer Support Engineer - Sony Computer Entertainment Europe > > A cynic smells flowers and looks for the casket.