本文整理汇总了C++中Dbg_Assert函数的典型用法代码示例。如果您正苦于以下问题:C++ Dbg_Assert函数的具体用法?C++ Dbg_Assert怎么用?C++ Dbg_Assert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Dbg_Assert函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Dbg_Assert
//-----------------------------------------------------------------------------
// Name: ~CLevelLoader()
// Desc: Destructor
//-----------------------------------------------------------------------------
CLevelLoader::~CLevelLoader()
{
// Ensure we are not being deleted in the middle of an IO op.
Dbg_Assert( IsIdle());
// These should be already be cleaned up.
Dbg_Assert( m_hSignature == INVALID_HANDLE_VALUE );
Dbg_Assert( m_pSysMemBuffer == NULL );
Dbg_Assert( m_pFileSig == NULL );
// Close all handles.
for( UINT i = 0; i < m_dwNumLevels; i++ )
{
CloseHandle( m_pLevels[i].hDVDFile );
CloseHandle( m_pLevels[i].hHDFile );
CloseHandle( m_pLevels[i].hSigFile );
}
// We don't own this memory, so don't delete it.
m_pSysMemData = NULL;
// Free the level state array.
delete [] m_pLevels;
m_pLevels = NULL;
}
示例2: Dbg_Assert
void CCar::debug_wheels()
{
Dbg_Assert( GetModel() );
Gfx::CSkeleton* pCarSkeleton = this->GetSkeleton();
Dbg_Assert( pCarSkeleton );
// draw skeleton
for ( int i = 0; i < 6; i++ )
{
Mth::Matrix objMatrix = m_matrix;
objMatrix[Mth::POS] = m_pos;
Mth::Matrix wsMatrix = *(pCarSkeleton->GetMatrices() + i) * objMatrix;
Mth::Vector pos = wsMatrix[Mth::POS];
pos[Y] += 48.0f;
wsMatrix[Mth::POS] = Mth::Vector( 0.0f, 0.0f, 0.0f, 1.0f );
// set up bounding box
SBBox theBox;
theBox.m_max.Set(10.0f, 10.0f, 10.0f);
theBox.m_min.Set(-10.0f, -10.0f, -10.0f);
// For now, draw a bounding box
Gfx::AddDebugBox( wsMatrix, pos, &theBox, NULL, 1, NULL );
}
}
示例3: Dbg_Assert
Str::String SSpecialTrickInfo::GetTrickSlotString ( void ) const
{
if ( IsUnassigned() )
{
return Script::GetLocalString( "sp_str_unassigned" );
}
Script::CArray* pButtonArray = Script::GetArray( "SpecialCombos" );
Dbg_Assert( pButtonArray );
for ( int i = 0; i < (int)pButtonArray->GetSize(); i++ )
{
Script::CScriptStructure* pStructure = pButtonArray->GetStructure( i );
Dbg_Assert( pStructure );
uint32 currTrickSlot;
pStructure->GetChecksum( "trickslot", &currTrickSlot, true );
if ( currTrickSlot == m_TrickSlot )
{
const char* pTrickSlotString;
pStructure->GetText( "desc", &pTrickSlotString, true );
return pTrickSlotString;
}
}
return "Unknown";
}
示例4: Dbg_Assert
void CGapManager::EndGap(CClonedPiece *pGapPiece, CConcreteMetaPiece *pRegularMeta, int tab_index)
{
Dbg_Assert(pGapPiece);
Dbg_Assert(pRegularMeta);
Dbg_MsgAssert(tab_index >= 0 && tab_index < vMAX_GAPS, ("invalid tab_index"));
GapInfo *pStartInfo = mp_gapInfoTab[tab_index];
Dbg_Assert(pStartInfo);
//Ryan("Ending gap 0x%x\n", m_currentId);
// find empty slot
for (int i = 0; i < vMAX_GAPS; i++)
if (!mp_gapInfoTab[i])
{
mp_gapInfoTab[i] = pStartInfo;
mp_gapInfoTab[i]->m_id[1] = m_currentId++;
mp_gapInfoTab[i]->mp_gapPiece[1] = pGapPiece;
//mp_gapInfoTab[i]->mp_gapPiece[0]->UnmarkAsGapInProgress();
//mp_gapInfoTab[i]->mp_gapPiece[1]->UnmarkAsGapInProgress();
mp_gapInfoTab[i]->mp_regularMeta[1] = pRegularMeta;
mp_gapInfoTab[i]->m_descriptor.tabIndex = tab_index;
m_startOfGap[i] = false;
return;
}
Dbg_MsgAssert(0, ("out of gap slots"));
return;
}
示例5: GetGoalManager
Script::CStruct* CBettingGuy::GetBetParams()
{
Script::CStruct* p_params = NULL;
if ( m_currentMinigame )
{
CGoalManager* pGoalManager = GetGoalManager();
Dbg_Assert( pGoalManager );
CGoal* pGoal = pGoalManager->GetGoal( m_currentMinigame );
Dbg_Assert( pGoal );
Script::CStruct* p_temp = pGoal->GetParams();
switch ( m_currentDifficulty )
{
case 1:
p_temp->GetStructure( "bet_easy", &p_params, Script::NO_ASSERT );
break;
case 2:
p_temp->GetStructure( "bet_medium", &p_params, Script::NO_ASSERT );
break;
case 3:
p_temp->GetStructure( "bet_hard", &p_params, Script::NO_ASSERT );
break;
default:
Dbg_MsgAssert( 0, ( "Betting game had unknown difficulty level" ) );
}
}
return p_params;
}
示例6: Dbg_Assert
void Entity::AttachComponent(Component* component)
{
Dbg_Assert(component != NULL);
Dbg_Assert(FindComponent(component) == NULL);
m_components.insert(STL::pair<CRC, Component*>(component->GetName(), component));
component->Attach(this);
}
示例7: GetSkaterCorePhysicsComponentFromObject
void CSkaterFinalizePhysicsComponent::Finalize ( )
{
mp_core_physics_component = GetSkaterCorePhysicsComponentFromObject(GetObject());
mp_state_component = GetSkaterStateComponentFromObject(GetObject());
Dbg_Assert(mp_core_physics_component);
Dbg_Assert(mp_state_component);
}
示例8: Dbg_Assert
CPs2Mesh::CPs2Mesh(uint32* pModelData, int modelDataSize, uint8* pCASData, Nx::CTexDict* pTexDict, uint32 texDictOffset, bool isSkin, bool doShadowVolume)
{
Dbg_Assert( pTexDict );
mp_texDict = pTexDict;
// polys should only be hidden once
m_polysAlreadyHidden = false;
m_isPipped = false;
m_numCASData = 0;
// don't do this for models
if ( isSkin && pCASData )
{
build_casdata_table( pCASData );
}
// GJ: The geomnodes blow off the texDictOffset,
// which means it won't work with skater models,
// or the 10 board gameobjs in the boardshop.
if ( !isSkin && texDictOffset == 0 )
{
// since we're not actually opening a PIP file
// we don't need to keep track of it
m_isPipped = false;
// this should already be in GEOM format,
// by the time the data arrives here...
// (we're not loading up the Pip through the
// normal Pip::Load process, so we need
// to remember the pointer to the pip data
// so that we can delete it later)
mp_pipData = (uint8*)Mem::Malloc( modelDataSize );
Dbg_Assert( mp_pipData );
memcpy( mp_pipData, pModelData, modelDataSize );
// process data in place
// final arg (0) says to hold it in a database to be rendered later
// (as opposed to rendering it unconditionally, LOADFLAG_RENDERNOW)
mp_geomNode = NxPs2::CGeomNode::sProcessInPlace( mp_pipData, 0 );
// Get hierarchy array
mp_hierarchyObjects = (CHierarchyObject*) NxPs2::CGeomNode::sGetHierarchyArray(mp_pipData, m_numHierarchyObjects);
}
else
{
NxPs2::sScene* pTextureDictionary = ((Nx::CPs2TexDict*)mp_texDict)->GetEngineTextureDictionary();
NxPs2::LoadScene( pModelData, modelDataSize, pTextureDictionary, true, true, texDictOffset, doShadowVolume );
mp_geomNode = NULL;
}
// temporary lookup table is no longer needed
NxPs2::DestroyCASDataLookupTable();
}
示例9: Dbg_Assert
void CTexDict::AddTexture(CTexture *p_texture)
{
Dbg_Assert(mp_texture_lookup);
Dbg_Assert(p_texture);
mp_texture_lookup->PutItem(p_texture->GetChecksum(), p_texture);
plat_add_texture(p_texture);
}
示例10: GetBetParams
bool CBettingGuy::EndBetAttempt( uint32 goalId )
{
// this acts like a secondary deactivate
if ( IsActive() && m_currentMinigame == goalId && m_inAttempt && !m_shouldMove )
{
//printf("CBettingGuy::EndBetAttempt\n");
// printf("step 2\n");
m_inAttempt = false;
Script::CStruct* pBetParams = GetBetParams();
// check that they haven't exceeded the number of tries
int max_attempts;
pBetParams->GetInteger( "tries", &max_attempts, Script::ASSERT );
// we're challenging them to break a record
CGoalManager* pGoalManager = GetGoalManager();
Dbg_Assert( pGoalManager );
Script::CStruct* pMinigameParams = pGoalManager->GetGoal( m_currentMinigame )->GetParams();
Dbg_Assert( pMinigameParams );
if ( m_currentChallenge )
{
// printf("step 3\n");
int last_attempt;
if ( pMinigameParams->GetInteger( "last_attempt", &last_attempt, Script::NO_ASSERT ) )
{
printf("got a last attempt of %i\n", last_attempt);
printf("m_currentChallenge is %i\n", m_currentChallenge);
if ( last_attempt >= m_currentChallenge )
{
// printf("you won the bet!\n");
// beat the bet and call the minigame's bet_success script
this->Win();
return true;
}
}
}
// check that this isn't their last try
m_numTries++;
if ( m_numTries >= max_attempts )
{
Lose();
return true;
}
// if it's not a challenge minigame, it's probably a trickspot
// minigame. In that case, we'll be told when the game is won
// the the gap script.
}
return false;
}
示例11: Dbg_MsgAssert
void CGapManager::SetGapInfo(int tab_index, GapDescriptor &descriptor)
{
Dbg_MsgAssert(tab_index >= 0 && tab_index < vMAX_GAPS, ("invalid tab_index"));
Dbg_Assert(mp_gapInfoTab[tab_index]);
Dbg_Assert(descriptor.tabIndex >= 0 && descriptor.tabIndex < vMAX_GAPS);
sprintf(mp_gapInfoTab[tab_index]->mp_text, "%s", descriptor.text);
mp_gapInfoTab[tab_index]->m_descriptor = descriptor;
RegisterGapsWithSkaterCareer();
//mp_gapInfoTab[tab_index]->mp_gapPiece[0]->MakeTriggerable(true);
//mp_gapInfoTab[tab_index]->mp_gapPiece[1]->MakeTriggerable(true);
}
示例12: Dbg_Assert
void CManual::Init ( CCompositeObject *pSkater )
{
mpSkater = pSkater;
Dbg_Assert(mpSkater);
mpSkaterBalanceTrickComponent = GetSkaterBalanceTrickComponentFromObject(mpSkater);
Dbg_Assert(mpSkaterBalanceTrickComponent);
mpSkaterScoreComponent = GetSkaterScoreComponentFromObject(mpSkater);
Dbg_Assert(mpSkaterScoreComponent);
mpInputComponent = GetInputComponentFromObject(mpSkater);
Dbg_Assert(mpInputComponent);
}
示例13: Dbg_MsgAssert
CGeom * CPs2Geom::plat_clone(bool instance, CModel* pDestModel)
{
Dbg_MsgAssert(mp_instance == NULL, ("Wrong version of CPs2Geom::plat_clone() for CGeomNodes"));
Dbg_Assert(mp_oldInstance);
// Copy into new geom
CPs2Geom *p_new_geom = new CPs2Geom(*this);
Dbg_Assert(p_new_geom);
int numBones;
numBones = pDestModel->GetNumBones();
Mth::Matrix temp;
temp.Identity();
p_new_geom->mp_matrices = ((CPs2Model*)pDestModel)->GetMatrices();
NxPs2::sScene* pScene = mp_oldInstance->GetScene();
Dbg_Assert( pScene );
if ( numBones )
{
p_new_geom->mp_oldInstance = new NxPs2::CInstance(pScene, temp, mp_oldInstance->HasColorPerMaterial(), numBones, p_new_geom->mp_matrices );
}
else
{
p_new_geom->mp_oldInstance = new NxPs2::CInstance(pScene, temp, mp_oldInstance->HasColorPerMaterial());
}
Dbg_Assert(p_new_geom->mp_oldInstance);
// Copy the colors from instance
if (mp_oldInstance->HasColorPerMaterial())
{
int num_colors = mp_oldInstance->GetScene()->NumMeshes;
for (int i = 0; i < num_colors; i++)
{
p_new_geom->mp_oldInstance->SetMaterialColorByIndex(i, mp_oldInstance->GetMaterialColorByIndex(i));
}
}
else
{
p_new_geom->mp_oldInstance->SetColor(mp_oldInstance->GetColor());
}
return p_new_geom;
}
示例14: get_movie_details
bool CMovieManager::SetMoviePauseMode( uint32 name, bool pause_mode )
{
if ( m_movieDetailsList.CountItems() == 0 )
{
// no movies in the queue
return false;
}
if ( name == 0 )
{
// no name specified, so set the current movie
CMovieDetails* pDetails = get_movie_details( 0 );
Dbg_Assert( pDetails );
pDetails->SetPauseMode( pause_mode );
}
else
{
// a name was specified, so only do this movie
CMovieDetails* pDetails = get_movie_details_by_name( name );
if ( pDetails )
{
pDetails->SetPauseMode( pause_mode );
}
else
{
Dbg_MsgAssert( 0, ( "Movie to set pause mode (%s) not found\n", Script::FindChecksumName(name) ) );
}
}
return true;
}
示例15: Dbg_Assert
void CCollisionComponent::InitCollision( Nx::CollType type, Nx::CCollObjTriData *p_coll_tri_data )
{
Dbg_Assert( !mp_collision );
if ( p_coll_tri_data )
{
mp_collision = Nx::CCollObj::sCreateMovableCollision(type, p_coll_tri_data, 1, GetObject());
}
else
{
Obj::CModelComponent* pModelComponent = GetModelComponentFromObject( GetObject() );
Dbg_MsgAssert( pModelComponent, ( "Initing collision on something with no model component" ) );
Nx::CModel* pModel = pModelComponent->GetModel();
Dbg_MsgAssert( pModel, ( "Initing collision on something with no model" ) );
Ass::CAssMan * ass_man = Ass::CAssMan::Instance();
Nx::CMesh* pMesh = (Nx::CMesh*)ass_man->GetAsset(pModel->GetFileName(), false);
if (pMesh)
{
mp_collision = Nx::CCollObj::sCreateMovableCollision(type, pMesh->GetCollisionTriDataArray(), pMesh->GetCollisionTriDataArraySize(), GetObject());
}
else
{
mp_collision = Nx::CCollObj::sCreateMovableCollision(type, NULL, 0, GetObject());
}
}
}