Qbasicnews.com

Full Version: allegro's grabber
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Sup ppl. im trying my hand at a small c++ game which uses allegro. ive seen that the grabber util can have a whole bunch of bitmaps in one file (like pp256, yay) which would help me. ive glanced through the documents on it, but was still unsure bout how to use it. how do you load the pics from the dat file? i imagine it will use an array tho....
Lets say that you have a image in slot one of the datafile, you would do

Code:
BITMAP *bmp = datafile[0].dat

OR in C++ youd need to cast so:

Code:
BITMAP *bmp = (BITMAP *)datafile[0].dat


The data file can also create an include header so you can do:

Code:
#include "datafileheader.h"
BITMAP *bmp = datafile[MY_IMAGE].dat
thanx, i got it working. it makes it so much neater having all my graphics in 1 or 2 files!