Archived

This topic is now archived and is closed to further replies.

zoomcrypt

DD scrollling background source?

Recommended Posts

ok this is really dumb, but for some reason i can''t get my scrolling background code to work. the .bmp is 2400X600 but when i try and scroll a 800X600 window a cross it, it doesn''t work. Myabe i''m reading the .bmp in wrong or something. anyone have a sample of similar that i can take a look at? SkullOne

Share this post


Link to post
Share on other sites
Post some code. Also, are you loading the .bmp into a single surface? Because, as a general rule of thumb, you shouldn''t load surfaces (in video memory at least) that are larger than the largest screen resolution. Maybe that aspect is messing up.

Share this post


Link to post
Share on other sites
hmm....yeah. loading into a single SURFACE. How does that cause problems? The blit says invalid rect values when the sourceRect coordinates are larger thann the screeen size.

the screen size is 800X600
bmp loaded to a 2400X600 surface.
so when i try to blit from the larger surface the right side is greater than 800 it fails to blit cause of invalid rect values.


What am i not understanding here.

Share this post


Link to post
Share on other sites
Many videocards will not allow surfaces in video memory that are larger than the primary surface, so that could very well be the problem. Use DD_USESYSTEMMEMORY or similar flag to specify that you want it stored in normal ram.

Other than that... have you modified your source rectangle appropriately? I''m guessing yes, but need to be sure. Also, the dest rectangle will always be 0,0,800,600 so there''s no need to change that...

But yes, post some (small amount) of code, so we can examine it.

/me dons the surgical gloves!

Share this post


Link to post
Share on other sites
whoah didn''t see your post there... identical timing =) Remember that the sourcrect coords must be only 800 in width, ie if you add 100 to the Right you must add 100 to the left...


... maybe you are not doing this but your post was a bit unclear..

Share this post


Link to post
Share on other sites
ok think i found it. stupid code i copied had hard coded the surfaces that they were loading the background into with the dimensions of the screeen. let me try and fix this first thanks for all the help.

Share this post


Link to post
Share on other sites