Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

What is the fastest way to make animation

I have tried to use this method, to do animation.


1: Draw background to Virtual screen 2

2: flip Virtual screen 2 into virtual screen 1

3: Draw sprite to Virtual Screen 1

4: Flip Virtial screen 1 to VGA

5: Repeat from 2


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.

Without destroying the background ofcourse.


Thanks.




Comments

  • : I have tried to use this method, to do animation.


    : 1: Draw background to Virtual screen 2

    : 2: flip Virtual screen 2 into virtual screen 1

    : 3: Draw sprite to Virtual Screen 1

    : 4: Flip Virtial screen 1 to VGA

    : 5: Repeat from 2


    : 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.

    : Without destroying the background ofcourse.


    : Thanks.


    I've done some animations too. I dont know about

    the fastest method but I did it like this:

    1) Draw Background to Vscr1

    2) Draw Objects to Vscr1

    3) Vscr1->VGA

    It's quite similar. There are some optimizations

    you can make however. You can make a new memcpy()

    function that copies memory in 4 byte-chunks!

    This works only in 486+ machines and you must

    know some external assembly...

    The original memcpy() uses only 1 byte transfers.

    Your DrawSprite is probably too slow too...

    Did u use shifts when calculating offsets?

    offset=x+y*320; --> offset=x+y<<8+y<<6;<br>









  • : I have tried to use this method, to do animation.


    : 1: Draw background to Virtual screen 2

    : 2: flip Virtual screen 2 into virtual screen 1

    : 3: Draw sprite to Virtual Screen 1

    : 4: Flip Virtial screen 1 to VGA

    : 5: Repeat from 2


    : 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.

    : Without destroying the background ofcourse.


    : Thanks.


    I've done some animations too. I dont know about

    the fastest method but I did it like this:

    1) Draw Background to Vscr1

    2) Draw Objects to Vscr1

    3) Vscr1->VGA

    It's quite similar. There are some optimizations

    you can make however. You can make a new memcpy()

    function that copies memory in 4 byte-chunks!

    This works only in 486+ machines and you must

    know some external assembly...

    The original memcpy() uses only 1 byte transfers.

    Your DrawSprite is probably too slow too...

    Did u use shifts when calculating offsets?

    offset=x+y*320; --> offset=x+y<<8+y<<6;<br>









  • 486+, i believe not, the 386 was 32 bit and could accomplish 4 byte moves easily!

    : : I have tried to use this method, to do animation.


    : : 1: Draw background to Virtual screen 2

    : : 2: flip Virtual screen 2 into virtual screen 1

    : : 3: Draw sprite to Virtual Screen 1

    : : 4: Flip Virtial screen 1 to VGA

    : : 5: Repeat from 2


    : : 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.

    : : Without destroying the background ofcourse.


    : : Thanks.


    : I've done some animations too. I dont know about

    : the fastest method but I did it like this:

    : 1) Draw Background to Vscr1

    : 2) Draw Objects to Vscr1

    : 3) Vscr1->VGA

    : It's quite similar. There are some optimizations

    : you can make however. You can make a new memcpy()

    : function that copies memory in 4 byte-chunks!

    : This works only in 486+ machines and you must

    : know some external assembly...

    : The original memcpy() uses only 1 byte transfers.

    : Your DrawSprite is probably too slow too...

    : Did u use shifts when calculating offsets?

    : offset=x+y*320; --> offset=x+y<<8+y<<6;<br>
    :

    :

    :





Sign In or Register to comment.