Ninja Library - Texture Function

njGetTextureErrStat

Returns texture error

FORMAT

NJS_TEXERRSTAT *njGetTextureErrStat( void )

PARAMETER

None

RETURN

Address of texture error variable

DESCRIPTION

Obtains the address of the internal texture error variable by getting the pointer for the return value NJS_TEXERRSTAT structure.

This function can be used to find errors that occurred within the texture function. The return values for texture-related functions indicate success or failure; when an error is returned immediately after a function has been executed, this function is used to determine the type of error and to take action in response to that error.

An error value is valid until one of the following texture-related functions that return true/false values is called from the function in which the error occurred.

n, globalIndex

Values are returned in these variable if the texture number and the global index are known when an error has occurred within a texture function. The default for both is 0xFFFFFFFF.

texerr

Returns the type of error in the texture. The following values that are defined in Ninjadef.h will be returned.

 NJD_TEXERR_FILEOPEN  File open error 
 NJD_TEXERR_EXTND  File extension error 
 NJD_TEXERR_HEADER  File header error 
 NJD_TEXERR_FILELOAD  File load error 
 NJD_TEXERR_SURFACE  Insufficient texture memory error 
 NJD_TEXERR_MAINMEMORY  Insufficient main memory error 
 NJD_TEXERR_TEXMEMLOAD  Texture memory load error 
 NJD_TEXERR_GLOBAL  Global index error 
 NJD_TEXERR_OTHER  Other error 

The default value is "0".

gdstat

When an error occurs while a file is being loaded from GD, the function gdFsGetStat(), which gets the GD status, is executed, and the result is loaded in gdstat. In this case, texerr is NJD_TEXERR_FILELOAD.

GDD_STAT_IDLE (default)
GDD_STAT_COMPLETE
GDD_STAT_READ
GDD_STAT_SEEK
GDD_STAT_BUSY
GDD_STAT_ERR
GDD_STAT_FATAL
GDD_STAT_CONTINUE
GDD_STAT_UNDEF

For details, refer to the Shinobi Function Reference.

gderr

When an error occurs while a file is being loaded from GD, the function gdFsGetErrStat(), which gets the GD error, is executed after the function that gets the GD status is executed, and the result is loaded in gderr.

GDD_ERR_OK (default)
GDD_ERR_INIT
GDD_ERR_RESET
GDD_ERR_LIBOV
GDD_ERR_MOUNT
GDD_ERR_DISC
GDD_ERR_DIRREC
GDD_ERR_CANTOPEN
GDD_ERR_NOTFOUND
GDD_ERR_NOHNDL
GDD_ERR_ILLHNDL
GDD_ERR_NOTDIR
GDD_ERR_DIROVER
GDD_ERR_BUSY
GDD_ERR_32ALIGN
GDD_ERR_SIZE
GDD_ERR_SEEK
GDD_ERR_OFS
GDD_ERR_ILLTMODE
GDD_ERR_READ
GDD_ERR_NOTREAD
GDD_ERR_TOUT
GDD_ERR_EOF
GDD_ERR_TRAYOPEND
GDD_ERR_SIZEOVER
GDD_ERR_FATAL
GDD_ERR_UNDEF
GDD_ERR_NOERR
GDD_ERR_RECOVER
GDD_ERR_NOTREADY
GDD_ERR_MEDIA
GDD_ERR_HWARE
GDD_ERR_ILLREQ
GDD_ERR_UNITATTENT
GDD_ERR_PROTECT
GDD_ERR_ABORT
GDD_ERR_NOREADABLE
GDD_ERR_CHECKBUSY


EXAMPLE

NJS_TEXERRSTAT *texerr;
texerr = njGetTextureErrStat();
if(njLoadTexture(&texlist) < 0){
	if(texerr->gderr == GDD_ERR_UNITATTENT){
		/* Confirm GD open */
		topencheck();
	}
}

njGetTextureErrStat
COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999
 For details, refer to the Shinobi Function Reference.