From: "A. Jans-Beken" Newsgroups: comp.os.msdos.djgpp Subject: Re: Very fast allegro blitting Date: Mon, 03 Jan 2000 23:56:44 -0800 Organization: World Access Lines: 31 Message-ID: <3871A7BC.F317063F@wxs.nl> References: <386A9193 DOT 124D022D AT ozemail DOT com DOT au> <84q027$mg2$1 AT the-fly DOT zip DOT com DOT au> NNTP-Posting-Host: vl0874-1.dial.wxs.nl Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: reader2.wxs.nl 946940197 1668104 195.121.203.106 (3 Jan 2000 22:56:37 GMT) X-Complaints-To: abuse AT wxs DOT nl NNTP-Posting-Date: 3 Jan 2000 22:56:37 GMT X-Mailer: Mozilla 4.7 [en-gb] (Win98; I) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com SimonK wrote: > The blit function is pretty fast, damn thing is all in asm i think. I > wouldn't bother rewriting it. In this case a low-resolution screen is used, and perhaps there is room in the video memory for an alternate screen. I have understood that allegro supports video-cards with hardware-acceleration, and blitting from video-memory to video-memory (done by accelerated video hardware) should be considerable faster then the build-in blit_from_memory_to_video_memmory function. A second idea that I once proposed in this: When doing animations with sprites or bitmaps: 1 Create a BITMAP 2 Draw the OLD situation in this bitmap 3 Create a second BITMAP 4 Draw the NEW situation in this bitmap 5 Create a third BITMAP = OLD - NEW 6 Masked-blit this bitmap to the screen The trick is in the OLD-NEW operator. It blanks all pixels that are the same color in both the NEW and OLD situation. Only pixels where really new content appears will be blitted. The OLD-NEW operator should be written in assembler (to difficult for me). Maybe it is even possible to use MMX or hardware accelerated functionality. However I tested this algo in plain C some time ago and it really works very smooth.