Computer Science Canada Loading Sprites with DirectX - VS2005 |
Author: | chrisciscoioio [ Sat Nov 17, 2007 1:00 pm ] | ||||
Post subject: | Loading Sprites with DirectX - VS2005 | ||||
SOLVED. Hello, Let me first be less vague in the title, I cannot pull what I really need in such a small space. Basicly, I am creating a 'simple' 2D Engine Layout to test AI theories. Now I have the tiles loading, and that works fine, my problem comes when loading the player character (aka Mario, I found on the web) and loading the AI character(s) (aka Luigi, I also found and borrowed off the web). I use a simple RECT to grab each of the 12 frames, after countless debugging steping through the values are correct. SPRITE* pSprite comes from a Struct, which you can find in the source code zip I have uploaded.
The image also loads fine, because you can see it, but it becomes Stretched and some of it gets cut off, from either the right or left side. This is the function call which calls the DrawSprite, which you can see above. This sets it to display at 100,100 with a z-index of 1, on top of terrain, it will display Frame 1.
The values of Frame on in the image are for the RECT left - 0 top - 0 right - 24 bottom 32 Which is correct. --- Edit: I should also add that from what I have tested, changing the image type or settings, as well as changing the editor makes no difference from what I have tryed. I have tryed: 16 colour bmp 256 color bmp 16-bit bmp jpg png With editors: GIMP Paint --- Yet the image still does not display correctly I have attached all the source code, and it is with VS2005 |