Subversion Repositories Games.Descent

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Portions of this file are copyright Rebirth contributors and licensed as
  3.  * described in COPYING.txt.
  4.  * Portions of this file are copyright Parallax Software and licensed
  5.  * according to the Parallax license below.
  6.  * See COPYING.txt for license details.
  7.  
  8. THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  9. SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
  10. END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  11. ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  12. IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  13. SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  14. FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  15. CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
  16. AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
  17. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
  18. */
  19.  
  20. #include <conio.h>
  21. #include <stdio.h>
  22. #include "iff.h"
  23.  
  24. draw_ubitmap(int x,int y,grs_bitmap *bm)
  25. {
  26.         int xx,yy;
  27.         short *data15 = (short *) bm->bm_data;
  28.  
  29. printf("x,y=%d,%d  w,h=%d,%d\n",x,y,bm->bm_w,bm->bm_h);
  30.  
  31.         for (yy=0;yy<bm->bm_h;yy++)
  32.  
  33.                 for (xx=0;xx<bm->bm_w;xx++)
  34.  
  35.                         gr_vesa_pixel15(x+xx,y+yy,data15[yy*bm->bm_w+xx]);
  36.  
  37.  
  38. }
  39.  
  40. main(int argc,char **argv)
  41. {
  42.         int ret;
  43.         grs_bitmap my_bitmap;
  44.         ubyte my_palette[256*3];
  45.  
  46.         ret = iff_read_bitmap(argv[1],&my_bitmap,bm_mode::rgb15,&my_palette);
  47.  
  48.         printf("ret = %d\n",ret);
  49.  
  50.         if (ret == IFF_NO_ERROR) {
  51.  
  52.                 gr_vesa_setmode(0x110);
  53.  
  54.                 draw_ubitmap(0,0,&my_bitmap);
  55.        
  56.                 getch();
  57.  
  58.         }
  59.  
  60. }
  61.  
  62.