]> icculus.org git repositories - btb/d2x.git/blob - iff/archive/ifftestv.c
disable texture format verification for OS X - Textures work fine
[btb/d2x.git] / iff / archive / ifftestv.c
1 /*
2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.  
11 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
12 */
13
14 #include <conio.h>
15 #include <stdio.h>
16
17 #include "iff.h"
18 //#include "gr.h"
19 #include "vesa.h"
20
21 draw_ubitmap(int x,int y,grs_bitmap *bm)
22 {
23         int xx,yy;
24         short *data15 = (short *) bm->bm_data;
25
26 printf("x,y=%d,%d  w,h=%d,%d\n",x,y,bm->bm_w,bm->bm_h);
27
28         for (yy=0;yy<bm->bm_h;yy++)
29
30                 for (xx=0;xx<bm->bm_w;xx++)
31
32                         gr_vesa_pixel15(x+xx,y+yy,data15[yy*bm->bm_w+xx]);
33
34
35 }
36
37
38 main(int argc,char **argv)
39 {
40         int ret;
41         grs_bitmap my_bitmap;
42         ubyte my_palette[256*3];
43
44         ret = iff_read_bitmap(argv[1],&my_bitmap,BM_RGB15,&my_palette);
45
46         printf("ret = %d\n",ret);
47
48         if (ret == IFF_NO_ERROR) {
49
50                 gr_vesa_setmode(0x110);
51
52                 draw_ubitmap(0,0,&my_bitmap);
53         
54                 getch();
55
56         }
57
58 }
59