delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/16/07:46:44

Date: Thu, 16 Oct 1997 06:44:38 -0500 (CDT)
From: Andrew Deren <aderen AT eecs DOT uic DOT edu>
To: Ethan Giordano <lostreality AT geocities DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: why does draw_sprite crash??
In-Reply-To: <61tlm0$ra9$1@news.cybernex.net>
Message-ID: <Pine.SUN.3.95.971016064346.24475A-100000@bert.eecs.uic.edu>
MIME-Version: 1.0

On Mon, 13 Oct 1997, Ethan Giordano wrote:

> this is the source:
> 
> void main ( void )
> {
>         BITMAP          *grass;
>         PALETTE         grass_palette;
> 
>         allegro_init();
>         install_keyboard();
> 
>         set_gfx_mode ( GFX_AUTODETECT, 320, 200, 0, 0 );     // works ok
> 
>         load_bitmap ( "grass.bmp", grass_palette );     // works ok
You forget to assign the loaded bitmap to your grass BMP  
          grass =load_bitmap("grass.bmp", grass_palette);

>         set_palette ( grass_palette );                  // works ok
> 
>         clear_to_color ( screen, 4 );                   // fill screen
> 
>         delay ( 2000 );                                 // delay in ms
> 
>         draw_sprite ( screen, grass, 160, 100 );        // program dies!!
> 
>         while ( !keypressed() );
> }
> 
> 
> the screen goes to the color, waits 2secs, then crashes. WHY???
> 
> -Ethan
> 
> 
> 
> 


                        ,,,
                       (0 0)
   +-------------oOO----(_)-------------------+
   |                Andrew Deren              |  
   |             aderen AT eecs DOT uic DOT edu          |
   | www.eecs.uic.edu/~aderen/ader/main.html  |
   +-------------------------oOO--------------+
                       || ||
                      ooO Ooo
 


- Raw text -


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