Skip to main content
GameDev.net gamedev.net
🔒 Locked

Blt problem

Started by lshadow Dec 23, 1999 at 10:11 AM 7 replies 1.1k views
Original Post
lshadow
lshadow
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
Zenroth
Zenroth
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).
lshadow
lshadow
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
frizb
frizb

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...
blaze
blaze
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.
Coder++
Coder++
If I could see the code I could probably find the problem. If you want, just email it to me.

kjrockot@att.net

NightShade
NightShade
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-

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.