Remove obsolete d2x-rebirth/iff/archive/ programs

These were never converted to C++ and cannot be built directly from
SConstruct.  Two of them were broken by a global search&replace in
398596c468 (May 2016), and never reported.
Aside from other global transformations, they have not been touched
since unification moved them to this path in
7cda97cc74 (February 2013).  Based on
their content, these are all test programs specific to the game's
graphics files.

iff15bpp.c depends on an undefined type BITMAP15, which seemingly was never
defined in the project's git history.  The only reference to it is in the
addition of iff15bpp.c in 9bd1ba7c47
(January 2001).

Likewise, iff8bpp.c depends on an undefined type BITMAP8, which was never
defined and only occurs in 9bd1ba7c47.

ifftest.c depends on an external function `rle_span`, which does not declare a
return type, and therefore triggers a warning for declaring data with no type.

iffmike.c depends on a modifier `huge` which is not recognized in gcc.
By its usage, it was likely used on DOS systems with limited memory, to
enable a special memory mode.

ifftestv.c declares a function without a return type, which triggers a warning
in C99.
This commit is contained in:
Kp 2023-06-17 23:13:42 +00:00
parent 8870f071aa
commit 111f6f2f0d
5 changed files with 0 additions and 864 deletions

View File

@ -1,98 +0,0 @@
/*
* This file is part of the DXX-Rebirth project <https://www.dxx-rebirth.com/>.
* It is copyright by its individual contributors, as recorded in the
* project's Git history. See COPYING.txt at the top level for license
* terms and a link to the Git history.
*/
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include "iff.h"
#define INDEX_TO_15BPP(i) ((WORD)((((palptr[(i)].r/2)&31)<<10)+(((palptr[(i)].g/2)&31)<<5)+((palptr[(i)].b/2 )&31)))
extern int parse_iff(FILE *ifile,struct bitmap_header *bitmap_header);
int x,y,pl,bc;
int bytes_per_row,color;
int mask,first_bit_value;
FILE *ifile;
struct bitmap_header iff_bitmap_header;
// Parse ilbm style data at my_bh->raw_data.
BITMAP15 * IFF_To_15BPP(char * ifilename)
{
struct bitmap_header * my_bh;
int Process_width,Process_height;
unsigned char *p;
struct pal_entry *palptr;
int newptr = 0;
int i;
BITMAP15 * new;
my_bh = &iff_bitmap_header;
palptr=my_bh->palette;
p=my_bh->raw_data;
Process_width = 32767; // say to process full width of bitmap
Process_height = 32767; // say to process full height of bitmap
if ((ifile = fopen(ifilename,"rb")) == NULL) {
printf("Unable to open bitmap file %s.\n", ifilename);
exit(1);
}
parse_iff(ifile,&iff_bitmap_header);
if (Process_width > iff_bitmap_header.w)
Process_width = iff_bitmap_header.w;
if (Process_height > iff_bitmap_header.h)
Process_height = iff_bitmap_header.h;
//printf( "%d, %d\n", Process_width, Process_height );
new = (BITMAP15 *)malloc( sizeof(BITMAP15)+ (Process_width * Process_height * 2 ));
if (new==NULL) exit(1);
new->Width = Process_width;
new->Height = Process_height;
//printf("Process_width = %i, Process_height = %i\n",Process_width,Process_height);
first_bit_value = 1 << (my_bh->nplanes-1);
bytes_per_row = 2*((my_bh->w+15)/16);
for (y=0; y<Process_height; y++) {
bc = Process_width;
p = &my_bh->raw_data[y*bytes_per_row*my_bh->nplanes];
switch (my_bh->type) {
case PBM_TYPE:
for (x=0; x<my_bh->w; x++) {
new->Data[newptr++] = INDEX_TO_15BPP(my_bh->raw_data[y*my_bh->w+x]);
}
break;
case ILBM_TYPE:
for (x=0; x<bytes_per_row; x++) {
for (mask=128; mask; mask /=2) {
color = 0;
for (pl=0; pl<my_bh->nplanes; pl++) {
color /= 2;
if ( p[pl*bytes_per_row+x] & mask)
color += first_bit_value;
}
new->Data[newptr++] = INDEX_TO_15BPP(color);
bc--;
if (!bc)
goto line_done;
}
}
line_done: ;
break;
}
}
free( my_bh->raw_data );
return new;
}
ÿ

View File

@ -1,100 +0,0 @@
/*
* This file is part of the DXX-Rebirth project <https://www.dxx-rebirth.com/>.
* It is copyright by its individual contributors, as recorded in the
* project's Git history. See COPYING.txt at the top level for license
* terms and a link to the Git history.
*/
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include "iff.h"
extern int parse_iff(FILE *ifile,struct bitmap_header *bitmap_header);
int x,y,pl,bc;
int bytes_per_row,color;
int mask,first_bit_value;
FILE *ifile;
struct bitmap_header iff_bitmap_header;
// Parse ilbm style data at my_bh->raw_data.
BITMAP8 * IFF_To_8BPP(char * ifilename)
{
struct bitmap_header * my_bh;
int Process_width,Process_height;
unsigned char *p;
struct pal_entry *palptr;
int newptr = 0;
int i;
BITMAP8 * new;
my_bh = &iff_bitmap_header;
palptr=my_bh->palette;
p=my_bh->raw_data;
Process_width = 32767; // say to process full width of bitmap
Process_height = 32767; // say to process full height of bitmap
if ((ifile = fopen(ifilename,"rb")) == NULL) {
printf("Unable to open bitmap file %s.\n", ifilename);
exit(1);
}
parse_iff(ifile,&iff_bitmap_header);
if (Process_width > iff_bitmap_header.w)
Process_width = iff_bitmap_header.w;
if (Process_height > iff_bitmap_header.h)
Process_height = iff_bitmap_header.h;
printf( "%d, %d\n", Process_width, Process_height );
new = (BITMAP8 *)malloc( sizeof(BITMAP8)+ (Process_width * Process_height ) );
if (new==NULL) exit(1);
new->Width = Process_width;
new->Height = Process_height;
for (i=0;i<256;i++) {
new->Palette[3*i] = my_bh->palette[i].r;
new->Palette[3*i+1] = my_bh->palette[i].g;
new->Palette[3*i+2] = my_bh->palette[i].b;
}
printf("Process_width = %i, Process_height = %i\n",Process_width,Process_height);
first_bit_value = 1 << (my_bh->nplanes-1);
bytes_per_row = 2*((my_bh->w+15)/16);
for (y=0; y<Process_height; y++) {
bc = Process_width;
p = &my_bh->raw_data[y*bytes_per_row*my_bh->nplanes];
switch (my_bh->type) {
case PBM_TYPE:
for (x=0; x<my_bh->w; x++) {
new->Data[newptr++] = my_bh->raw_data[y*my_bh->w+x];
}
break;
case ILBM_TYPE:
for (x=0; x<bytes_per_row; x++) {
for (mask=128; mask; mask /=2) {
color = 0;
for (pl=0; pl<my_bh->nplanes; pl++) {
color /= 2;
if ( p[pl*bytes_per_row+x] & mask)
color += first_bit_value;
}
new->Data[newptr++] = color;
bc--;
if (!bc)
goto line_done;
}
}
line_done: ;
break;
}
}
free( my_bh->raw_data );
fclose(ifile);
return new;
}
ÿ

View File

@ -1,494 +0,0 @@
/*
* Portions of this file are copyright Rebirth contributors and licensed as
* described in COPYING.txt.
* Portions of this file are copyright Parallax Software and licensed
* according to the Parallax license below.
* See COPYING.txt for license details.
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
*/
#include <stdio.h>
#include <stdlib.h>
#include <alloc.h>
#include "iff.h"
#define MIN(a,b) ((a<b)?a:b)
#define MAKE_SIG(a,b,c,d) (((long)(a)<<24)+((long)(b)<<16)+((c)<<8)+(d))
#define form_sig MAKE_SIG('F','O','R','M')
#define ilbm_sig MAKE_SIG('I','L','B','M')
#define body_sig MAKE_SIG('B','O','D','Y')
#define pbm_sig MAKE_SIG('P','B','M',' ')
#define bmhd_sig MAKE_SIG('B','M','H','D')
#define cmap_sig MAKE_SIG('C','M','A','P')
void printsig(long s)
{
char *t=(char *) &s;
/* printf("%c%c%c%c",*(&s+3),*(&s+2),*(&s+1),s);*/
printf("%c%c%c%c",t[3],t[2],t[1],t[0]);
}
long get_sig(FILE *f)
{
char s[4];
if ((s[3]=getc(f))==EOF) return(EOF);
if ((s[2]=getc(f))==EOF) return(EOF);
if ((s[1]=getc(f))==EOF) return(EOF);
if ((s[0]=getc(f))==EOF) return(EOF);
return(*((long *) s));
}
int put_sig(long sig,FILE *f)
{
char *s = (char *) &sig;
putc(s[3],f);
putc(s[2],f);
putc(s[1],f);
return putc(s[0],f);
}
int get_word(FILE *f)
{
unsigned char c0,c1;
c1=getc(f);
c0=getc(f);
if (c0==0xff) return(EOF);
return(((int)c1<<8) + c0);
}
char get_byte(FILE *f)
{
return getc(f);
}
char put_byte(unsigned char c,FILE *f)
{
return putc(c,f);
}
int put_word(int n,FILE *f)
{
unsigned char c0,c1;
c0 = (n & 0xff00) >> 8;
c1 = n & 0xff;
put_byte(c0,f);
return put_byte(c1,f);
}
int put_long(long n,FILE *f)
{
int n0,n1;
n0 = (int) ((n & 0xffff0000l) >> 16);
n1 = (int) (n & 0xffff);
put_word(n0,f);
return put_word(n1,f);
}
long get_long(FILE *f)
{
unsigned char c0,c1,c2,c3;
c3=getc(f);
c2=getc(f);
c1=getc(f);
c0=getc(f);
//printf("get_long %x %x %x %x\n",c3,c2,c1,c0);
// if (c0==0xff) return(EOF);
return(((long)c3<<24) + ((long)c2<<16) + ((long)c1<<8) + c0);
}
void parse_bmhd(FILE *ifile,long len,struct bitmap_header *bitmap_header)
{
len++; /* so no "parm not used" warning */
// debug("parsing bmhd len=%ld\n",len);
bitmap_header->w = get_word(ifile);
bitmap_header->h = get_word(ifile);
bitmap_header->x = get_word(ifile);
bitmap_header->y = get_word(ifile);
bitmap_header->nplanes = get_byte(ifile);
bitmap_header->masking = get_byte(ifile);
bitmap_header->compression = get_byte(ifile);
get_byte(ifile); /* skip pad */
bitmap_header->transparentcolor = get_word(ifile);
bitmap_header->xaspect = get_byte(ifile);
bitmap_header->yaspect = get_byte(ifile);
bitmap_header->pagewidth = get_word(ifile);
bitmap_header->pageheight = get_word(ifile);
// debug("w,h=%d,%d x,y=%d,%d\n",w,h,x,y);
// debug("nplanes=%d, masking=%d ,compression=%d, transcolor=%d\n",nplanes,masking,compression,transparentcolor);
}
// the buffer pointed to by raw_data is stuffed with a pointer to decompressed pixel data
int parse_body_pbm(FILE *ifile,long len,struct bitmap_header *bitmap_header)
{
unsigned char huge *p=bitmap_header->raw_data;
int width=bitmap_header->w;
long cnt,old_cnt;
char n;
int nn,wid_cnt;
char ignore;
if (bitmap_header->compression == cmpNone) { /* no compression */
int x,y;
for (y=bitmap_header->h;y;y--) {
for (x=bitmap_header->w;x;x--) *p++=getc(ifile);
if (bitmap_header->w & 1) ignore = getc(ifile);
}
}
else if (bitmap_header->compression == cmpByteRun1)
for (old_cnt=cnt=len,wid_cnt=width;cnt>0;) {
unsigned char c;
if (old_cnt-cnt > 2048) {
// printf(".");
old_cnt=cnt;
}
if (wid_cnt <= 0) wid_cnt = width;
n=getc(ifile);
if (n >= 0) { // copy next n+1 bytes from source, they are not compressed
nn = (int) n+1;
cnt -= nn+1;
wid_cnt -= nn;
if (wid_cnt==-1) --nn;
while (nn--) *p++=getc(ifile);
if (wid_cnt==-1) ignore = getc(ifile); /* extra char */
}
else if (n>=-127) { // next -n + 1 bytes are following byte
cnt -= 2;
c=getc(ifile);
nn = (int) -n+1;
wid_cnt -= nn;
if (wid_cnt==-1) --nn;
while (nn--) *p++=c;
}
}
if (len & 1) ignore = getc(ifile);
if (ignore) ignore++; // haha, suppress the evil warning message
return IFF_NO_ERROR;
}
// the buffer pointed to by raw_data is stuffed with a pointer to bitplane pixel data
int parse_body_ilbm(FILE *ifile,long len,struct bitmap_header *bitmap_header)
{
unsigned char huge *p=bitmap_header->raw_data;
int width=bitmap_header->w;
long cnt,old_cnt;
char n;
int nn,wid_cnt;
char ignore;
if (bitmap_header->compression == cmpNone) { /* no compression */
int x,y;
for (y=bitmap_header->h;y;y--) {
for (x=bitmap_header->w;x;x--) *p++=getc(ifile);
if (bitmap_header->w & 1) ignore = getc(ifile);
}
}
else if (bitmap_header->compression == cmpByteRun1)
for (old_cnt=cnt=len,wid_cnt=width;cnt>0;) {
unsigned char c;
if (old_cnt-cnt > 2048) {
// printf(".");
old_cnt=cnt;
}
if (wid_cnt <= 0) wid_cnt = width;
n=getc(ifile);
if (n >= 0) { // copy next n+1 bytes from source, they are not compressed
nn = (int) n+1;
cnt -= nn+1;
wid_cnt -= nn;
if (wid_cnt==-1) --nn;
while (nn--) *p++=getc(ifile);
if (wid_cnt==-1) ignore = getc(ifile); /* extra char */
}
else if (n>=-127) { // next -n + 1 bytes are following byte
cnt -= 2;
c=getc(ifile);
nn = (int) -n+1;
wid_cnt -= nn;
if (wid_cnt==-1) --nn;
while (nn--) *p++=c;
}
}
if (len & 1) ignore = getc(ifile);
if (ignore) ignore++; // haha, suppress the evil warning message
return IFF_NO_ERROR;
}
void skip_chunk(FILE *ifile,long len)
{
len = len+1 & ~1;
fseek(ifile,len,SEEK_CUR);
}
// Pass pointer to opened file, and to empty bitmap header.
int parse_iff(FILE *ifile,struct bitmap_header *bitmap_header)
{
long sig,form_len,len,form_type;
char ignore;
sig=get_sig(ifile);
// printsig(sig);
if (sig==form_sig) {
form_len = get_long(ifile);
form_len++; /* get rid of never used message */
form_type = get_sig(ifile);
// printf(" %ld ",form_len);
// printsig(form_type);
// printf("\n");
if ((form_type == pbm_sig) || (form_type == ilbm_sig)) {
if (form_type == pbm_sig)
bitmap_header->type = PBM_TYPE;
else
bitmap_header->type = ILBM_TYPE;
while ((sig=get_sig(ifile)) != EOF) {
len=get_long(ifile);
// printf(" ");
// printsig(sig);
// printf(" %ld\n",len);
switch (sig) {
case bmhd_sig:
parse_bmhd(ifile,len,bitmap_header);
if (! (bitmap_header->raw_data = farmalloc((long) bitmap_header->w * bitmap_header->h))) return IFF_NO_MEM;
break;
case cmap_sig:
{
int ncolors=(int) (len/3),cnum;
unsigned char r,g,b;
for (cnum=0;cnum<ncolors;cnum++) {
r=getc(ifile);
g=getc(ifile);
b=getc(ifile);
r >>= 2; bitmap_header->palette[cnum].r = r;
g >>= 2; bitmap_header->palette[cnum].g = g;
b >>= 2; bitmap_header->palette[cnum].b = b;
}
if (len & 1) ignore = getc(ifile);
break;
}
case body_sig:
{
int r;
switch (form_type) {
case pbm_sig:
if (!(r=parse_body_pbm(ifile,len,bitmap_header))) return r;
break;
case ilbm_sig:
if (!(r=parse_body_ilbm(ifile,len,bitmap_header))) return r;
break;
}
break;
}
default:
skip_chunk(ifile,len);
break;
}
}
}
else return IFF_UNKNOWN_FORM;
}
else
{printf("Not an IFF file\n"); return IFF_NOT_IFF;}
if (ignore) ignore++;
return IFF_NO_ERROR; /* ok! */
}
#define BMHD_SIZE 20
int write_bmhd(FILE *ofile,struct bitmap_header *bitmap_header)
{
put_sig(bmhd_sig,ofile);
put_long((long) BMHD_SIZE,ofile);
put_word(bitmap_header->w,ofile);
put_word(bitmap_header->h,ofile);
put_word(bitmap_header->x,ofile);
put_word(bitmap_header->y,ofile);
put_byte(bitmap_header->nplanes,ofile);
put_byte(bitmap_header->masking,ofile);
put_byte(bitmap_header->compression,ofile);
put_byte(0,ofile); /* pad */
put_word(bitmap_header->transparentcolor,ofile);
put_byte(bitmap_header->xaspect,ofile);
put_byte(bitmap_header->yaspect,ofile);
put_word(bitmap_header->pagewidth,ofile);
put_word(bitmap_header->pageheight,ofile);
return 1;
}
int write_huge(unsigned char huge *huge_ptr,long len,FILE *f)
{
unsigned char temp_buffer[256],*t;
//printf("write_huge %ld\n",len);
while (len) {
int n,wsize = (int) MIN(len,256);
//printf("len,wsize=%ld,%d\n",len,wsize);
for (t=temp_buffer,n=wsize;n--;) *t++ = *huge_ptr++;
fwrite(temp_buffer,wsize,1,f);
len -= wsize;
}
return 1;
}
int write_pal(FILE *ofile,struct bitmap_header *bitmap_header)
{
int i;
int n_colors = 1<<bitmap_header->nplanes;
put_sig(cmap_sig,ofile);
// put_long(sizeof(struct pal_entry) * n_colors,ofile);
put_long(3 * n_colors,ofile);
//printf("new write pal %d %d\n",3,n_colors);
for (i=0; i<256; i++) {
unsigned char r,g,b;
r = bitmap_header->palette[i].r * 4;
g = bitmap_header->palette[i].g * 4;
b = bitmap_header->palette[i].b * 4;
fputc(r,ofile);
fputc(g,ofile);
fputc(b,ofile);
}
//printf("write pal %d %d\n",sizeof(struct pal_entry),n_colors);
// fwrite(bitmap_header->palette,sizeof(struct pal_entry),n_colors,ofile);
return 1;
}
#define EVEN(a) ((a+1)&0xfffffffel)
int write_body(FILE *ofile,struct bitmap_header *bitmap_header)
{
int w=bitmap_header->w,h=bitmap_header->h;
int y,odd=w&1;
long len = EVEN(w) * h;
unsigned char huge *p=bitmap_header->raw_data;
put_sig(body_sig,ofile);
put_long(len,ofile);
for (y=bitmap_header->h;y--;) {
write_huge(p,bitmap_header->w,ofile);
if (odd) putc(0,ofile);
p+=bitmap_header->w;
}
return 1;
}
int write_pbm(FILE *ofile,struct bitmap_header *bitmap_header) /* writes a pbm iff file */
{
long raw_size = EVEN(bitmap_header->w) * bitmap_header->h;
long pbm_size = 4 + BMHD_SIZE + 8 + EVEN(raw_size) + sizeof(struct pal_entry)*(1<<bitmap_header->nplanes)+8;
//printf("write_pbm\n");
put_sig(form_sig,ofile);
put_long(pbm_size+8,ofile);
put_sig(pbm_sig,ofile);
write_bmhd(ofile,bitmap_header);
write_pal(ofile,bitmap_header);
write_body(ofile,bitmap_header);
return 1;
}

View File

@ -1,111 +0,0 @@
/*
* Portions of this file are copyright Rebirth contributors and licensed as
* described in COPYING.txt.
* Portions of this file are copyright Parallax Software and licensed
* according to the Parallax license below.
* See COPYING.txt for license details.
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
*/
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include "iff.h"
#include "vga.h"
#include "palette.h"
#include "mem.h"
//#define ANIM_TEST 1 //if defined, read in anim brush
rle_span(ubyte *dest,ubyte *src,int len);
ubyte test_span[] = {0,1,2,3,4,4,5,6,7,8,8,8,8,8,9,10,11,11};
ubyte new_span[256];
extern void gr_pal_setblock( int start, int number, unsigned char * pal );
main(int argc,char **argv)
{
int ret;
grs_bitmap my_bitmap;
ubyte my_palette[256*3];
grs_bitmap *bm_list[100];
int n_bitmaps;
char key;
#if 0
{
int new_len,i;
new_len=rle_span(new_span,test_span,sizeof(test_span));
printf("old span (%d): ",sizeof(test_span));
for (i=0;i<sizeof(test_span);i++) printf("%d ",test_span[i]);
printf("\nnew span (%d): ",new_len);
for (i=0;i<new_len;i++) printf("%d ",new_span[i]);
exit(0);
}
#endif
#ifdef ANIM_TEST
ret = iff_read_animbrush(argv[1],bm_list,100,&n_bitmaps,&my_palette);
#else
ret = iff_read_bitmap(argv[1],&my_bitmap,bm_mode::linear,&my_palette);
bm_list[0] = &my_bitmap;
n_bitmaps = 1;
#endif
printf("ret = %d\n",ret);
printf("error message = <%s>",iff_errormsg(ret));
if (ret == IFF_NO_ERROR) {
int i;
vga_init();
gr_init();
vga_set_mode(SM_320x200C);
for (i=0;i<n_bitmaps;) {
if (argc>2) {
ret = iff_write_bitmap(argv[2],bm_list[i],&my_palette);
printf("ret = %d\n",ret);
}
//gr_pal_setblock(0,256,&my_palette);
gr_palette_load(&my_palette);
//gr_pal_fade_in(grd_curscreen->pal); //in case palette is blacked
gr_ubitmap(0,0,bm_list[i]);
key = getch();
if (key=='-') {if (i) i--;}
else i++;
}
gr_close();
for (i=0;i<n_bitmaps;i++) {
free(bm_list[i]->bm_data);
#ifdef ANIM_TEST
free(bm_list[i]);
#endif
}
}
}

View File

@ -1,61 +0,0 @@
/*
* Portions of this file are copyright Rebirth contributors and licensed as
* described in COPYING.txt.
* Portions of this file are copyright Parallax Software and licensed
* according to the Parallax license below.
* See COPYING.txt for license details.
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
*/
#include <conio.h>
#include <stdio.h>
#include "iff.h"
draw_ubitmap(int x,int y,grs_bitmap *bm)
{
int xx,yy;
short *data15 = (short *) bm->bm_data;
printf("x,y=%d,%d w,h=%d,%d\n",x,y,bm->bm_w,bm->bm_h);
for (yy=0;yy<bm->bm_h;yy++)
for (xx=0;xx<bm->bm_w;xx++)
gr_vesa_pixel15(x+xx,y+yy,data15[yy*bm->bm_w+xx]);
}
main(int argc,char **argv)
{
int ret;
grs_bitmap my_bitmap;
ubyte my_palette[256*3];
ret = iff_read_bitmap(argv[1],&my_bitmap,bm_mode::rgb15,&my_palette);
printf("ret = %d\n",ret);
if (ret == IFF_NO_ERROR) {
gr_vesa_setmode(0x110);
draw_ubitmap(0,0,&my_bitmap);
getch();
}
}