本文整理汇总了C++中CHECKF函数的典型用法代码示例。如果您正苦于以下问题:C++ CHECKF函数的具体用法?C++ CHECKF怎么用?C++ CHECKF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CHECKF函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsSTCIETRLEFile
BOOLEAN IsSTCIETRLEFile( CHAR8 * ImageFile )
{
HWFILE hFile;
STCIHeader Header;
UINT32 uiBytesRead;
CHECKF( FileExists( ImageFile ) );
// Open the file and read the header
hFile = FileOpen( ImageFile, FILE_ACCESS_READ, FALSE );
CHECKF( hFile );
if (!FileRead( hFile, &Header, STCI_HEADER_SIZE, &uiBytesRead ) || uiBytesRead != STCI_HEADER_SIZE || memcmp( Header.cID, STCI_ID_STRING, STCI_ID_LEN ) != 0 )
{
DbgMessage( TOPIC_HIMAGE, DBG_LEVEL_3, "Problem reading STCI header." );
FileClose( hFile );
return( FALSE );
}
FileClose( hFile );
if (Header.fFlags & STCI_ETRLE_COMPRESSED)
{
return( TRUE );
}
else
{
return( FALSE );
}
}
示例2: EnterBobbyRAmmo
BOOLEAN EnterBobbyRAmmo()
{
VOBJECT_DESC VObjectDesc;
// load the background graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\ammobackground.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiAmmoBackground));
// load the gunsgrid graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\ammogrid.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiAmmoGrid));
InitBobbyBrTitle();
SetFirstLastPagesForNew( IC_AMMO );
// CalculateFirstAndLastIndexs();
//Draw menu bar
InitBobbyMenuBar( );
RenderBobbyRAmmo( );
return(TRUE);
}
示例3: LoadHistory
BOOLEAN LoadHistory( void )
{
VOBJECT_DESC VObjectDesc;
// load History video objects into memory
// title bar
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\programtitlebar.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiTITLE));
// top portion of the screen background
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\historywindow.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiTOP));
// shaded line
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\historylines.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiSHADELINE));
/*
Not being used??? DF commented out
// vert line
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\historyvertline.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiVERTLINE));
*/
// black divider line - long ( 480 length)
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\divisionline480.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiLONGLINE));
return (TRUE);
}
示例4: InitAnimationCache
BOOLEAN InitAnimationCache( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimCache )
{
UINT32 cnt;
// Allocate entries
AnimDebugMsg( String( "*** Initializing anim cache surface for soldier %d", usSoldierID ) );
pAnimCache->usCachedSurfaces = MemAlloc( sizeof( UINT16 ) * guiCacheSize );
CHECKF( pAnimCache->usCachedSurfaces!= NULL );
AnimDebugMsg( String( "*** Initializing anim cache hit counter for soldier %d", usSoldierID ) );
pAnimCache->sCacheHits = MemAlloc( sizeof( UINT16) * guiCacheSize );
CHECKF( pAnimCache->sCacheHits!= NULL );
// Zero entries
for ( cnt = 0; cnt < guiCacheSize; cnt++ )
{
pAnimCache->usCachedSurfaces[ cnt ] = EMPTY_CACHE_ENTRY;
pAnimCache->sCacheHits[ cnt ] = 0;
}
pAnimCache->ubCacheSize = 0;
// Zero surface databse history for this soldeir
ClearAnimationSurfacesUsageHistory( usSoldierID );
return( TRUE );
}
示例5: InitAimDefaults
BOOLEAN InitAimDefaults()
{
VOBJECT_DESC VObjectDesc;
// load the Rust bacground graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\rustbackground.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiRustBackGround));
// load the Aim Symbol graphic and add it
if(gGameExternalOptions.gfUseNewStartingGearInterface)
{
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
GetMLGFilename( VObjectDesc.ImageFile, MLG_AIMSYMBOL_SMALL );
CHECKF(AddVideoObject(&VObjectDesc, &guiAimSymbol));
//Mouse region for the Links
MSYS_DefineRegion( &gSelectedAimLogo, AIM_SYMBOL_SMALL_X, AIM_SYMBOL_SMALL_Y, AIM_SYMBOL_SMALL_X+AIM_SYMBOL_SMALL_WIDTH, AIM_SYMBOL_SMALL_Y+AIM_SYMBOL_SMALL_HEIGHT, MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectAimLogoRegionCallBack);
MSYS_AddRegion(&gSelectedAimLogo);
}
else
{
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
GetMLGFilename( VObjectDesc.ImageFile, MLG_AIMSYMBOL );
CHECKF(AddVideoObject(&VObjectDesc, &guiAimSymbol));
//Mouse region for the Links
MSYS_DefineRegion( &gSelectedAimLogo, AIM_SYMBOL_X, AIM_SYMBOL_Y, AIM_SYMBOL_X+AIM_SYMBOL_WIDTH, AIM_SYMBOL_Y+AIM_SYMBOL_HEIGHT, MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectAimLogoRegionCallBack);
MSYS_AddRegion(&gSelectedAimLogo);
}
return(TRUE);
}
示例6: EnterBobbyRMisc
BOOLEAN EnterBobbyRMisc()
{
VOBJECT_DESC VObjectDesc;
// load the background graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\miscbackground.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiMiscBackground));
// load the gunsgrid graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\miscgrid.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiMiscGrid));
InitBobbyBrTitle();
guiPrevMiscFilterMode = -1;
guiCurrentMiscFilterMode = -1;
guiCurrentMiscSubFilterMode = -1;
guiPrevMiscSubFilterMode = -1;
SetFirstLastPagesForNew( IC_BOBBY_MISC, guiCurrentMiscFilterMode, guiCurrentMiscSubFilterMode );
//Draw menu bar
InitBobbyMenuBar( );
InitBobbyRMiscFilterBar();
// CalculateFirstAndLastIndexs();
RenderBobbyRMisc( );
return(TRUE);
}
示例7: EnterBriefingRoomEnter
BOOLEAN EnterBriefingRoomEnter()
{
VOBJECT_DESC VObjectDesc;
UINT16 i, usPosY;
//-----------------------------------------
// upon entry to Imp home page
memset(pPlayerBriefingRoomEnterActivationString, 0, sizeof(pPlayerBriefingRoomEnterActivationString));
// reset string position
iStringBriefingRoomEnterPos =0;
// reset activation cursor position
uiCursorBriefingRoomEnterPosition = IMP_PLAYER_ACTIVATION_STRING_X;
// we have now vsisited IMP, reset fact we haven't
fNotVistedImpYet = FALSE;
//------------------------
LaptopInitBriefingRoomEnter();
InitBriefingRoomEnterDefaults();
// load the Rust bacground graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
//FilenameForBPP("LAPTOP\\rustbackground.sti", VObjectDesc.ImageFile);
FilenameForBPP("BriefingRoom\\aimlogo.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiRustBriefingRoomEnterLogoAim));
// load the MemberShipcard graphic and add it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("BriefingRoom\\BUTTONS.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiContentButtonBriefingRoomEnter));
// this procedure will load the activation indent into memory
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("LAPTOP\\ActivationIndent.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiBRIEFINGROOM_MISSIONACTIVATIONINDENT));
//** Mouse Regions **
usPosY = BRIEFINGROOM_MISSION_CONTENTBUTTON_Y + 120;
for(i=0; i<BRIEFINGROOM_MISSION_BUTTONS_DEF; i++)
{
if ( i == 0 )
MSYS_DefineRegion( &gSelectedBriefingRoomEnterTocMenuRegion[i], BRIEFINGROOM_MISSION_TOC_X+120, usPosY, (UINT16)(BRIEFINGROOM_MISSION_TOC_X+120 + BRIEFINGROOM_MISSION_BUTTON_SIZE_X), (UINT16)(usPosY + BRIEFINGROOM_MISSION_BUTTON_SIZE_Y), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectBriefingRoomEnterLocationButton);
MSYS_AddRegion(&gSelectedBriefingRoomEnterTocMenuRegion[i]);
usPosY += BRIEFINGROOM_MISSION_TOC_GAP_Y;
}
fFirstTimeInBriefingRoomEnter = FALSE;
RenderBriefingRoomEnter();
return( TRUE );
}
示例8: GetVideoObjectETRLEProperties
BOOLEAN GetVideoObjectETRLEProperties( HVOBJECT hVObject, ETRLEObject *pETRLEObject, UINT16 usIndex )
{
CHECKF( usIndex >= 0 );
CHECKF( usIndex < hVObject->usNumberOfObjects );
memcpy( pETRLEObject, &( hVObject->pETRLEObject[ usIndex ] ), sizeof( ETRLEObject ) );
return( TRUE );
}
示例9: Copy8BPPImageTo16BPPBuffer
BOOLEAN Copy8BPPImageTo16BPPBuffer( HIMAGE hImage, BYTE *pDestBuf, UINT16 usDestWidth, UINT16 usDestHeight, UINT16 usX, UINT16 usY, SGPRect *srcRect )
{
UINT32 uiSrcStart, uiDestStart, uiNumLines, uiLineSize;
UINT32 rows, cols;
UINT8 *pSrc, *pSrcTemp;
UINT16 *pDest, *pDestTemp;
UINT16 *p16BPPPalette;
p16BPPPalette = hImage->pui16BPPPalette;
// Assertions
Assert( p16BPPPalette != NULL );
Assert( hImage != NULL );
// Validations
CHECKF( hImage->p16BPPData != NULL );
CHECKF( usX >= 0 );
CHECKF( usX < usDestWidth );
CHECKF( usY >= 0 );
CHECKF( usY < usDestHeight );
CHECKF( srcRect->iRight > srcRect->iLeft );
CHECKF( srcRect->iBottom > srcRect->iTop );
// Determine memcopy coordinates
uiSrcStart = srcRect->iTop * hImage->usWidth + srcRect->iLeft;
uiDestStart = usY * usDestWidth + usX;
uiNumLines = ( srcRect->iBottom - srcRect->iTop );
uiLineSize = ( srcRect->iRight - srcRect->iLeft );
CHECKF( usDestWidth >= uiLineSize );
CHECKF( usDestHeight >= uiNumLines );
// Convert to Pixel specification
pDest = ( UINT16*)pDestBuf + uiDestStart;
pSrc = hImage->p8BPPData + uiSrcStart;
DbgMessage( TOPIC_HIMAGE, DBG_LEVEL_3, String( "Start Copying at %p", pDest ) );
// For every entry, look up into 16BPP palette
for( rows = 0; rows < uiNumLines-1; rows++ )
{
pDestTemp = pDest;
pSrcTemp = pSrc;
for ( cols = 0; cols < uiLineSize; cols++ )
{
*pDestTemp = p16BPPPalette[ *pSrcTemp ];
pDestTemp++;
pSrcTemp++;
}
pDest += usDestWidth;
pSrc += hImage->usWidth;
}
// Do last line
DbgMessage( TOPIC_HIMAGE, DBG_LEVEL_3, String( "End Copying at %p", pDest ) );
return( TRUE );
}
示例10: SetFontShade
// Set shades for fonts
BOOLEAN SetFontShade( UINT32 uiFontID, INT8 bColorID )
{
HVOBJECT pFont;
CHECKF( bColorID > 0 );
CHECKF( bColorID < 16 );
pFont = GetFontObject( uiFontID );
pFont->pShadeCurrent = pFont->pShades[ bColorID ];
return( TRUE );
}
示例11: GetVideoObjectETRLEPropertiesFromIndex
BOOLEAN GetVideoObjectETRLEPropertiesFromIndex( UINT32 uiVideoObject, ETRLEObject *pETRLEObject, UINT16 usIndex )
{
HVOBJECT hVObject;
// Get video object
#ifdef _DEBUG
gubVODebugCode = DEBUGSTR_GETVIDEOOBJECTETRLEPROPERTIESFROMINDEX;
#endif
CHECKF( GetVideoObject( &hVObject, uiVideoObject ) );
CHECKF( GetVideoObjectETRLEProperties( hVObject, pETRLEObject, usIndex ) );
return( TRUE );
}
示例12: main
int main(void)
{
const char *filedir = "dirfile";
const char *format = "dirfile/format";
int error, r = 0;
DIRFILE *D;
gd_entry_t E, e;
E.field = "data";
E.field_type = GD_LINCOM_ENTRY;
E.fragment_index = 0;
E.EN(lincom,n_fields) = 1;
E.comp_scal = 0;
E.in_fields[0] = "INDEX";
E.EN(lincom,m)[0] = 1.;
E.scalar[0] = NULL;
E.scalar[0 + GD_MAX_LINCOM] = "c";
E.scalar_ind[0 + GD_MAX_LINCOM] = 3;
rmdirfile();
D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE);
gd_add_spec(D, "c CARRAY INT64 1 2 3 4", 0);
gd_add(D, &E);
error = gd_error(D);
/* check */
gd_entry(D, "data", &e);
if (gd_error(D))
r = 1;
else {
CHECKI(e.field_type, GD_LINCOM_ENTRY);
CHECKI(e.fragment_index, 0);
CHECKI(e.EN(lincom,n_fields), 1);
CHECKF(e.EN(lincom,m)[0], 1);
CHECKF(e.EN(lincom,b)[0], 4);
CHECKP(e.scalar[0]);
CHECKS(e.scalar[0 + GD_MAX_LINCOM], "c");
CHECKI(e.scalar_ind[0 + GD_MAX_LINCOM], 3);
gd_free_entry_strings(&e);
}
gd_close(D);
unlink(format);
rmdir(filedir);
CHECKI(error, GD_E_OK);
return r;
}
示例13: main
int main(void)
{
const char *filedir = "dirfile";
const char *format = "dirfile/format";
const char *data = "dirfile/data";
const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n"
"div RECIP data 230.\n";
int32_t data_data[256];
int fd, ret, error, n, r = 0;
DIRFILE *D;
double div[2] = {1093., 3290.};
gd_entry_t E;
rmdirfile();
mkdir(filedir, 0777);
for (fd = 0; fd < 256; ++fd)
data_data[fd] = (int32_t)fd;
fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666);
write(fd, format_data, strlen(format_data));
close(fd);
fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666);
write(fd, data_data, 256 * sizeof(int32_t));
close(fd);
D = gd_open(filedir, GD_RDWR | GD_VERBOSE);
ret = gd_alter_crecip(D, "div", "phase", div);
error = gd_error(D);
n = gd_entry(D, "div", &E);
gd_close(D);
unlink(data);
unlink(format);
rmdir(filedir);
CHECKI(error,0);
CHECKI(n,0);
CHECKI(ret,0);
CHECKF(E.EN(recip,cdividend)[0], div[0]);
CHECKF(E.EN(recip,cdividend)[1], div[1]);
CHECKS(E.in_fields[0], "phase");
gd_free_entry_strings(&E);
return r;
}
示例14: LoadCharacterPortrait
BOOLEAN LoadCharacterPortrait( void )
{
// this function will load the character's portrait, to be used on portrait button
VOBJECT_DESC VObjectDesc;
// load it
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
if( fCharacterIsMale )
{
if ( gIMPMaleValues[ iPortraitNumber ].Enabled == 1 )
{
//sprintf( VObjectDesc.ImageFile, "Faces\\%02d.sti", gIMPMaleValues[ iPortraitNumber ].PortraitId );
sprintf( VObjectDesc.ImageFile, "IMPFaces\\%02d.sti", gIMPMaleValues[ iPortraitNumber ].PortraitId );
}
}
else
{
if ( gIMPFemaleValues[ iPortraitNumber ].Enabled == 1 )
{
//sprintf( VObjectDesc.ImageFile, "Faces\\%02d.sti", gIMPFemaleValues[ iPortraitNumber ].PortraitId );
sprintf( VObjectDesc.ImageFile, "IMPFaces\\%02d.sti", gIMPFemaleValues[ iPortraitNumber ].PortraitId );
}
}
//FilenameForBPP( pPlayerSelectedFaceFileNames[ iPortraitNumber ] , VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiCHARACTERPORTRAIT));
return( TRUE );
}
示例15: BltVideoObjectOutlineShadowFromIndex
BOOLEAN BltVideoObjectOutlineShadowFromIndex(UINT32 uiDestVSurface, UINT32 uiSrcVObject, UINT16 usIndex, INT32 iDestX, INT32 iDestY )
{
UINT16 *pBuffer;
UINT32 uiPitch;
HVOBJECT hSrcVObject;
// Lock video surface
pBuffer = (UINT16*)LockVideoSurface( uiDestVSurface, &uiPitch );
if ( pBuffer == NULL )
{
return( FALSE );
}
// Get video object
#ifdef _DEBUG
gubVODebugCode = DEBUGSTR_BLTVIDEOOBJECTOUTLINESHADOWFROMINDEX;
#endif
CHECKF( GetVideoObject( &hSrcVObject, uiSrcVObject ) );
if( BltIsClipped( hSrcVObject, iDestX, iDestY, usIndex, &ClippingRect) )
{
Blt8BPPDataTo16BPPBufferOutlineShadowClip((UINT16*)pBuffer, uiPitch, hSrcVObject, iDestX, iDestY, usIndex, &ClippingRect );
}
else
{
Blt8BPPDataTo16BPPBufferOutlineShadow((UINT16*)pBuffer, uiPitch, hSrcVObject, iDestX, iDestY, usIndex );
}
// Now we have the video object and surface, call the VO blitter function
UnLockVideoSurface( uiDestVSurface );
return( TRUE );
}