delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/20/23:00:56

From: matthew DOT krause AT juno DOT com
To: djgpp AT delorie DOT com
Date: Mon, 19 Oct 1998 22:55:31 -0400
Subject: Re: GPFs when running without Rhide (or something like it)
Message-ID: <19981019.225610.3846.0.matthew.krause@juno.com>
X-Mailer: Juno 1.49
X-Juno-Line-Breaks: 5-35,37,39,41,43,45,47,49,51,53-82,84-89
Reply-To: djgpp AT delorie DOT com

Okay, I had thought it was some kind of subtle bug in my code (Thanks
Eli!) Anyone care to find it. I modified the code, but i can't remember
how (bad form, I know). But the program now crashes under Rhide, but not
when its run without Rhide. Still, the blasted bug is still there
somewhere. Anyone care to help me find it? Please! I'm kinda new at this
still.
Thanks

Here's my code:
#include <stdlib.h>
#include <stdio.h>

#include "allegro.h"
#include "fog.h"

int main(int argc, char *argv[])
{
   DATAFILE *datafile;

   allegro_init();
   //install_timer();
   //install_mouse();
   install_keyboard();
   set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0);
   fixup_datafile(datafile);     
 datafile = load_datafile("fog.dat"); //From previous//
   if (!datafile) {
      allegro_exit();
      printf("Error loading fog.dat!\n\n");
      return 1;
   }
			//End from previous
   set_palette(desktop_palette);
   ;
   clear_to_color(screen, 0);
   textout(screen, &stylus24, "Translucent", 0, 50, 255);
   textout(screen, &stylus24, "A translucent material is a material which
", 0, 150, 255);
   textout/*_centre*/(screen, &stylus24, "diffuses light, but not enough
to hide contours ", 0, 180, 255);
   textout/*_centre*/(screen, &stylus24, "or colors. Frosted glass and
fog may be", 0, 210, 255);
   textout/*_centre*/(screen, &stylus24, "described as translucent.
Translucent comes ", 0, 250, 255);
   textout/*_centre*/(screen, &stylus24, "from the Latin prepostion
meaning across and ", 0, 280, 255);
   textout/*_centre*/(screen, &stylus24, "the verb lucere meaning to
shine.", 0, 310, 255);
   textout(screen, &stylus24, " Press any key to see a scene with fog,",
0, 340, 255);
   textout(screen, &stylus24, "then press another key to see it removed",
0, 370, 255);
   textout/*_centre*/(screen, &stylus24, "Press any key from the final
scene to exit",0 ,405,50);
   readkey();
  
   set_color_depth(24);

   clear(screen);

   blit(&fog2a, screen, 0, 0, 0, 0, 640, 480);
   readkey();
   set_pallete(&fog1ap);
   clear(screen);
   set_color_depth(16);
   set_color_conversion(COLORCONV_PARTIAL);
   blit(&fog1a, screen, 0, 0, 0, 0, 640, 480);
   readkey();
   unload_datafile(datafile);
   //And everything goes back to normal:>)
   return 0;
}

FOG.H
/* Allegro data file definitions, produced by dat2s v3.0 */
/* Input file: fog.dat */
/* Date: Sun Oct 18 20:10:42 1998 */
/* Do not hand edit! */

extern BITMAP fog1a;
extern PALLETE fog1ap;
extern BITMAP fog2a;
extern PALLETE fog2ap;
extern FONT stylus24; //Grabbed using using ttf2pcx Note this comment
isn't in the code.
extern DATAFILE data[];

FOG.s

[Not going to be included (it's 13.7 megs)

___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
or call Juno at (800) 654-JUNO [654-5866]

- Raw text -


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