blurred d draw blitting (but only sometimes...)

Started by
3 comments, last by graeme 22 years ago
There are two screen grabs of a game I am busy cloning here: http://www.todayguide.com/mmscreen.gif The top one is grabbed from my friends computer, running under 16 bit monitor setting. The bottom is from my machine running at 16 bit display setting too. I am wondering why the sprites are so blurred on my one? I have tried the game on about 10 other machines and there have been no problems. Here''s the code which blits the baddy, for example: LPDIRECTDRAWSURFACE7 tempGuardian; DDRAW_INIT_STRUCT(ddbltfx); DDCOLORKEY ck; ck.dwColorSpaceLowValue = 0; ck.dwColorSpaceHighValue = 0; ddbltfx.ddckSrcColorkey=ck; for( i=0; i.processFrame())) LOG<<"Guard couldn''t process frame: init trouble"<.guardX; destR.bottom=(16*MAGNIFICATION)+guards.guardY; destR.right=(16*MAGNIFICATION)+guards.guardX; destR.top=guards.guardY; if (FAILED(lpddsback->Blt(&destR,tempGuardian,NULL,(DDBLT_WAIT|DDBLT_KEYSRCOVERRIDE),&ddbltfx))) LOG<<"blit fail guardian number:"<<i<<ENDL; Any ideas what is going on, because I haven''t a clue?! Thanks! </i>
Advertisement
Hmmm..from looking at your code I presume there i some scaling involved (Making the guy a little bigger)

From looking at the screenshot I gather that the sprite is linear interpolated.

So my guess is that while resizing, the little guy gets a bilinear filter.

As to why it only happens on some computeres I have no clue...

Maybe a hardware issue? What kind of computers are we talking here...

Maybe that helps figuring out the problem...



- Sleepwalker
- Sleepwalker
DirectDraw will use hardware functionality whenever possible. On some hardware, hardware blits are implemented with filtering when the surface is at least 16 bits per pixel. In other words, if you can ensure that your surfaces are all 8 bit, you''ll never see any filtering, irrespective of the display hardware. However, you might consider using the GDI for this game, considering the simple nature of the graphics. The GDI would be plenty fast and keep your program nice and small. Also, the GDI will not filter stuff if you use StretchBlt, unless you explicitly tell it to.
This is a great help, I''ll turn them into 8 bit sprites and try it after easter on my work machine (the one that causes the problems.)

What is a bilinear filter then?

By the way, I would have used GDI but I thought I''d try to learn a little bit about Direct X (although from what I''ve seen of DX8 learning DX7 DDraw will not help out in the long term!)
You can find more than I could possibly explain about bilinear filtering by searching on Google.

This topic is closed to new replies.

Advertisement