I have an 18x18 image that I rotate to orient in the eight compass point directions (i.e., 45 degrees, 90 degrees, 135 degrees, etc.) depending on the direction this object is traveling.
Any time it is rotated to 0-180 degrees, it seems that the right-most pixels (those that are actually on the top of the image of course) are either distorted or cut off (they appear to be cut off at 90 degrees and 180 degrees, anything else is a distortion).
Now, the distortion is hard to see, and it could frankly be expected with a rotation, but the cutting off obviously shouldn't occur.
Here is the code I'm using for the 90 degrees position (other positions are identical except for the rotation angle, as you would expect):
Pretty much standard stuff I think. Any ideas what might be causing it? Could it be a bug, or just something I don't know yet? Thanks!
Any time it is rotated to 0-180 degrees, it seems that the right-most pixels (those that are actually on the top of the image of course) are either distorted or cut off (they appear to be cut off at 90 degrees and 180 degrees, anything else is a distortion).
Now, the distortion is hard to see, and it could frankly be expected with a rotation, but the cutting off obviously shouldn't occur.
Here is the code I'm using for the 90 degrees position (other positions are identical except for the rotation angle, as you would expect):
- Code:
// POINT player_pos;
// game_surface is a surface created before this, which is
// blitted to the physical screen down the line.
// player_img is a previously loaded surface with a
// transparent color RGB(255, 128, 255)
RECT rect;
SetRect(▭, player_pos.x, player_pos.y, player_pos.x + 18, player_pos.y + 18);
GDBLTFX gdbltfx;
gdbltfx.dwRotationAngle = 9000;
game_surface->Blt(▭, player_img, NULL,
GDBLTFAST_KEYSRC | GDBLT_ROTATIONANGLE, &gdbltfx;);
Pretty much standard stuff I think. Any ideas what might be causing it? Could it be a bug, or just something I don't know yet? Thanks!