Jump to content

  • Log In with Google      Sign In   
  • Create Account

Blt problem


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 lshadow   Members   -  Reputation: 123

Like
Likes
Like

Posted 23 December 1999 - 04:11 AM

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).]


Sponsor:

#2 Zenroth   Members   -  Reputation: 127

Like
Likes
Like

Posted 18 December 1999 - 08:18 PM

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).

#3 lshadow   Members   -  Reputation: 123

Like
Likes
Like

Posted 19 December 1999 - 09:19 AM

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).]


#4 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 19 December 1999 - 10:51 AM

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


#5 frizb   Members   -  Reputation: 122

Like
Likes
Like

Posted 19 December 1999 - 06:05 PM


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


#6 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 20 December 1999 - 08:49 PM

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!)


#7 blaze   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 December 1999 - 11:10 AM

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).]


#8 Coder++   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 December 1999 - 06:29 PM

If I could see the code I could probably find the problem. If you want, just email it to me.

kjrockot@att.net


#9 NightShade   Members   -  Reputation: 122

Like
Likes
Like

Posted 23 December 1999 - 04:11 AM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS