Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: Elliott Lee Newsgroups: scee.yaroze.programming.2d_graphics,scee.yaroze.beginners,scea.yaroze.programming.2d_graphics Subject: Re: Need help with arrays Date: Tue, 18 Aug 1998 15:38:07 -0700 Organization: Cisco Systems Lines: 59 Message-ID: <35DA024F.10FF8B2B@jps.net> References: <6rcfhe$l2e4@chuka.playstation.co.uk> Reply-To: tenchi@jps.net NNTP-Posting-Host: dhcp-m-62-238.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) Xref: chuka.playstation.co.uk scee.yaroze.programming.2d_graphics:518 scee.yaroze.beginners:506 scea.yaroze.programming.2d_graphics:401 Weird. I don't know what you're trying to accomplish either, but try this? What is the effect you want? Static? #include #include #include u_short scr[240][320]; u_short line[640]; void main(void) { RECT screen; short counter; SetVideoMode(MODE_PAL); GsInitGraph(320, 240, 4, 0, 0); GsDefDispBuff(0, 0, 0, 0); screen.x = screen.y = 0; screen.h = 240; screen.w = 320; // setup first array for( counter = 0; counter < 640; counter++) { // set pixels to black or white line[counter] = (1<<15); if( rand()%2 ) { line[counter] += (31<<10) + (31<<5) + 31; } } // for( counter = 0; counter < 640; counter++) while(1) { VSync(0); // copy 640 bytes (320 u_shorts/ints): // // scr[][] dereferences to a memory location. // scr[] is a pointer to the final [] array // scr is a pointer to the [] pointer to the final [] // for(counter = 0; counter < 240; counter++) { memcpy( scr[counter], line[rand()%320], 640 ); } LoadImage( &screen, *scr ); DrawSync(0); GsSwapDispBuff(); } // while(1) ResetGraph(0); } // void main(void) -- Mata ne, ... ... - e! ::' tenchi@shell.jps.net ':: (Protocol) :: ACiD -/- ACS -/- pHluid -/- Yaroze -/- Nemesis :: (Tenchikun) ::. http://www.jps.net/tenchi .:: ''' '''