Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Datafile Creation

This thread is locked; no one can reply to it. rss feed Print
Datafile Creation
Rick
Member #3,572
June 2003
avatar

Via http://alleg.sourceforge.net/onlinedocs/en/datafile.html

Quote:

DAT_BITMAP =
DAT_C_SPRITE =
DAT_XC_SPRITE =
16 bit - <bits> - bitmap color depth
16 bit - <width> - bitmap width
16 bit - <height> - bitmap height
var - <data> - bitmap data

What is var for bitmap data supposed to be? A BITMAP structure or just the bytes that make up the bitmap.

========================================================
Actually I think I'm a tad ugly, but some women disagree, mostly Asians for some reason.

Evert
Member #794
November 2000
avatar

I think it's the raw data for each scanline one after the other, but why don't you check the code in allegro/tools/plugins/datimage.c?

Rick
Member #3,572
June 2003
avatar

Didn't know to look there. It looks like it is the raw image data

1 pack_mputw(depth, f);
2 pack_mputw(bmp->w, f);
3 pack_mputw(bmp->h, f);
4 
5 switch (depth) {
6 case 16:
7 /* hicolor */
8 for (y=0; y<bmp->h; y++) {
9 p16 = (uint16_t *)bmp->line[y];
10 
11 for (x=0; x<bmp->w; x++) {
12 c = p16[x];
13 r = getr_depth(depth, c);
14 g = getg_depth(depth, c);
15 b = getb_depth(depth, c);
16 c = ((r<<8)&0xF800) | ((g<<3)&0x7E0) | ((b>>3)&0x1F);
17 pack_iputw(c, f);
18 }
19 }
20 break;

Now I just have to figure out a way to do this in VB.NET. The way I'm doing it must be incorrect as the image looks all messed up in the grabber.

========================================================
Actually I think I'm a tad ugly, but some women disagree, mostly Asians for some reason.

Go to: