Archived

This topic is now archived and is closed to further replies.

Viri-

DDERR_INVALIDRECT

Recommended Posts

Ok well I''ve got a blt function that I send the location, surface and rect to and it FastBlt''s that surface to the back buffer. My error logger is picking up that it is failing for some reason. It displays the Graphic just fine but the error won''t allow me to use the color keying that I use.... Here are my functions and calls to the code: RECT playerRect; //Declaring the rect SetRect(&playerRect, 0, 0, 64, 64); // its a 64x64 bmp // x and y cords of the_player struct, playerRect is the surface BltImageBack(the_player.x, the_player.y, lpddsShip, playerRect); void BltImageBack(int xpos, int ypos, LPDIRECTDRAWSURFACE7 &lpddsbsurface, RECT &aRect) // aRect is what fails here. { dd_colorkey.dwColorSpaceLowValue = 0; dd_colorkey.dwColorSpaceHighValue = 0; hRet = lpddsback->SetColorKey(DDCKEY_SRCBLT, &dd_colorkey); // attempting to set color keys if(FAILED(hRet)) write_error("Set Colorkey Failed!"); // writing error if failed hRet = lpddsback->BltFast(xpos, ypos, lpddsbsurface, &aRect, DDBLTFAST_NOCOLORKEY); // bltFast fails always BUT it displays the bmp if I DON''T use DDBLTFAST_SRCCOLORKEY. if(FAILED(hRet)) // here is the check I''ve got running { // to pick up all possible errors write_error("Prob in BltFast!"); if(hRet == DDERR_EXCEPTION) write_error("ERR_EXCEPTION"); else if(hRet == DDERR_GENERIC) write_error("ERR_GENERIC"); else if(hRet == DDERR_INVALIDOBJECT) write_error("ERR_INVALIDOBJECT"); else if(hRet == DDERR_INVALIDPARAMS) write_error("ERR_INVALIDPARAMS"); else if(hRet == DDERR_INVALIDRECT) write_error("ERR_INVALIDRECT"); else if(hRet == DDERR_NOBLTHW) write_error("ERR_NOBLTHW"); else if(hRet == DDERR_SURFACEBUSY) write_error("ERR_SURFACEBUSY"); else if(hRet == DDERR_SURFACELOST) write_error("ERR_SURFACELOST"); else if(hRet == DDERR_UNSUPPORTED) write_error("ERR_UNSUPPORTED"); else if(hRet == DDERR_WASSTILLDRAWING) write_error("ERR_WASSTILLDRAWING"); else write_error("BltFast in BltImageBack failed! Does image exist?"); } } // and thats all what could be doing all of this? Thanks for any and all help, Viri-

Share this post


Link to post
Share on other sites
Why are you setting a color key every time you blit something? Set the color key once, when you create the surface. I just thought I''d point that out, though I highly doubt it would cause an INVALID_RECT error.

-Ironblayde
 Aeon Software

The following sentence is true.
The preceding sentence is false.

Share this post


Link to post
Share on other sites
Would a & sign be screwing me up? If I remove the & sign of the BltBack func it causes an error? Why is this?


thanks,
Viri-

Edited by - Viri- on November 2, 2000 11:24:22 AM

Share this post


Link to post
Share on other sites