I have a player class here that inits the player and its sprite texture for drawing. The sprite map is 399x800, and each tile is 50x50. When I execute the program, the sprite is 64x64 instead of 50x50, so the sprite is cut off to the right and bottom. What can I do to draw this texture as 50x50?
// Common Constructor
void Init(int x, int y, char *filepath)
// Set the sprite position in screen space.
pos = D3DXVECTOR3(x, y, 1);
hr = D3DXCreateTextureFromFileEx(pd3dDevice, filepath, D3DX_DEFAULT_NONPOW2,
D3DX_DEFAULT_NONPOW2, 0, 0, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT,
D3DCOLOR_XRGB(255, 0, 255), NULL, NULL, &spriteTexture);
hr = D3DXCreateSprite(pd3dDevice, &sprite);
center = D3DXVECTOR3(0, 0, 0);
srcRect.left = 0;
srcRect.top = 0;
srcRect.right = 50;
srcRect.bottom = 50;
// Common Deconstructor
sprite->Draw(spriteTexture, &srcRect, ¢er, &pos, D3DCOLOR_XRGB(255, 255, 255));