示例#1
0
文件: brlan.c 项目: Symonele/benzin
static int FourCCInList(fourcc cc)
{
    int i;
    for(i = 0; i < 7; i++)
        if(FourCCsMatch(cc, tag_FourCCs[i])) return 1;
    return 0;
}
示例#2
0
文件: brlyt.c 项目: HowardC/benzin
void PrintBRLYTEntries(brlyt_entry *entries, int entrycnt, u8* brlyt_file)
{
	int i;
	
	for(i = 0; i < entrycnt; i++) {
		printf("\n	Index %d (@%08x):\n", i, entries[i].data_location - 8);
		if((FourCCsMatch(entries[i].magic, pic1_magic) == 1) || (FourCCsMatch(entries[i].magic, pan1_magic) == 1) ||
		   (FourCCsMatch(entries[i].magic, bnd1_magic) == 1) || (FourCCsMatch(entries[i].magic, wnd1_magic) == 1)) {
			dbgprintf("pic1\n");
//			PrintBRLYTEntry_pic1(entries[i], brlyt_file);
			brlyt_pic1_chunk data;
			BRLYT_fileoffset = entries[i].data_location;
			BRLYT_ReadDataFromMemory(&data, brlyt_file, sizeof(brlyt_pic1_chunk));
			printf("%08x\n", BRLYT_fileoffset);
			printf("		Name: %s (%08x)\n", data.name);
			printf("		Type: %c%c%c%c\n", entries[i].magic[0], entries[i].magic[1], entries[i].magic[2], entries[i].magic[3]);
			printf("		Flags: %04x (%08x)\n", be16(data.flags));
			printf("		Alpha: %04x (%08x)\n", be16(data.alpha));
			printf("		X: %f (%08x) (%08x)\n", be32(data.x), &data.x, &data);
			printf("		Y: %f (%08x)\n", be32(data.y));
			printf("		X Magnification: %f (%08x)\n", be32(data.xmag));
			printf("		Y Magnification: %f (%08x)\n", be32(data.ymag));
			printf("		Width: %f (%08x)\n", be32(data.width));
			printf("		Height: %f (%08x)\n", be32(data.height));
			printf("		Angle: %f (%08x)\n", be32(data.angle));
			printf("		unk1: %f (%08x)\n", be32(data.unk[0]));
			printf("		unk2: %f (%08x)\n", be32(data.unk[1]));
			printf("		unk3: %f (%08x)\n", be32(data.unk[2]));
		}else if((FourCCsMatch(entries[i].magic, lyt1_magic) == 1)) {
			dbgprintf("lyt1\n");
			PrintBRLYTEntry_lyt1(entries[i], brlyt_file);
		}else if((FourCCsMatch(entries[i].magic, grp1_magic) == 1)) {
			dbgprintf("grp1\n");
			PrintBRLYTEntry_grp1(entries[i], brlyt_file);
		}else if((FourCCsMatch(entries[i].magic, txl1_magic) == 1) || (FourCCsMatch(entries[i].magic, mat1_magic) == 1) ||
			 (FourCCsMatch(entries[i].magic, fnl1_magic) == 1)) {
			dbgprintf("img\n");
			PrintBRLYTEntry_img(entries[i], brlyt_file);
		}else
			printf("		Unknown tag (%c%c%c%c)!\n",entries[i].magic[0],entries[i].magic[1],entries[i].magic[2],entries[i].magic[3]);
	}
}