本文整理汇总了C++中outputError函数的典型用法代码示例。如果您正苦于以下问题:C++ outputError函数的具体用法?C++ outputError怎么用?C++ outputError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了outputError函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowNavError
bool CNavMesh::raycast(position_t& start, position_t& end)
{
if (start.x == end.x && start.y == end.y && start.z == end.z)
return true;
dtStatus status;
float spos[3];
CNavMesh::ToDetourPos(&start, spos);
float epos[3];
CNavMesh::ToDetourPos(&end, epos);
float polyPickExt[3];
polyPickExt[0] = 30;
polyPickExt[1] = 60;
polyPickExt[2] = 30;
float snearest[3];
dtQueryFilter filter;
filter.setIncludeFlags(0xffff);
filter.setExcludeFlags(0);
dtPolyRef startRef;
status = m_navMeshQuery->findNearestPoly(spos, polyPickExt, &filter, &startRef, snearest);
if (dtStatusFailed(status))
{
ShowNavError("CNavMesh::raycastPoint start point invalid (%f, %f, %f) (%u)\n", spos[0], spos[1], spos[2], m_zoneID);
outputError(status);
return true;
}
if (!m_navMesh->isValidPolyRef(startRef))
{
ShowNavError("CNavMesh::raycastPoint startRef is invalid (%f, %f, %f) (%u)\n", start.x, start.y, start.z, m_zoneID);
return true;
}
status = m_navMeshQuery->raycast(startRef, spos, epos, &filter, 0, &m_hit);
if (dtStatusFailed(status))
{
ShowNavError("CNavMesh::raycastPoint raycast failed (%f, %f, %f)->(%f, %f, %f) (%u)\n", spos[0], spos[1], spos[2], epos[0], epos[1], epos[2], m_zoneID);
outputError(status);
return true;
}
// no wall was hit
if (m_hit.t == FLT_MAX)
{
return true;
}
return false;
}
示例2: stop
bool Movie::openFromFile(const std::string& filename)
{
int err = 0;
bool preloaded = false;
// Make sure everything is cleaned before opening a new movie
stop();
close();
// Load all the decoders
av_register_all();
// Open the movie file
err = avformat_open_input(&m_avFormatCtx, filename.c_str(), NULL, NULL);
if (err != 0)
{
outputError(err, "unable to open file " + filename);
return false;
}
// Read the general movie informations
err = avformat_find_stream_info(m_avFormatCtx, NULL);
if (err < 0)
{
outputError(err);
close();
return false;
}
if (usesDebugMessages())
// Output the movie informations
av_dump_format(m_avFormatCtx, 0, filename.c_str(), 0);
// Perform the audio and video loading
m_hasVideo = m_video->initialize();
m_hasAudio = m_audio->initialize();
if (m_hasVideo)
{
preloaded = m_video->preLoad();
if (!preloaded) // Loading first frames failed
{
if (sfe::Movie::usesDebugMessages())
std::cerr << "Movie::OpenFromFile() - Movie_video::PreLoad() failed.\n";
}
}
return m_hasAudio || (m_hasVideo && preloaded);
}
示例3: ShowError
int16 CNavMesh::findRandomPath(position_t start, float maxRadius, position_t* path, uint16 pathSize)
{
dtStatus status;
int16 length = 0;
float spos[3];
spos[0] = start.x;
spos[1] = start.y * -1;
spos[2] = start.z * -1;
float polyPickExt[3];
polyPickExt[0] = 30;
polyPickExt[1] = 60;
polyPickExt[2] = 30;
float randomPt[3];
float snearest[3];
dtQueryFilter filter;
filter.setIncludeFlags(0xffff);
filter.setExcludeFlags(0);
dtPolyRef startRef;
dtPolyRef randomRef;
status = m_navMeshQuery->findNearestPoly(spos, polyPickExt, &filter, &startRef, snearest);
if(dtStatusFailed(status))
{
ShowError("CNavMesh::findRandomPath start point invalid (%f, %f, %f)\n", spos[0], spos[1], spos[2]);
outputError(status);
return ERROR_NEARESTPOLY;
}
status = m_navMeshQuery->findRandomPointAroundCircle(startRef, spos, maxRadius, &filter, &RandomNumber, &randomRef, randomPt);
if(dtStatusFailed(status))
{
ShowError("CNavMesh::findRandomPath Error\n");
outputError(status);
return ERROR_NEARESTPOLY;
}
position_t end;
end.x = randomPt[0];
end.y = randomPt[1] * -1;
end.z = randomPt[2] * -1;
return findPath(start, end, path, pathSize);
}
示例4: errMsg
void errMsg(char* formate, ...){
va_list argList;
va_start(argList, formate);//获取可变参数的起始地址
int errorNum = errno;
outputError(formate, argList, errorNum);
va_end(argList);
}
示例5: sdLaMa091New
sdLaMa091_t* sdLaMa091New(void) {
sdLaMa091_t* sdLaMa091 = (sdLaMa091_t*) malloc(sizeof(*sdLaMa091));
#ifdef DEFENSIVE_ALLOC
if (sdLaMa091 == NULL) {
outputError("Cannot allocate sdLaMa091 structure");
return NULL;
}
#endif
sdLaMa091->imageType = UNKNOWN;
sdLaMa091->width = 0;
sdLaMa091->rgbWidth = 0;
sdLaMa091->height = 0;
sdLaMa091->stride = 0;
sdLaMa091->numBytes = 0;
sdLaMa091->unusedBytes = 0;
sdLaMa091->rgbUnusedBytes = 0;
sdLaMa091->N = DEFAULT_N;
sdLaMa091->Vmin = DEFAULT_VMIN;
sdLaMa091->Vmax = DEFAULT_VMAX;
sdLaMa091->Mt = NULL;
sdLaMa091->Ot = NULL;
sdLaMa091->Vt = NULL;
return sdLaMa091;
}
示例6: fatal
void fatal(const char *format, ...)
{
va_list argList;
va_start(argList, format);
outputError(FALSE, 0, TRUE, format, argList);
va_end(argList);
terminate(TRUE);
}
示例7: errExitEN
void errExitEN(int errnum, const char *format, ...)
{
va_list argList;
va_start(argList, format);
outputError(TRUE, errnum, TRUE, format, argList);
va_end(argList);
terminate(TRUE);
}
示例8: err_exit
void err_exit(const char *format, ...)
{
va_list argList;
va_start(argList, format);
outputError(TRUE, errno, FALSE, format, argList);
va_end(argList);
terminate(FALSE);
}
示例9: errExitEN
void
errExitEN(int errnum, const char *format, ...)
{
va_list argList;
va_start(argList, format);
outputError(1, errnum, 1, format, argList);
va_end(argList);
// terminate(1);
}
示例10: fatal
void fatal(const char * format, ...)
{
va_list argList;
va_start(argList, format);
outputError(false, 0, true, format, argList);
va_end(argList);
terminate(true);
}
示例11: err_exit
void err_exit(const char * format, ...)
{
va_list argList;
va_start(argList, format);
outputError(true, errno, false, format, argList);
va_end(argList);
terminate(false);
}
示例12: sdLaMa091SetMaximalVariance
int32_t sdLaMa091SetMaximalVariance(sdLaMa091_t* sdLaMa091,
const uint32_t maximalVariance) {
#ifdef DEFENSIVE_POINTER
if (sdLaMa091 == NULL) {
outputError("Cannot set a parameter of a NULL structure");
return EXIT_FAILURE;
}
#endif
#ifdef DEFENSIVE_PARAM
if (maximalVariance == 0) {
outputError("Cannot set a parameter with a zero value");
return EXIT_FAILURE;
}
#endif
sdLaMa091->Vmax = maximalVariance;
return EXIT_SUCCESS;
}
示例13: sdLaMa091SetAmplificationFactor
int32_t sdLaMa091SetAmplificationFactor(sdLaMa091_t* sdLaMa091,
const uint32_t amplificationFactor) {
#ifdef DEFENSIVE_POINTER
if (sdLaMa091 == NULL) {
outputError("Cannot set a parameter of a NULL structure");
return EXIT_FAILURE;
}
#endif
#ifdef DEFENSIVE_PARAM
if (amplificationFactor == 0) {
outputError("Cannot set a parameter with a zero value");
return EXIT_FAILURE;
}
#endif
sdLaMa091->N = amplificationFactor;
return EXIT_SUCCESS;
}
示例14: errMsg
void errMsg(const char *format, ...)
{
va_list argList;
int savedErrno;
savedErrno = errno;
/* In case we change it here */
va_start(argList, format);
outputError(TRUE, errno, TRUE, format, argList);
va_end(argList);
errno = savedErrno;
}
示例15: sdLaMa091GetAmplificationFactor
uint32_t sdLaMa091GetAmplificationFactor(const sdLaMa091_t* sdLaMa091) {
#ifdef DEFENSIVE_POINTER
if (sdLaMa091 == NULL) {
outputError("Cannot get a parameter of a NULL structure");
errno = ERROR_OCCURED;
return EXIT_FAILURE;
}
#endif
return sdLaMa091->N;
}