delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/12/15:35:31

Message-ID: <004a01be260f$29cb3220$c4b2f482@banan>
From: "Bengt AT Playboj DOT com" <bengt AT playboj DOT com>
To: <djgpp AT delorie DOT com>
Subject: Re: need help with data files.
Date: Sat, 12 Dec 1998 21:36:55 +0100
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.72.3110.1
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Reply-To: djgpp AT delorie DOT com

I think your problem is that the name for your "title" bitmap is the same
that are defined to be a number (probably 8 I guess) in pics.h, so everytime
you trie to use title somewhere, it will be replaced with '8' (or whatever).
just change the name for the bitmap. (the same thing goes for 'titlescreen')

bengt AT playboj DOT com

-----Original Message-----
From: beer god <masonjoyers AT hotmail DOT com>
Newsgroups: comp.os.msdos.djgpp
To: djgpp AT delorie DOT com <djgpp AT delorie DOT com>
Date: den 12 december 1998 19:24
Subject: need help with data files.


>when i try to complie this:
>#include<allegro.h>
>#include"pics.h"
>
>main()
>{
> DATAFILE *data;
> BITMAP *titlescreen, *title;
> BITMAP *big_g, *buffer;
>
> allegro_init();
> install_keyboard();
> set_color_depth(15);
> set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0);
>
> data = load_datafile("pics.dat");
> set_pallete((RGB*)data[pallete].dat);
> titlescreen = (BITMAP *)data[titlescreen].dat;
> title = (BITMAP *)data[title].dat;
> big_g = (BITMAP *)data[thebig_g].dat;
> buffer = create_bitmap(640, 480);
>
> blit(titlescreen, buffer, 0, 0, 0, 0, 640, 480);
> masked_blit(title, buffer, 0, 0, 46, 68, title->w, title->h);
> masked_blit(big_g, buffer, 0, 0, 33, 235, big_g->w, big_g->h);
> blit(buffer, screen, 0, 0, 0, 0, 460, 480);
>
> readkey();
> allegro_exit();
> return 0;
>}
>i get:
>C:\CyberLake\Games\ggotchi>gxx test2.cpp -o data.exe -lallegro
>test2.cpp: In function `int main()':
>test2.cpp:7: parse error before `8'
>test2.cpp:17: non-lvalue in assignment
>test2.cpp:18: non-lvalue in assignment
>test2.cpp:22: warning: passing `int' to argument 1 of `blit(BITMAP *,
>BITMAP *,
>int, int, int, int, int, int)' lacks a cast
>test2.cpp:23: base operand of `->' is not a pointer
>test2.cpp:23: base operand of `->' is not a pointer
>test2.cpp:23: warning: passing `int' to argument 1 of
>`masked_blit(BITMAP *, BIT
>MAP *, int, int, int, int, int, int)' lacks a cast
>
>any help would be greatful.
>jason
>masonjoyers AT hotmail DOT com
>icq uin 20421138

- Raw text -


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