DD scrollling background source?

Started by
5 comments, last by zoomcrypt 22 years, 10 months ago
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
SkullOne - Hero Interactivehttp://www.hero-interactive.com
Advertisement
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.
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.

SkullOne - Hero Interactivehttp://www.hero-interactive.com
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!
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..
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.
SkullOne - Hero Interactivehttp://www.hero-interactive.com
Are you clipping the surface?????


I AM ALPHA & OMEGA
I AM ALPHA & OMEGA

This topic is closed to new replies.

Advertisement