• Advertisement

Archived

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

Too Slow for Just blitting

This topic is 5687 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am making a Tile-based rpg and I am having some problems with the pixel * pixel scrolling engine. It works just fine but in my opnion it should be going alot faster. Here is the code i am using. void MAP::DrawMap() { RECT rct; int x,y; int xcount,ycount; for (y=ScrollYValuemin;y { rct.top=TileDescY[MapY[ScrollXValuemin][y]]; rct.left=TileDescX[MapX[ScrollXValuemin][y]]+PixelScrollValueX; rct.bottom=TileDescY[MapY[ScrollXValuemin][y]]+16; rct.right=TileDescX[MapX[ScrollXValuemin][y]]+16;//+(16-PixelScrollValueX); Back->BltFast(0,y*16,Map_Surface,&rct,DDBLTFAST_WAIT); xcount=0; for (x=(ScrollXValuemin);x { for (y=ScrollYValuemin;y { rct.top=TileDescY[MapY[x][y]]; rct.left=TileDescX[MapX[x][y]]; rct.bottom=TileDescY[MapY[x][y]]+16; rct.right=TileDescX[MapX[x][y]]+16; Back->BltFast(xcount-(PixelScrollValueX),y*16,Map_Surface,&rct,DDBLTFAST_WAIT); } xcount+=16; } } Is there any major way this code can be optimized. I tested it on another (slower) computer and it seemed to run faster. Here are the specs for the two comps i tested on. mine: Intel PIII @ 1.1 ghz GeForce 4 mx 420 w/63mb 256 mb pc133 ram WinXP Home The other comp: AMD Duron @700 mhz vanta w/8mb of ram 256 mb pc133 ram WinME. Any Help will be apprectiated. "Computers are only as smart as their programers" My Site-> Still working on it.

Share this post


Link to post
Share on other sites
Advertisement
http://www.gamedev.net/community/forums/topic.asp?topic_id=106123

Share this post


Link to post
Share on other sites
Yes i am using dd7 but that doesn''t matter seeing as how the ddraw example that was included in the 8.1 sdk also uses dd7 and goes faster.

"Computers are only as smart as their programers"
My Site-> Still working on it.

Share this post


Link to post
Share on other sites
Try using triple and and quad buffering if the memory returns on the blt operations aren''t to big. i.e. Loading lots of large bitmaps

Share this post


Link to post
Share on other sites

  • Advertisement