Blt problem

Started by
7 comments, last by lshadow 24 years, 3 months ago
Hmm if your blitting 32x32 tiles wouldnt you move up by 32pixels not one? As far as your problem goes i dont know. Maybe try setting up the rect the standered way(rect.left,right so on).
Advertisement
If I was moving the tiles I would move them by 32 right. But I'm not moving the tiles, I'm just trying to blit one in the upper left corner, but the blitter has a mind of it's own. On the left is what I'm trying to blit at 0,0 (at 1,0 and 0,1 it blits correctly, just not at 0,0), and on the right is what I'm getting (except it goes all the way across the screen in that pattern).

http://hometown.aol.com/lshadow27/index.html

Any ideas what it could be?


[This message has been edited by lshadow (edited December 19, 1999).]

[This message has been edited by lshadow (edited December 19, 1999).]

Working on: DoP
Since it's a 32x32 should the rc be equal to {0,0,31,31} since 0 is included? unless you have an edge along the top and left? Does this help?

Good Luck


I don't think that works because isn't the right/bottom numbers both "excluded". So setting up as (0,0,32,32) includes (0,0,31,31).

------------------
Still Learning...

Still Learning...
the blitter index is always off by one. start at 0,0 and go to 31,31. Also try using twi different rects for source and dest (maybe the DX call does something funky to the rectangles that you pass in....after all, it asks for a pointer so you never know!)
I think your code should look more like this:
lpddsback->Blt(&rc,lpdds,NULL,DDBLT_WAIT,NULL);
This guarentees that your source rectangle is within bounds of the source bitmap. Your RECT rc= {0,0,32,32} looks fine. I suppose you could always check to make sure your vid drivers are the latest. DX drivers get screwed up from version to version a lot.


------------------
--Shannon, BLAZE Technologies, Inc.

[This message has been edited by blaze (edited December 21, 1999).]

--Shannon Schlomer, BLAZE Technologies, Inc.
If I could see the code I could probably find the problem. If you want, just email it to me.

kjrockot@att.net

I'm trying to blit a 32x32 tile to the back buffer, but when I blit it to a certain area I get some unwanted and confusing output. Here is the code:

RECT rc = {0,0,32,32};
lpddsback->Blt(&rc,lpdds,&rc,DDBLT_WAIT,NULL);

If I move the RECT to {0,1,32,33} it displays fine. The output is kinda crazy, and I don't understand it at all.

The output should just be one bitmap in the upper left corner instead of 20 bitmaps across the screen each moved up by one pixel. Go here to see what I mean.

http://hometown.aol.com/lshadow27/index.html

...the first bitmap is displayed, then it outputs another one moved up 1 on the y axis, and then another moved up 1 on the y axis, all the way across the screen.

If anyone has any clue of what I'm talking about I could use some help!!!

Thanks.

(I keep forgetting about the ubb and html code!)

[This message has been edited by lshadow (edited December 19, 1999).]

Working on: DoP
Yeah sounds like a driver problem to me, or maybe a funky display mode. Are you using windowed mode or full screen? Or if in full screen, what resolution & bit depth? What kind of card? I also wouldn't mind checking out the code unless Coder++ has figured it out already :-)
-ns
-ns-

This topic is closed to new replies.

Advertisement