Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: mperdue@hrtc.net (Mario Perdue) Newsgroups: scea.yaroze.programming.2d_graphics Subject: Re: Backgrounds Date: Tue, 19 Aug 1997 03:23:51 GMT Organization: SCEA News Server Lines: 69 Message-ID: <33f91153.15986403@205.149.189.29> References: <33F8FC3F.726E@concentric.net> NNTP-Posting-Host: firewall.hrtc.net X-Newsreader: Forte Free Agent 1.1/32.230 Scott, I just took a quick look and noticed that you don't have a DrawSync() before your VSync(). Try adding: DrawSync(0); just before your VSync() call. Mario On Mon, 18 Aug 1997 18:51:59 -0700, Scott Cartier wrote: >I'm having trouble with my background. It flickers - like it's >only being drawn every other frame. I'm using 640x480 and when >I switch to low resolution it works fine. I'm wondering if >there is something obvious I'm doing wrong. Here's a general >outline of my program. Is there anything that jumps out as >being incorrect (assuming I've initialized the cells and map >data)? > > #define H_RES 640 > #define V_RES 480 > > u_short backgnd_array[64 * 64]; // Max of 64 by 64 background > GsCELL backgnd_cells[2]; // Only 2 cells for now > GsMAP backgnd_map; > GsBG backgnd; > u_long backgnd_workarea[(((H_RES >> 4) + 1) * ((V_RES >> 4) + 1 + 1) * >6 + 4) * 2 + 2]; > > backgnd.attribute = 0; > backgnd.x = 0; > backgnd.y = 0; > backgnd.w = H_RES; > backgnd.h = V_RES; > backgnd.scrollx = 0; > backgnd.scrolly = 0; > backgnd.r = backgnd.g = backgnd.b = 0x80; > backgnd.map = map; > backgnd.mx = backgnd.my = 0; > backgnd.scalex = backgnd.scaley = ONE; > backgnd.rotate = 0; > > GsInitFixBg16(&backgnd, backgnd_workarea); > > while (pad_state[PAD_SELECT] == 0) { // Main loop > > activeBuff = GsGetActiveBuff(); > GsSetWorkBase((PACKET *)GpuPacketArea[activeBuff]); > GsClearOt(0, 0, &WorldOT[activeBuff]); > > pad_read(); > > GsSortFixBg16(&backgnd, >backgnd_workarea[activeBuff], WorldOT[activeBuff], >OT_BACKGND); > > cnt = VSync(0); > ResetGraph(1); > GsSwapDispBuff(); > GsSortClear(0, 0, 0, &WorldOT[activeBuff]); > GsDrawOt(&WorldOT[activeBuff]); > } > >Scott