Amulets & Armor  v1.02
Open Source Game
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Data Structures | Functions
PICS

Picture Resource File. More...

Data Structures

struct  T_resourceEntry
 

Functions

T_void PictureCheck (T_void *p_picture)
 
E_Boolean PictureExist (T_byte8 *name)
 
T_resource PictureFind (T_byte8 *name)
 
T_word16 PictureGetHeight (T_void *p_picture)
 
T_byte8PictureGetName (T_void *p_picture)
 
T_word16 PictureGetWidth (T_void *p_picture)
 
T_void PictureGetXYSize (T_void *p_picture, T_word16 *sizeX, T_word16 *sizeY)
 
T_byte8PictureLock (T_byte8 *name, T_resource *res)
 
T_byte8PictureLockData (T_byte8 *name, T_resource *res)
 
T_byte8PictureLockDataQuick (T_resource res)
 
T_byte8PictureLockQuick (T_resource res)
 
T_void PicturePrint (FILE *fp, T_void *p_pic)
 
T_void PicturesDump (T_void)
 
T_void PicturesFinish (T_void)
 
T_void PicturesInitialize (T_void)
 
T_bitmapPictureToBitmap (T_byte8 *pic)
 
T_void PictureUnfind (T_resource res)
 
T_void PictureUnlock (T_resource res)
 
T_void PictureUnlockAndUnfind (T_resource res)
 

Detailed Description

Picture Resource File.

All graphics are stored in the PICS resource file. This is the accessor code to all those pictures. Pictures can be locked as a picture or locked as just a raw data file.

See Also
http://www.amuletsandarmor.com/AALicense.txt

Function Documentation

T_void PictureCheck ( T_void p_picture)
E_Boolean PictureExist ( T_byte8 name)

PictureExist determines if a the given name corresponds to a picture in the picture resource file.

Parameters
name– Name of picture to check for existance
Returns
TRUE = found, FALSE = not found
T_resource PictureFind ( T_byte8 name)

PictureFind finds the corresponding resource handle for the given resource name.

Parameters
name– Name of resource to find.
Returns
Corresponding resource handle or RESOURCE_BAD
T_word16 PictureGetHeight ( T_void p_picture)

PictureGetHeight returns the picture height

Parameters
p_picture– Pointer to the picture to get size of
Returns
picture height
T_byte8* PictureGetName ( T_void p_picture)

PictureGetName returns a pointer to the picture's stub name (without sub-directory info.)

Parameters
p_picture– Pointer to the picture
Returns
Found name
T_word16 PictureGetWidth ( T_void p_picture)

PictureGetWidth returns the pictures with.

Parameters
p_picture– Pointer to the picture to get size of
Returns
picture width
T_void PictureGetXYSize ( T_void p_picture,
T_word16 sizeX,
T_word16 sizeY 
)

PictureGetXY size gets the size of the picture and returns it by reference.

Parameters
p_picture– Pointer to the picture to get size of
sizeX– Get the size of the picture in the X
sizeY– Get the size of the picture in the Y
T_byte8* PictureLock ( T_byte8 name,
T_resource res 
)
T_byte8* PictureLockData ( T_byte8 name,
T_resource res 
)

PictureLockData is the same as PictureLock except that it is used to lock non-pictures in the picture database. Therefore, all of the data is available (pictures skip some bytes at the beginning).

Parameters
name– Name of resource to load
res– Pointer to resource to record where the resource came from. Is used by PictureUnlock.
Returns
Pointer to picture data.
T_byte8* PictureLockDataQuick ( T_resource  res)

PictureLockQuick is a simpler lock routine for a picture since it takes the resource handle of an already found picture (from PictureFind).

NOTE: Do NOT call GrDrawBitmap (or similar) with the returned pointer from this routine. Use PictureToBitmap to get the correct pointer.

Parameters
res– Resource of picture to lock.
Returns
Pointer to resource data.
T_byte8* PictureLockQuick ( T_resource  res)

PictureLockQuick is a simpler lock routine for a picture since it takes the resource handle of an already found picture (from PictureFind).

NOTE: Do NOT call GrDrawBitmap (or similar) with the returned pointer from this routine. Use PictureToBitmap to get the correct pointer.

Parameters
res– Resource of picture to lock.
Returns
Pointer to resource data.
T_void PicturePrint ( FILE *  fp,
T_void p_pic 
)

PicturePrint prints out the structure related to the given picture to the given output.

Parameters
fp– File to output picture info
p_pic– Picture to print
T_void PicturesDump ( T_void  )

PicturesDump outputs the picture index file.

T_void PicturesFinish ( T_void  )

PicturesFinish is called when the pictures resource file is no longer needed (typically when exiting the program). When this occurs, the resource file is closed out.

T_void PicturesInitialize ( T_void  )

PicturesInitialize opens up the picture database in preparation for all future picture locking and unlocking.

T_bitmap* PictureToBitmap ( T_byte8 pic)

PictureToBitmap converts a picture pointer (from PictureLock) into a corresponding bitmap pointer for use by the graphic drawing routines.

NOTE: Make sure you ONLY pass a pointer from PictureLock or PictureLockQuick

Parameters
pic– Pointer to picture
Returns
Pointer to bitmap
T_void PictureUnfind ( T_resource  res)

PictureUnfind removes all references to the given resource picture.

Parameters
res– Resource to unfind
T_void PictureUnlock ( T_resource  res)

PictureUnlock removes a picture that was in memory.

Parameters
res– Resource to the picture.
T_void PictureUnlockAndUnfind ( T_resource  res)

PictureUnlockAndUnfind does a PictureUnlock and then a PictureUnfind.

Parameters
res– Resource to unlock and unfind