7 static char * templBase
= "%s\n%s\n%s";
9 void aboutfmt_Picture(char *fmtbuff
)
11 sprintf(fmtbuff
, "%s", templBase
);
14 void getColorString(char **colorString
, UBYTE Depth
, ULONG Colors
, ULONG ModeID
)
18 if ((ModeID
& (HAM_KEY
|EXTRAHALFBRITE_KEY
)) == 0)
20 *colorString
= AllocVec(24, MEMF_ANY
);
21 sprintf(*colorString
, " Colors: %d", (int)Colors
);
29 modeStr
[3] = Depth
+ '0';
34 *colorString
= AllocVec(28 + strlen(modeStr
), MEMF_ANY
);
35 sprintf(*colorString
, " Colors: %d (%s)", (int)Colors
, modeStr
);
40 *colorString
= AllocVec(26, MEMF_ANY
);
43 strcpy(*colorString
, " Colors: Deepcolor");
45 strcpy(*colorString
, " Colors: Truecolor");
47 strcpy(*colorString
, " Colors: Hi-color");
51 void about_Picture(Object
*picture
, char *details
[])
53 struct BitMapHeader
*pictBMH
;
54 IPTR pictCols
, pictMode
;
57 PDTA_ModeID
, &pictMode
,
58 PDTA_BitMapHeader
, &pictBMH
,
59 PDTA_NumColors
, &pictCols
, TAG_DONE
))
61 details
[0] = AllocVec(36, MEMF_ANY
);
62 sprintf(details
[0], " Dimensions: %dx%dx%d", pictBMH
->bmh_Width
, pictBMH
->bmh_Height
, pictBMH
->bmh_Depth
);
63 getColorString(&details
[1], pictBMH
->bmh_Depth
, pictCols
, pictMode
);
68 void about_PicDisp(char *details
[])
74 void aboutfmt_Animation(char *fmtbuff
)
76 sprintf(fmtbuff
, "%s", templBase
);
79 void about_Animation(Object
*picture
, char *details
[])
81 IPTR animWidth
, animHeight
, animDepth
,
86 ADTA_Width
, &animWidth
,
87 ADTA_Height
, &animHeight
,
88 ADTA_Depth
, &animDepth
,
89 ADTA_NumColors
, &animCols
,
90 ADTA_ModeID
, &animMode
,
91 ADTA_Frames
, &animFrames
,
92 ADTA_FramesPerSecond
, &animFPS
, TAG_DONE
))
94 details
[0] = AllocVec(36, MEMF_ANY
);
95 sprintf(details
[0], " Dimensions: %dx%dx%d", (int)animWidth
, (int)animHeight
, (int)animDepth
);
96 getColorString(&details
[1], animDepth
, animCols
, animMode
);
98 details
[2] = AllocVec(32, MEMF_ANY
);
99 sprintf(details
[2], " %d frames @ %dfps", (int)animFrames
, (int)animFPS
);
103 void about_AnimDisp(char *details
[])
110 void aboutfmt_Sample(char *fmtbuff
)
112 sprintf(fmtbuff
, "%s", templBase
);
115 void about_Sample(Object
*picture
, char *details
[])
122 void about_SampDisp(char *details
[])
126 void aboutfmt_Binary(char *fmtbuff
)
128 sprintf(fmtbuff
, "%s", templBase
);
131 void about_Binary(Object
*picture
, char *details
[])
138 void about_BinDisp(char *details
[])
142 struct DTClassInfo DTClassAbout
[] =
144 { GID_PICTURE
, aboutfmt_Picture
, about_Picture
, about_PicDisp
, 10, 3 },
145 { GID_ANIMATION
, aboutfmt_Animation
, about_Animation
, about_AnimDisp
, 10, 3 },
146 { GID_SOUND
, aboutfmt_Sample
, about_Sample
, about_SampDisp
, 10, 3 },
147 { ID_BINARY
, aboutfmt_Binary
, about_Binary
, about_BinDisp
, 10, 3 },
151 struct DTClassInfo
*FindClassInfo(ULONG classid
)
153 struct DTClassInfo
*curHandler
;
155 for (i
= 0; (DTClassAbout
[i
].classID
!= 0); i
++)
157 curHandler
= &DTClassAbout
[i
];
158 if (classid
== curHandler
->classID
)