Mail Archives: djgpp/1997/04/20/11:06:07
It is really simple.
try something like this:
#include <allegro.h>
#include "helix.h" //you need to include this one only if you are using
the names from the data file.
main()
{
*Initialize allegro *
DATAFILE *my_data;
//to play a midi use
play_midi((MIDI*)my_data[MY_SONG_FROM_DATA_FILE].dat, FALSE);
//the other way to do this, you could create a pointer to MIDI
MIDI *my_song = (MIDI*)my_data[MY_SONG_FROM_DATA_FILE].dat;
play_midi(my_song, FALSE);
you do the same stuff with samples and bitmaps
play_sample((SAMPLE*)my_data[MY_SAMPLE].dat, 200, 125, 1000, FALSE);
draw_sprite(screen, (BITMAP*)my_data[MY_BITMAP].dat, 10, 10);
On 19 Apr 1997, Helix wrote:
>
> Basically I used the grabber utility to create a data file named, helix.dat
> inside the data file I inserted a midi file named INTRO and I created a
> header file name helix.h.
>
> What code do I insert into the actual source file (helix.c) to make it play
> the midi file in the data file?
>
> What code would I use to in the source file to display a bitmap or play a
> wav file?
>
> I've read the docs on the Grabber utility but don't understand them very
> well.
>
> anyways, THANKS in advance.
>
- Raw text -