Jump to content

  • Log In with Google      Sign In   
  • Create Account


DX--Why wont this work?


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
4 replies to this topic

#1 ECKILLER   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 January 2000 - 07:45 AM

Hi, I''m new to DX, and trying to o some sprites, heres the code that i''m having trouble to get to work, Also everything compiles ok and my color keys work. void Blt_Sprites() { RECT rect; // this is my background picture the size of the screen lpDDSBack->BltFast(0,0,arr_anime[0],NULL,DDBLTFAST_WAIT/DDBLTFAST_SRCCOLORKEY); // set the array to element 1 which is my character surface current_image = 1; // set source rct to the size of my picture, my characters // picture is 400x400 rect.left = 0; rect.top = 0; rect.bottom = 400; rect.right = 400; // blt the character to 200,200 lpDDSBack->BltFast(200,200,arr_anime[current_image],&rect,DDBLTFAST_WAIT/DDBLTFAST_SRCCOLORKEY); lpDDSPrimary->Flip(0,DDFLIP_WAIT); } Ok here''s whats wierd, if i set the first 2 parameters to 0,0 on my second blit and the source rect to null it works fine. But my sprite is at 0,0. I can''t get it to work setting any other coordinates. Help please. Thanks in ad. Frank ECKILLER

Sponsor:

#2 SeanHowe   Members   -  Reputation: 142

Like
Likes
Like

Posted 17 January 2000 - 07:52 AM

One thing that looks wrong, you''re doing this: DDBLTFAST_WAIT/DDBLTFAST_SRCCOLORKEY
/ = divided by
I beleive you''re supposed to have / there, the bitwise OR operator

#3 SeanHowe   Members   -  Reputation: 142

Like
Likes
Like

Posted 17 January 2000 - 07:53 AM

Ahhhhh, never mind, You did have that, the font this text is displayed in just doesn''t have a character for the bitwise or operator

#4 trixter   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 January 2000 - 09:01 AM

what screen resolution are you using? if you''re at 640x480 this won''t display at (200,200) because your sprite has a height of 400 and 200+400=600 which goes past 480. You have to use clipping to only display the visible section. Try blitting to (200,50) just to see if it works right.

#5 ECKILLER   Members   -  Reputation: 122

Like
Likes
Like

Posted 17 January 2000 - 11:45 AM

That was it, i set it to 200,50 and it worked.




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