delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/12/12:07:43

From: beer god <masonjoyers AT hotmail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: need help with data files.
Date: Sat, 12 Dec 1998 11:31:10 -0600
Organization: Toolcity Internet
Lines: 51
Message-ID: <3672A85D.E72503A0@hotmail.com>
NNTP-Posting-Host: pppcisco-224.gremlan.org
Mime-Version: 1.0
X-Mailer: Mozilla 4.5 [en] (Win95; U)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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