Jump to content

  • Log In with Google      Sign In   
  • Create Account

2D animation advice/tecnique


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 mickey   Members   -  Reputation: 100

Like
Likes
Like

Posted 12 January 2002 - 02:17 AM

hi! i''d like to do a 2d anim without blitting the background everytime i blit the sprite, how will i do that? thanks in advance!

Sponsor:

#2 mickey   Members   -  Reputation: 100

Like
Likes
Like

Posted 12 January 2002 - 02:19 AM

oh and one more thing, i alredy tried doing this by directly blitting to the primary surface but everytime my sprite moves, it left behind trails... hope you got the picture, thnkas again!

#3 mickey   Members   -  Reputation: 100

Like
Likes
Like

Posted 12 January 2002 - 04:23 PM

ei better yet, does dirty rectangles scheme solve my dilemma? it if does, pls provide a very short instruction,

#4 intrest86   Members   -  Reputation: 742

Like
Likes
Like

Posted 12 January 2002 - 04:28 PM

I don''t know why you would want to do this, but you could copy the rect of the background where you blit your character first, and then blit the copy back over that spot the next frame.

#5 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 13 January 2002 - 12:16 AM

hahaha that''s just what i did intrest86 thanks very much! do you know any other tecniques?



#6 mickey   Members   -  Reputation: 100

Like
Likes
Like

Posted 13 January 2002 - 12:16 AM

hahaha that''s just what i did intrest86 thanks very much! do you know any other tecniques?



#7 mickey   Members   -  Reputation: 100

Like
Likes
Like

Posted 13 January 2002 - 12:18 AM

and intres86, one more thing, why, doesn''t anybody really do this? do animation directly to the primary surface? doesn''t it make things a bit faster coz you don''t have to blit everything all else up?

#8 hammerstein_02   Members   -  Reputation: 134

Like
Likes
Like

Posted 13 January 2002 - 03:09 AM

Doesn''t that waste memory, catching the area of the screen you are about to move to. Computers are so fast now, blitting a background isn''t going to effect your performance that much. And if you have that much on screen that you think blitting the background will slow the refresh down, won''t wasting the memory holding a part of the screen by? Please correct me if I am wrong here.

#9 Darkor   Members   -  Reputation: 133

Like
Likes
Like

Posted 13 January 2002 - 03:24 AM

You''ll have to clear the screen. Obviously, the trails are left by the blitting of your sprite, which stays there until you clear it.

There are many ways to clear the screen but you''ll do fine blitting an entire background. I don''t know what API you''re using, so I can''t tell you how to clear the screen exactly.

Do not blit to the primary surface directly, because, this is being accessed by the hardware. Thus, your scene might appear on screen before it''s done. This might not be a problem today on a small game. But it will cause flickering or something, especially on older computers runing a demanding game. Just blit to the back buffer and flip it when you''re ready.

#10 mickey   Members   -  Reputation: 100

Like
Likes
Like

Posted 14 January 2002 - 02:05 AM

okey guys thanks!!!

yes, the blitting is very very very fast, so there no problem blitting everything else all up! (of course, like darkor said, to the backbuffer)

am using api, we use the DDBLTFX structure to do a colorfill,

#11 mickey   Members   -  Reputation: 100

Like
Likes
Like

Posted 14 January 2002 - 02:05 AM

okey guys thanks!!!

yes, the blitting is very very very fast, so there no problem blitting everything else all up! (of course, like darkor said, to the backbuffer)

am using DX, we use the DDBLTFX structure to do a colorfill,




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS