Demo programming

Moderators: None (Apply to moderate this forum)
Number of threads: 151
Number of posts: 333

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Edit Report
What is the fastest way to make animation Posted by René on 4 Mar 1999 at 3:51 PM
I have tried to use this method, to do animation.<p>
1: Draw background to Virtual screen 2<br>
2: flip Virtual screen 2 into virtual screen 1<br>
3: Draw sprite to Virtual Screen 1<br>
4: Flip Virtial screen 1 to VGA<br>
5: Repeat from 2<p>
It is slow with only one sprite, and when i have about 3 sprites, it is totally useless. I have tried some other, but they are also getting slow, when i have more than 2 objects. Maybe it's just my routines that is slow, but what is the fastest way to make animation with lots of objects. <br>
Without destroying the background ofcourse.<p>
Thanks.<br>



Edit Report
Re: What is the fastest way to make animation Posted by Black on 8 Mar 1999 at 2:31 AM
: I have tried to use this method, to do animation.<p>
: 1: Draw background to Virtual screen 2<br>
: 2: flip Virtual screen 2 into virtual screen 1<br>
: 3: Draw sprite to Virtual Screen 1<br>
: 4: Flip Virtial screen 1 to VGA<br>
: 5: Repeat from 2<p>
: It is slow with only one sprite, and when i have about 3 sprites, it is totally useless. I have tried some other, but they are also getting slow, when i have more than 2 objects. Maybe it's just my routines that is slow, but what is the fastest way to make animation with lots of objects. <br>
: Without destroying the background ofcourse.<p>
: Thanks.<p>
I've done some animations too. I dont know about<br>
the fastest method but I did it like this:<br>
1) Draw Background to Vscr1<br>
2) Draw Objects to Vscr1<br>
3) Vscr1->VGA<br>
It's quite similar. There are some optimizations<br>
you can make however. You can make a new memcpy()<br>
function that copies memory in 4 byte-chunks!<br>
This works only in 486+ machines and you must <br>
know some external assembly...<br>
The original memcpy() uses only 1 byte transfers.<br>
Your DrawSprite is probably too slow too...<br>
Did u use shifts when calculating offsets?<br>
offset=x+y*320; --> offset=x+y<<8+y<<6;<br>
<br>
<br>
<br>



Edit Report
Re: What is the fastest way to make animation Posted by Black on 8 Mar 1999 at 2:31 AM
: I have tried to use this method, to do animation.<p>
: 1: Draw background to Virtual screen 2<br>
: 2: flip Virtual screen 2 into virtual screen 1<br>
: 3: Draw sprite to Virtual Screen 1<br>
: 4: Flip Virtial screen 1 to VGA<br>
: 5: Repeat from 2<p>
: It is slow with only one sprite, and when i have about 3 sprites, it is totally useless. I have tried some other, but they are also getting slow, when i have more than 2 objects. Maybe it's just my routines that is slow, but what is the fastest way to make animation with lots of objects. <br>
: Without destroying the background ofcourse.<p>
: Thanks.<p>
I've done some animations too. I dont know about<br>
the fastest method but I did it like this:<br>
1) Draw Background to Vscr1<br>
2) Draw Objects to Vscr1<br>
3) Vscr1->VGA<br>
It's quite similar. There are some optimizations<br>
you can make however. You can make a new memcpy()<br>
function that copies memory in 4 byte-chunks!<br>
This works only in 486+ machines and you must <br>
know some external assembly...<br>
The original memcpy() uses only 1 byte transfers.<br>
Your DrawSprite is probably too slow too...<br>
Did u use shifts when calculating offsets?<br>
offset=x+y*320; --> offset=x+y<<8+y<<6;<br>
<br>
<br>
<br>



Edit Report
Re: What is the fastest way to make animation Posted by Beregorn_ on 9 Mar 1999 at 6:10 PM
486+, i believe not, the 386 was 32 bit and could accomplish 4 byte moves easily!<br>
: : I have tried to use this method, to do animation.<p>
: : 1: Draw background to Virtual screen 2<br>
: : 2: flip Virtual screen 2 into virtual screen 1<br>
: : 3: Draw sprite to Virtual Screen 1<br>
: : 4: Flip Virtial screen 1 to VGA<br>
: : 5: Repeat from 2<p>
: : It is slow with only one sprite, and when i have about 3 sprites, it is totally useless. I have tried some other, but they are also getting slow, when i have more than 2 objects. Maybe it's just my routines that is slow, but what is the fastest way to make animation with lots of objects. <br>
: : Without destroying the background ofcourse.<p>
: : Thanks.<p>
: I've done some animations too. I dont know about<br>
: the fastest method but I did it like this:<br>
: 1) Draw Background to Vscr1<br>
: 2) Draw Objects to Vscr1<br>
: 3) Vscr1->VGA<br>
: It's quite similar. There are some optimizations<br>
: you can make however. You can make a new memcpy()<br>
: function that copies memory in 4 byte-chunks!<br>
: This works only in 486+ machines and you must <br>
: know some external assembly...<br>
: The original memcpy() uses only 1 byte transfers.<br>
: Your DrawSprite is probably too slow too...<br>
: Did u use shifts when calculating offsets?<br>
: offset=x+y*320; --> offset=x+y<<8+y<<6;<br>
: <br>
: <br>
: <p>






 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.