www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/07/10:00:26

From: James W Sager Iii <sager+@andrew.cmu.edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: datafiles problems in allegro
Date: Tue, 7 Apr 1998 09:14:36 -0400
Organization: Junior, MCS Undeclared, Carnegie Mellon, Pittsburgh, PA
Lines: 63
Message-ID: <Mp_WOwW00YUq06Nr40@andrew.cmu.edu>
References: <1998040620155601 DOT QAA16833 AT ladder03 DOT news DOT aol DOT com>
NNTP-Posting-Host: po9.andrew.cmu.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Just curious. Does the code work if you take out the set_palette command?
if so, I may be able to offer helpful suggestions.





Excerpts from netnews.comp.os.msdos.djgpp: 6-Apr-98 datafiles problems
in allegro by TackMast AT aol DOT com 
> i previously posted a message on having problems with graphics in allegro.
> after redoing my test program a lot of times and moving the placement things,
> i've found that it's not loading the graphics that's giving me my problems,
> it's getting the datafile loaded and able. when i load the datafile,
my progra
> m
> just freezes for no apparent reason. i copied a lot of the code out of the
> example program 12, but it still doesn't work. i'm wondering if it might be
> because i use the dat archiver instead of the grabber since the grabber just
> won't work. so, can someone  tell me why the datafiles aren't loading or
> possibly why the grabber won't work? here's the code:
>  
> #include <stdlib.h>
> #include <stdio.h>
>  
> #include "allegro.h"
>  
> #include "picture.h"
> /* the file produced defining everything in the datafile */
>  
> main(int argc, char *argv[])
> {
> DATAFILE *datafile;
> char buf[80];
>  
> allegro_init();
> install_keyboard();
>  
> strcpy(buf, argv[0]);
> strcpy(get_filename(buf), "example.dat");
> datafile = load_datafile(buf);
>  
> datafile = load_datafile("Picture.dat");
>  
> set_gfx_mode(GFX_AUTODETECT, 320, 200, 0, 0);
>  
> set_pallete(datafile[GAME_PAL].dat);
>  
> blit(datafile[MAIN_TGA].dat, screen, 0, 0, 0, 0, 320, 200);
>  
> readkey();
>  
> unload_datafile(datafile);
>  
> return 0;
> }
>  

-James

Please visit Intergalactic Bounty Hunter's 
web site and tell me what you think:       
http://www.contrib.andrew.cmu.edu/~sager/ibh/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019