What is the fastest way to make animation - Programmers Heaven

Howdy, Stranger!

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

Categories

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.