DMGHL API Document

Table of Contents

1. Interface functions

Interface functions

- dmghl_open_graphics_dat
- dmghl_close_graphics_dat
- dmghl_get_image
- dmghl_release_image

DMGHLDECLARE HDMGHLF DMGHLAPI dmghl_open_graphics_dat(
const char *pszFileIn,
int nDMDFT,
int nIsLittleEndian
);

Arguments:

pszFileIn:
Path name to open file for read.

nDMDFT:
Refer the remark for combination with nIsLittleEndian.

nIsLittleEndian:
Try 0 if file is formatted in BIG-ENDIAN.
Try 1 if file is formatted in LITTLE-ENDIAN.

Subject:

It attempts to open specified graphics.dat.

Return value:

Return non-NULL handle for use in later functions if it succeeds to open.
Return NULL if it failed.

Remark:

Combinations for set nDMDFT and nIsLittleEndian:

Platform | nDMDFT | nIsLittleEndian
DM Atari ST ver | DMDFT_DMCSB1 | FALSE (0)
DM PC | DMDFT_DMCSB2 | TRUE (1)
DM2 Amiga | DMDFT_DM2_CLASSIC | FALSE (0)
DM2 PC98 | DMDFT_DM2_CLASSIC | TRUE (1)
DM2 PC | DMDFT_DM2_EVOLVED | TRUE (1)

DMGHLDECLARE int DMGHLAPI dmghl_close_graphics_dat(
HDMGHLF hFile
);

Arguments:

hFile:
Handle obtained from result of successful calling dmghl_open_graphics_dat.

Subject:

It attempts to close the file identified by hFile and release the occupied memory resource.

Return value:

Return non-zero if it succeeded.
Return zero if it failed.

DMGHLDECLARE int DMGHLAPI dmghl_get_image(
HDMGHLF hFile,
int iBinIdx,
PDMGHLIMGF pImpf
);

Arguments:

hFile:
Handle obtained from result of successful calling dmghl_open_graphics_dat.

iBinIdx:
Binary data index in opened graphics.dat.

pImpf:
If extract operation succeeds, image and misc information is acquired in pImpf.

Subject:

It attempts to extract image.

Return value:

Return non-zero if it succeeded.
Return zero if it failed.

DMGHLDECLARE int DMGHLAPI dmghl_release_image(
PDMGHLIMGF pImgf
);

Arguments:

pImgf:
Extracted data to be released.

Subject:

If attempts to release the bits pixel memory in pImgf and set its pointer to NULL.

Return value:

Return non-zero if it succeeded.
Return zero if it failed.

Arguments:

Subject:

Return value: