本文整理匯總了C++中AssertEx函數的典型用法代碼示例。如果您正苦於以下問題:C++ AssertEx函數的具體用法?C++ AssertEx怎麽用?C++ AssertEx使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AssertEx函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: AssertEx
TIMESTAMP_STRUCT* CAutoTableManager::GetTableItemInLineAsDATETIME(UINT uItemIndex, UINT uLineIndex)
{
m_pDataTime = (TIMESTAMP_STRUCT*)this->GetTableItemInLine(uItemIndex, uLineIndex);
AssertEx(AL_NORMAL, m_pDataTime,_T("m_pDataTime為空,函數失敗"));
AssertEx(AL_NORMAL, (m_pAi[uItemIndex].m_pAta == MS_SQL_TYPE_DATETIME),_T("類型不匹配,錯誤傳參"));
return m_pDataTime;
}
示例2: AssertEx
BOOL GaiBangSkill004_T::EffectOnUnitOnce(Obj_Character& rMe, Obj_Character& rTar, BOOL bCriticalFlag) const
{
__ENTER_FUNCTION
SkillInfo_T& rSkillInfo = rMe.GetSkillInfo();
TargetingAndDepletingParams_T& rParams = rMe.GetTargetingAndDepletingParams();
INT nDepleteStrikePointSegment = rParams.GetDepletedStrikePoints()/STRIKE_POINT_SEGMENT_SIZE;
if(1>nDepleteStrikePointSegment)
{
AssertEx(FALSE,"[GaiBangSkill004_T::TakeEffectNow]: Depleted strike point segment illegal!");
nDepleteStrikePointSegment=1;
}
else if(MAX_STRIKE_POINT_SEGMENT<nDepleteStrikePointSegment)
{
AssertEx(FALSE,"[GaiBangSkill004_T::TakeEffectNow]: Depleted strike point segment illegal!");
nDepleteStrikePointSegment=MAX_STRIKE_POINT_SEGMENT;
}
INT nAdditionalAttackPower = rSkillInfo.GetDescriptorByIndex(nDepleteStrikePointSegment)->GetValue();
// init impact1
OWN_IMPACT impact;
CombatCore_T myCombatCore;
myCombatCore.Reset();
myCombatCore.SetAdditionalAttackLight(nAdditionalAttackPower);
myCombatCore.GetResultImpact(rMe, rTar, impact);
// register impact event
RegisterImpactEvent(rTar, rMe, impact, rParams.GetDelayTime(), bCriticalFlag);
return TRUE;
__LEAVE_FUNCTION
return FALSE;
}
示例3: CMsPacketFactory
// DllGame啟動線程函數
DWORD WINAPI RrTetris::RrTetrisThread(LPVOID)
{
RrTetris::gs_lpCMsPacketFactory = NEW CMsPacketFactory(DG2S_PACKET_MAX_COUNT);
AssertEx(AL_CATAST, gs_lpCMsPacketFactory, _T("內存不足"));
RrTetris::gs_lpCMsPacketFactory->Register(g_lpCMsBasePacket, PACKET_MAX_COUNT);
RrTetrisWritePacket(0,NULL);
// 等待基本初始化
while(!g_IsMsBaseInit)
{
NO_CONTINUOUS;
}
// 申請日誌對象
RrTetris::gs_pMsLog = NEW CMsLog(_T("%s/Log/Dll_RrTetris_C.log"), TRUE);
AssertEx(AL_CATAST, gs_pMsLog, _T("內存不足"));
// 申請配置對象
RrTetris::gs_pRrTetrisConfig = NEW CMsIni(_T("%s/RrTetris/RrTetris.ini"));
AssertEx(AL_CATAST, gs_pRrTetrisConfig, _T("內存不足"));
::PostThreadMessage(gs_dwGameStationLogicThreadId, MSM_DLL_EXIT, 0, 0);
SAFE_DELETE(RrTetris::gs_lpCMsPacketFactory);
// 等待基本釋放
while(g_IsMsBaseInit)
{
NO_CONTINUOUS;
}
return 0;
}
示例4: Assert
uint CGLockTargetHandler::Execute( CGLockTarget* pPacket, Player* pPlayer )
{
__ENTER_FUNCTION
GamePlayer* pGamePlayer = (GamePlayer*)pPlayer ;
Assert( pGamePlayer ) ;
Obj_Human* pHuman = pGamePlayer->GetHuman() ;
if(NULL==pHuman)
{
AssertEx(FALSE,"[CGLockTargetHandler::Execute]: NULL Obj_Human pointer found!!");
return PACKET_EXE_ERROR ;
}
Scene* pScene = pHuman->getScene() ;
if( pScene==NULL )
{
Assert(FALSE) ;
return PACKET_EXE_ERROR ;
}
//檢查線程執行資源是否正確
Assert( MyGetCurrentThreadID()==pScene->m_ThreadID ) ;
ObjID_t nMeID = pHuman->GetID();
if( nMeID == INVALID_ID )
{
Assert(FALSE) ;
return PACKET_EXE_ERROR ;
}
//update target
if(NULL==pPacket)
{
AssertEx(FALSE,"[CGLockTargetHandler::Execute]: NULL packet pointer found!!");
return PACKET_EXE_ERROR ;
}
pHuman->SetLockedTarget(pPacket->getTargetID());
// 當鎖定的目標是NPC時將會觸發NPC的泡泡說話
Obj* pTarget = pScene->GetObjManager()->GetObj(pPacket->getTargetID());
if (pTarget->GetObjType() == Obj::OBJ_TYPE_MONSTER)
{
((Obj_Monster*)pTarget)->ProcessPaoPao();
}
g_pLog->FastSaveLog( LOG_FILE_1, "CGLockTargetHandler: ok obj=%d scene=%d",
nMeID, pScene->SceneID() ) ;
return PACKET_EXE_CONTINUE ;
__LEAVE_FUNCTION
return PACKET_EXE_ERROR ;
}
示例5: AssertEx
VOID PNGAPI CMsPngImage::FlushPng(png_structp png_ptr)
{
CMsPngImage* pPngImage = (CMsPngImage*)png_get_io_ptr(png_ptr);
if (pPngImage->m_hFile)
{
BOOL bRet = ::FlushFileBuffers(pPngImage->m_hFile);
AssertEx(bRet, _T("寫入圖片失敗"));
}
else
{
AssertEx(pPngImage->m_hFile, _T("寫入圖片失敗"));
}
}
示例6: switch
// 初始化表格管理器
BOOL CAutoTableManager::Init(VOID)
{
_ENTER_FUN_C;
for (UINT i = 0; i < m_uItemCount; i++)
{
switch (m_pAi[i].m_pAta)
{
case MS_SQL_TYPE_INT:
{
m_pInt = new INT[m_uLineCount];
AssertEx(AL_NORMAL, m_pInt, _T("m_pInt為空,內存不足"));
ZeroMemory(m_pInt, sizeof(INT) * m_uLineCount);
m_pAi[i].m_lpItem = m_pInt;
}break;
case MS_SQL_TYPE_TCHAR:
{
m_pTchar = new TCA[m_uLineCount];
AssertEx(AL_NORMAL, m_pTchar, _T("m_pInt為空,內存不足"));
ZeroMemory(m_pTchar, sizeof(TCA) * m_uLineCount);
m_pAi[i].m_lpItem = m_pTchar;
}break;
case MS_SQL_TYPE_FLOAT:
{
m_pFloat = new FLOAT[m_uLineCount];
AssertEx(AL_NORMAL, m_pFloat, _T("m_pInt為空,內存不足"));
ZeroMemory(m_pFloat, sizeof(FLOAT) * m_uLineCount);
m_pAi[i].m_lpItem = m_pFloat;
}break;
case MS_SQL_TYPE_DATETIME:
{
m_pDataTime = new TIMESTAMP_STRUCT[m_uLineCount];
AssertEx(AL_NORMAL, m_pDataTime, _T("m_pInt為空,內存不足"));
ZeroMemory(m_pDataTime, sizeof(TIMESTAMP_STRUCT) * m_uLineCount);
m_pAi[i].m_lpItem = m_pDataTime;
}break;
default:
{
AssertEx(AL_NORMAL, FALSE,_T("無效類型,錯誤邏輯"));
}
}
}
m_uValidLine = 0;
m_IsInit = TRUE;
// 返回成功
return TRUE;
_LEAVE_FUN_DISPOSE_END_C;
return FALSE;
}
示例7: CMsPacketFactory
// DllGame啟動線程函數
DWORD WINAPI RrTetris::RrTetrisThread(LPVOID)
{
RrTetris::gs_lpCMsPacketFactory = NEW CMsPacketFactory(DG2S_PACKET_MAX_COUNT);
AssertEx(AL_CATAST, gs_lpCMsPacketFactory, _T("內存不足"));
RrTetris::gs_lpCMsPacketFactory->Register(g_lpCMsBasePacket, PACKET_MAX_COUNT);
RrTetris::gs_pCMsBaseRun = NEW CMsBaseRun(_T("%s/Log/Dll_RrTetris_Assertx.log"), _T("RrTetrisClass"), _T("RrTetris"), RrTetrisHookProc, RrTetrisWndProc, NULL);
AssertEx(AL_CATAST, gs_pCMsBaseRun, _T("內存不足"));
S_2DEngineWndInfo s_ewi;
s_ewi.m_bTopMost= FALSE;
s_ewi.m_nX = CW_USEDEFAULT;
s_ewi.m_nY = 0;
s_ewi.m_nWidth = CW_USEDEFAULT;
s_ewi.m_nHeight = 0;
s_ewi.m_dwStyle = WS_OVERLAPPEDWINDOW;
// 等待基本初始化
while(!g_IsMsBaseInit)
{
NO_CONTINUOUS;
}
// 申請日誌對象
RrTetris::gs_pMsLog = NEW CMsLog(_T("%s/Log/Dll_RrTetris_C.log"), TRUE);
AssertEx(AL_CATAST, gs_pMsLog, _T("內存不足"));
// 申請配置對象
RrTetris::gs_pRrTetrisConfig = NEW CMsIni(_T("%s/RrTetris/RrTetris.ini"));
AssertEx(AL_CATAST, gs_pRrTetrisConfig, _T("內存不足"));
RrTetris::gs_hModule = ::GetModuleHandle(_T("Dll_RrTetris_C.dll"));
RrTetris::gs_hInstance = (HINSTANCE)RrTetris::gs_hModule;
if (RrTetris::gs_hInstance)
{
g_pCMsWinMain->Init(RrTetris::gs_hInstance, NULL, _T(""), SW_SHOW, &s_ewi);
g_pCMsWinMain->Run();
g_pCMsWinMain->WaitQuit();
}
::PostThreadMessage(gs_dwGameStationLogicThreadId, MSM_DLL_EXIT, (WPARAM)RrTetris::gs_hModule, 0);
SAFE_DELETE(RrTetris::gs_pCMsBaseRun);
SAFE_DELETE(RrTetris::gs_lpCMsPacketFactory);
// 等待基本釋放
while(g_IsMsBaseInit)
{
NO_CONTINUOUS;
}
return 0;
}
示例8: m_width
Bitmap::Bitmap(int width, int height, int bpp)
: m_width(width), m_height(height), m_bpp(bpp), m_data(NULL) {
AssertEx(m_bpp == 1 || m_bpp == 8 || m_bpp == 16 || m_bpp == 24 || m_bpp == 32
|| m_bpp == 96 || m_bpp == 128, "Invalid number of bits per pixel");
AssertEx(width > 0 && height > 0, "Invalid bitmap size");
if (bpp == 96 || bpp == 128)
m_gamma = 1.0f;
else
m_gamma = -1.0f; // sRGB
// 1-bit masks are stored in a packed format.
m_size = (size_t) std::ceil(((double) m_width * m_height * m_bpp) / 8.0);
m_data = static_cast<uint8_t *>(allocAligned(m_size));
}
示例9: AssertEx
VOID StdImpact030_T::OnFadeOut(OWN_IMPACT& rImp, Obj_Character& rMe) const
{
__ENTER_FUNCTION
Obj_Character* pTar=NULL;
Scene* pScene = rMe.getScene();
if(NULL==pScene)
{
AssertEx(FALSE, "[StdImpact030_T::OnFadeOut]: Empty scene pointer found!!");
return;
}
OBJLIST Targets;
if(FALSE==ScanUnitForTarget(rImp, rMe, *(rMe.getWorldPos()), (FLOAT)GetScanRadius(rImp), GetEffectedObjCount(rImp), Targets))
{
return;
}
INT nImpact = GetSubImpactIndex(rImp);
if(INVALID_ID==nImpact)
{
return;
}
// impacts init finished
for(INT nIdx=0; Targets.m_Count>nIdx;++nIdx)
{
pTar = (Obj_Character*)Targets.m_aObj[nIdx];
if(NULL!=pTar)
{
pScene->GetEventCore().RegisterBeSkillEvent(pTar->GetID(), rMe.GetID(), BEHAVIOR_TYPE_HOSTILITY, 500);
g_ImpactCore.SendImpactToUnit(*pTar, nImpact, rMe.GetID(), 500);
}
}
return;
__LEAVE_FUNCTION
}
示例10: sprintf
VOID SceneTimer::FreeTimer(INT index)
{
if( index <0 || index >= maxCount )
{
#ifdef _DEBUG
CHAR szTemp[MAX_FILE_PATH];
sprintf(szTemp,"index = %d",index);
AssertEx(FALSE,szTemp) ;
#endif
return ;
}
InitOne(index);//釋放時初始化
MyTimer* temp = (MyTimer*)&(m_pTimers[index]);
*((MyTimer**)temp) = head;
head = temp;
#if _DEBUG
m_currentUse--;
#endif
}
示例11: MyGetCurrentThreadID
UINT LBAskAuthHandler::Execute(LBAskAuth* pPacket, Player* pPlayer )
{
__ENTER_FUNCTION
TID CurrentThreadID = MyGetCurrentThreadID();
if(CurrentThreadID == g_pServerManager->m_ThreadID)
{
Assert(pPacket);
ServerPlayer* pServerPlayer = (ServerPlayer*)pPlayer;
Assert(pServerPlayer);
pServerPlayer->SendPacket(pPacket);
}
else
{
AssertEx(FALSE,"LBAskAuthHandler 線程資源執行錯誤!");
}
Log::SaveLog(LOGIN_LOGFILE,"LBAskAuthHandler::Execute() ....OK");
return PACKET_EXE_CONTINUE;
__LEAVE_FUNCTION
return PACKET_EXE_ERROR;
}
示例12: AreaLuminaire
AreaLuminaire(const Properties &props) : Luminaire(props), m_shape(NULL) {
AssertEx(m_luminaireToWorld.isIdentity(), "Error: non-identity transformation found. "
"Area luminaires inherit their transformation from their associated shape!");
m_intensity = props.getSpectrum("intensity", Spectrum(1));
m_type = EDiffuseDirection | EOnSurface;
m_intersectable = true;
}
示例13: Assert
KVOID Kylin::Scene::SpawnScene()
{
Assert(KylinRoot::GetSingletonPtr()->GetGameFramePtr());
m_pSceneLoader = KylinRoot::GetSingletonPtr()->GetGameFramePtr()->CreateSceneLoader();
//-----------------------------------------------------------------
// ╪стьЁ║╬╟
Ogre::FileInfoListPtr resPtr = Ogre::ResourceGroupManager::getSingletonPtr()->findResourceFileInfo("General", m_kSceneHag.m_sSceneFile);
Ogre::FileInfo fInfo = (*(resPtr->begin()));
KSTR sName = fInfo.archive->getName();
sName += "/" + m_kSceneHag.m_sSceneFile;
//------------------------------------------------------------------
// ╪сть╠Ё╬╟рТюж
KylinRoot::GetSingletonPtr()->CreateSound("$BackgroundSound",m_kSceneHag.m_nBgSound);
//------------------------------------------------------------------
// ж╢ппluaнд╪Ч
KSTR sLua = StringUtils::replace(sName,".xml",".lua");
OgreRoot::GetSingletonPtr()->GetScriptVM()->ExecuteScriptFile(sLua.data());
//-----------------------------------------------------------------
// ╪стьlevel
m_pSceneLoader->LoadLevel(m_kSceneHag.m_sSceneFile);
//-----------------------------------------------------------------
// ╪стьЁ║╬╟ё╛NPC╣х
if (!m_pSceneLoader->LoadScene(m_kSceneHag.m_sSceneFile))
{
AssertEx(NULL,"Ё║╬╟╪стьй╖╟эё║");
return;
}
//-----------------------------------------------------------------
// ╪стьмФ╪р
m_pSceneLoader->LoadPlayer();
}
示例14: _snprintf
VOID DBCFile::CreateIndex(INT nColum, const CHAR* szFileName)
{
if(nColum <0 || nColum >= m_nFieldsNum || m_nIndexColum==nColum) return;
m_hashIndex.clear();
for(INT i=0; i<(INT)m_nRecordsNum; i++)
{
FIELD* p = &(m_vDataBuf[i*m_nFieldsNum]);
FIELD_HASHMAP::iterator itFind = m_hashIndex.find(p->iValue);
if(itFind != m_hashIndex.end())
{
CHAR szTemp[260];
_snprintf(szTemp, 260, "[%s]Multi index at line %d(SAME:value=%d)", szFileName, i+1, p->iValue);
#ifdef GAME_CLIENT
throw std::exception(szTemp);
#else
AssertEx(FALSE,szTemp);
#endif
return;
}
m_hashIndex.insert(std::make_pair(p->iValue, p));
}
}
示例15: MyGetCurrentThreadID
UINT SSScenePlayerCountHandler::Execute(SSScenePlayerCount* pPacket, Player* pPlayer )
{
__ENTER_FUNCTION
TID CurrentThreadID = MyGetCurrentThreadID();
if(CurrentThreadID == g_pServerManager->m_ThreadID)
{
//修改g_WorldPlayerCounter 中數據
Assert(pPacket);
g_WorldPlayerCounter.m_WorldPlayerCount = pPacket->GetTotalPlayerCount();
//修改場景負載數據
//todo..
}
else
{
AssertEx(FALSE,"SSScenePlayerCountHandler 線程資源執行錯誤!");
}
Log::SaveLog(LOGIN_LOGFILE,"SSScenePlayerCountHandler::Execute()....OK,WorldPlayerCount = %d",
g_WorldPlayerCounter.m_WorldPlayerCount);
return PACKET_EXE_CONTINUE;
__LEAVE_FUNCTION
return PACKET_EXE_ERROR;
}