Path: chuka.playstation.co.uk!news From: "Colin Hughes" Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: Scrolling backgrounds Date: Fri, 10 Jul 1998 16:45:25 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 46 Message-ID: <6o5dgf$9o6@chuka.playstation.co.uk> References: <6nvfvm$9o1@chuka.playstation.co.uk> NNTP-Posting-Host: camfw01.millennium.co.uk X-Newsreader: Microsoft Outlook Express 4.72.2106.4 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Hi, The most efficent way would be be perform the scroll as 2 moveimages.... Assuming scroll from left to right, with screen 256 wide and background at 512x MoveImage (512,0)->(0,0) 256 wide First scroll LoadImage new line at 512,0 to 512,239 ( Assume 240 deep ) MoveImage (512+1,0)->(0,0) 255 wide MoveImage (512,0)->(255,0) 1 wide Second scroll Loadimage new line at 512+1,0 MoveImage (512+2,0)->(0,0) 254 wide MoveImage (512,0)->( 256-2,0) 2 wide etc etc etc... Colin Mark Green wrote in message <6nvfvm$9o1@chuka.playstation.co.uk>... > I am trying to create a 2D scrolling cloud-type background that is >automatically generated by an algorithm. I have the algorithm to generate >the next line to be scrolled on given the previous line, but I am having >some problem making the scrolling itself happen. > It would seem to make sense that I should hold the background somewhere >in video RAM, scroll and update it there then copy it to the frame buffer. >Unfortunately this seems to be very inefficient (requiring two full-screen >blits per frame, one to scroll the buffer and another to copy it to the frame >buffer) and will not work with the non-blocking operations anyway since the >scroll must be assured complete before the copy can take place. > I am sure that there is a more efficient way of doing this type of thing >but it is eluding me at the moment :) Can anyoone give me any pointers?