Many images loading

Advanced game related topics
yabune
User
User
Posts: 65
Joined: Mon Aug 22, 2005 2:31 pm

Many images loading

Post by yabune »

Hi!

I need to load a lot of images in a game with the LoadSprite.
What's the best way to have the images stored? What's the fastest way to load them?
In a directory with all bmp's I use, with some sort of database, a binary, etc?

Thank you!
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8452
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Fastest loading would come via IncludeBinary and CatchSprite(), as the files don't have to be accessed individually from the disk.
BERESHEIT
Shannara
Addict
Addict
Posts: 1808
Joined: Thu Oct 30, 2003 11:19 pm
Location: Emerald Cove, Unformed

Post by Shannara »

I have to agree, that is the fastest way and uses double the memory for each image as you have one set of memory for include and another set in the catched sprite :) Another way is to load them from disk, and store the image data in a linklist.

Actually, I use the linklist and pack files for my images.
yabune
User
User
Posts: 65
Joined: Mon Aug 22, 2005 2:31 pm

Post by yabune »

Shannara wrote:I have to agree, that is the fastest way and uses double the memory for each image as you have one set of memory for include and another set in the catched sprite :) Another way is to load them from disk, and store the image data in a linklist.

Actually, I use the linklist and pack files for my images.
thank you for the tips!

what about loading images and store them in an array. Would it be faster than linklist, or is the same?

I liked the ideia of the IncludeBinary, but it will be many images, and I'm afraid it takes a lot of memory.
User avatar
Comtois
Addict
Addict
Posts: 1432
Joined: Tue Aug 19, 2003 11:36 am
Location: Doubs - France

Post by Comtois »

you can load one or several sprites (Chipset Tile) , and use ClipSprite().
Please correct my english
http://purebasic.developpez.com/
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1286
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Post by Paul »

Another option is to use something like VBin and place all your data/images in a VBin container.

This allows you to load whatever you want in whatever order you want, keeps everything in a single file instead of hundreds of files in different folders, allows you to encrypt your data for protection and VBin access is very fast.

Click for VBin Download Page
Image Image
Post Reply