View Full Version : One big image instead images list?
15-08-2003, 03:19 PM
Is it absolutely necessary to use a list of images to draw sprites with DelphiX? I'm building a game, but it uses a lot (and that's really a lot) of images, and it won't work on old Windows (because of that GDI limitation).
What I have on my mind: instead of having a lot of sepparate images for every sprite, I have one big BMP file with all the sprites drawn on it.
The problem is how to draw only a specific region of that big BMP file to the screen. I tried doing that pixel by pixel, but it's just too slow.
15-08-2003, 04:09 PM
Drawing only a portion from an image can be done like this:
I've tried using large (800x600) images in the past as well. However, when using them in combination with a DXImagelist, it made my game go much much slower. So, the only way it works is when you don't use the DXimagelist, and load the images during runtime.
15-08-2003, 10:35 PM
As I said on GameDev, if your sprites are all the same size, you can use the PatternWidth and PatternHeight properties and use the PatternIndex parameter of the ImageListItem's draw function.
16-08-2003, 10:14 PM
Thanks for the suggestions, both of them were really useful. :D
21-08-2003, 04:42 PM
How do you load a large image during runtime. :?
21-08-2003, 09:03 PM
BigImage := TDirectDrawSurface.Create(Form1.DXDraw1.DDraw);
That should do the trick,
21-08-2003, 10:55 PM
For some unknow and strange reason, when I use images larger than 3000 pixels, the Draw procedure only draws noise. So I split my image into 3 smaller images and created 3 surfaces. It's still much much faster than using the images list (I can see that difference in DXTimer1.FrameRate). :)
22-08-2003, 12:31 AM
I guess you graphic card support textures up to 1024x1024 ... But more than 3000 px is really huge ...
Powered by vBulletin® Version 4.1.10 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.