• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MLog函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中MLog函数的典型用法代码示例。如果您正苦于以下问题:C++ MLog函数的具体用法?C++ MLog怎么用?C++ MLog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了MLog函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: loadObjectTree

static bool loadObjectTree(LoaderState& State, const XMLObject& xmlObject, XMLObjectVector &ret)
{
	XMLActor actor;

	auto found = TryForEachPath(State.Paths, xmlObject.SceneXMLFile, [&](auto& Path) {
		return XMLParser::parseScene(Path.c_str(), actor, ret);
	});
	if (!found)
	{
		MLog("loadObjectTree -- Failed to load xmlObject %s\n", xmlObject.Name.c_str());
		return false;
	}

	if (!actor.isValid)
		return false;

	if (!load(State, actor.eluName.c_str()))
	{
		MLog("loadObjectTree(%s) -- Failed to load object\n", xmlObject.Name.c_str());
		return false;
	}

	auto& Obj = State.Objects.back();
	Obj.World = MakeSaneWorldMatrix(xmlObject.Position, xmlObject.Dir, xmlObject.Up);

	return true;
}
开发者ID:Asunaya,项目名称:RefinedGunz,代码行数:27,代码来源:EluLoader.cpp


示例2: Init

bool LightmapGenerator::Generate()
{	
	Init();

	for (size_t i = 0; i < bsp.ConvexPolygons.size(); i++)
	{
		// The progress function returning false
		// indicates that the generation needs to stop.
		if (pProgressFn && !pProgressFn((float)i / (float)bsp.ConvexPolygons.size()))
			return false;

		int lightmapsize{};
		if (!ProcessConvexPolygon(&bsp.ConvexPolygons[i], i, lightmapsize))
		{
			MLog("LightmapGenerator::Generate -- ProcessConvexPolygon failed for polygon index %d\n", i);
			return false;
		}
		InsertLightmap(lightmapsize, i);
	}

	if (!SaveToFile())
	{
		MLog("LightmapGenerator::Generate -- SaveToFile failed\n");
		return false;
	}

	return true;
}
开发者ID:Asunaya,项目名称:RefinedGunz,代码行数:28,代码来源:LightmapGenerator.cpp


示例3: MUGIDFromName

int MUGIDFromName(

  char *GName)

  {
  struct group *buf;
  int tmpGID = 0;

  const char *FName = "MUGIDFromName";

  MDB(7,fSTRUCT) MLog("%s(%s)\n",
    FName,
    (GName != NULL) ? GName : "NULL");

  if ((GName == NULL) || !strcmp(GName,NONE))
    {
    return(-1);
    }

  errno = 0;

  buf = getgrnam(GName);

  if (buf == NULL)
    {
    MDB(3,fSTRUCT) MLog("ALERT:    error looking up group '%s' - %s (errno:%d)\n",
      GName,
      strerror(errno),
      errno);
    
    /* look for GID??? format */

    if (!strncmp(GName,"GID",strlen("GID")))
      {
      return(atoi(GName + strlen("GID")));
      }

    /* check to see if GName is the GID number itself (group names cannot start
     * with a number) */

    tmpGID = (int)strtol(GName,NULL,10);

    if (tmpGID != 0)
      {
      return(tmpGID);
      }

    return(-1);
    }

  return(buf->gr_gid);
  }    /* END MUGIDFromName() */
开发者ID:dhh1128,项目名称:cbase,代码行数:52,代码来源:MUsersGroups.c


示例4: gh_getZipPackURL

NFAPI SCCString gh_getZipPackURL(SCCString url)
{
    // https://github.com/qokelate/CCGame
    // https://github.com/qokelate/CCGame.git
    // https://codeload.github.com/liftoff/GateOne/zip/master

    if (false == stringHasSubString(url, ".github.com/")
            && false == stringHasSubString(url, "://github.com/")) return nullptr;

    if (stringHasSuffix(url, "/zip/master"))
    {
        auto ptr = copyAsSCString(url);

        MLog("url: ", ptr);

        return ptr;
    }

    auto len = SCStringLen(url);

    auto ptr = (SCString)SCAlloc(len + 100);
    strcpy(ptr, "https://codeload.github.com");

    regexMatchFirst((void *)url, len, "://[^/]+/", nullptr, [&](SCRegexErrorInfo *errorInfo, size_t index, byte *buffer, size_t dataSize, void *param) {
        if (errorInfo)
        {
            MLog("error: ", errorInfo->errorMessage);
            return false;
        }

        auto pp = (SCCString)buffer + dataSize - 1;
        strcat(ptr, pp);

        return true;
    });

    len = SCStringLen(ptr);
    {
        auto pp = ptr + len - 4;
        if (stringCompare(pp, ".git")) *pp = 0;
    }

    strcat(ptr, "/zip/master");

    MLog("url: ", ptr);

    return ptr;
}
开发者ID:qokelate,项目名称:sma11caseX,代码行数:48,代码来源:GithubHelper.cpp


示例5: MCacheReadRsvs

int MCacheReadRsvs(

  marray_t *RArray,
  marray_t *ConstraintList)

  {
  mhashiter_t HTIter;
  char *Name;
  mtransrsv_t *R;

  if (MCache == NULL)
    {
    return(FAILURE);
    }

  MUHTIterInit(&HTIter);

  pthread_rwlock_rdlock(&MCache->RsvLock);

  while (MUHTIterate(&MCache->Rsvs,&Name,(void **)&R,NULL,&HTIter) == SUCCESS)
    {
    if (MRsvTransitionMatchesConstraints(R,ConstraintList))
      {
      MUArrayListAppendPtr(RArray,R);
      }
    else
      {
      MDB(8,fSCHED) MLog("INFO:     Reservation %s does not meet constraints.\n",R->Name);
      }
    } /* END while (MUHTIterate) */

  pthread_rwlock_unlock(&MCache->RsvLock);

  return(SUCCESS);
  }  /* END MCacheReadRsvs() */
开发者ID:dhh1128,项目名称:cbase,代码行数:35,代码来源:MCache.c


示例6: MCacheReadJobs

int MCacheReadJobs(

  marray_t *JArray,
  marray_t *ConstraintList)

  {
  mhashiter_t HTIter;
  char *Name;
  mtransjob_t *J;

  if (MCache == NULL)
    {
    return(FAILURE);
    }

  MUHTIterInit(&HTIter);

  pthread_rwlock_rdlock(&MCache->JobLock);

  while (MUHTIterate(&MCache->Jobs,&Name,(void **)&J,NULL,&HTIter) == SUCCESS)
    {
    if (MJobTransitionMatchesConstraints(J,ConstraintList))
      {
      MUArrayListAppendPtr(JArray,J);
      }
    else
      {
      MDB(8,fSCHED) MLog("INFO:     Job %s does not meet constraints.\n",J->Name);
      }
    } /* END while (MUHTIterate) */

  pthread_rwlock_unlock(&MCache->JobLock);

  return(SUCCESS);
  }  /* END MCacheReadJobs() */
开发者ID:dhh1128,项目名称:cbase,代码行数:35,代码来源:MCache.c


示例7: MCacheRemoveVM

int MCacheRemoveVM(

    char *Name)

  {
  if (MCache == NULL)
    {
    return(FAILURE);
    }

  if (MUStrIsEmpty(Name))
    {
    MDB(3,fSCHED) MLog("INFO:     Blank name given. Cannot remove from cache.\n");

    return(FAILURE);
    }

  pthread_rwlock_wrlock(&MCache->VMLock);

  MUHTRemove(&MCache->VMs,Name,&MVMTransitionFree);

  if (DBWRITE)
    {
    MMongoInterface::MMongoDeleteO(Name,mxoxVM);
    }


  pthread_rwlock_unlock(&MCache->VMLock);

  return(SUCCESS);
  }
开发者ID:dhh1128,项目名称:cbase,代码行数:31,代码来源:MCache.c


示例8: MCacheWriteVM

int MCacheWriteVM(

  mtransvm_t *VM) /* I */

  {
  int rc;

  const char *FName = "MCacheWriteVM";

  MDB(8,fSCHED) MLog("%s(%s)\n",
    FName,
    (VM != NULL) ? VM->VMID : NULL);

  if (MCache == NULL)
    {
    return(FAILURE);
    }

  pthread_rwlock_wrlock(&MCache->VMLock);

  rc = MUHTAdd(&MCache->VMs,VM->VMID,(void *)VM,NULL,&MVMTransitionFree);

  if (DBWRITE)
    {
    MMongoInterface::MTransOToMongo(VM,mxoxVM);
    }

  pthread_rwlock_unlock(&MCache->VMLock);

  return(rc);
  }  /* END MCacheWriteVM() */
开发者ID:dhh1128,项目名称:cbase,代码行数:31,代码来源:MCache.c


示例9: MCacheRemoveJob

int MCacheRemoveJob(

    char *JName)

  {
  if (MUStrIsEmpty(JName))
    {
    MDB(3,fSCHED) MLog("INFO:     Blank name given. Cannot remove from cache.\n");

    return(FAILURE);
    }

  pthread_rwlock_wrlock(&MCache->JobLock);

  MUHTRemove(&MCache->Jobs,JName,&MJobTransitionFree);

  if (DBWRITE)
    {
    MMongoInterface::MMongoDeleteO(JName,mxoJob);
    }

  pthread_rwlock_unlock(&MCache->JobLock);

  return(SUCCESS);
  }
开发者ID:dhh1128,项目名称:cbase,代码行数:25,代码来源:MCache.c


示例10: MCacheWriteNode

int MCacheWriteNode(

  mtransnode_t    *N)

  {
  int rc;

  const char *FName = "MCacheWriteNode";

  MDB(7,fTRANS) MLog("%s(%s)\n",
    FName,
    (MUStrIsEmpty(N->Name)) ? "NULL" : N->Name);

  if (MCache == NULL)
    {
    return(FAILURE);
    }

  /* Obtain the write lock and write the object */

  pthread_rwlock_wrlock(&MCache->NodeLock);
  rc = MUHTAdd(&MCache->Nodes,N->Name,(void*)N,NULL,&MNodeTransitionFree);

  if (DBWRITE)
    {
    MMongoInterface::MTransOToMongo(N,mxoNode);
    }

  pthread_rwlock_unlock(&MCache->NodeLock);

  return(rc);
  }  /* END MCacheWriteNode() */
开发者ID:dhh1128,项目名称:cbase,代码行数:32,代码来源:MCache.c


示例11: MCacheReadVMs

int MCacheReadVMs(

  marray_t *VMArray,        /* O */
  marray_t *ConstraintList) /* I */

  {
  mhashiter_t HTIter;
  char *VMID;
  mtransvm_t *VM;

  if (MCache == NULL)
    {
    return(FAILURE);
    }

  MUHTIterInit(&HTIter);

  pthread_rwlock_rdlock(&MCache->VMLock);

  while (MUHTIterate(&MCache->VMs,&VMID,(void **)&VM,NULL,&HTIter) == SUCCESS)
    {
    if (MVMTransitionMatchesConstraints(VM,ConstraintList))
      {
      MUArrayListAppendPtr(VMArray,VM);
      }
    else
      {
      MDB(8,fSCHED) MLog("INFO:     VM %s does not meet constraints.\n",VM->VMID);
      }
    } /* END while (MUHTIterate) */

  pthread_rwlock_unlock(&MCache->VMLock);

  return(SUCCESS);
  }  /* END MCacheReadVMs() */
开发者ID:dhh1128,项目名称:cbase,代码行数:35,代码来源:MCache.c


示例12: MSysDequeueSocket

int MSysDequeueSocket(
  
  msocket_t **S)  /* O */

  {
  if (S == NULL)
    {
    return(FAILURE);
    }

  if (MUDLListSize(MSocketQueue) == 0)
    {
    /* queue is empty */
    
    return(FAILURE);
    }

  MUMutexLock(&MSocketQueueMutex);

  *S = (msocket_t *)MUDLListRemoveFirst(MSocketQueue);

  MSched.TransactionCount--;

  MUMutexUnlock(&MSocketQueueMutex);

  MUGetMS(NULL,(long *)&(*S)->ProcessTime);

  MDB(7,fSOCK) MLog("INFO:     socket %d being serviced after %lu milli-sec wait\n",
    (*S)->sd,
    (*S)->ProcessTime - (*S)->CreateTime);
   
  return(SUCCESS);    
  }  /* END MSysDequeueSocket() */
开发者ID:dhh1128,项目名称:cbase,代码行数:33,代码来源:MSysSocketQueue.c


示例13: MDAGDestroy

int MDAGDestroy(

  marray_t *DList)  /* I (modified) */

  {
  int index;
  mdepend_t **DArray;
  mdepend_t  *tmpD;

  const char *FName = "MDAGDestroy";

  MDB(9,fALL) MLog("%s(DList)\n",
    FName);

  if (DList == NULL)
    {
    return(FAILURE);
    }

  DArray = (mdepend_t **)DList->Array;

  for (index = 0;index < DList->NumItems;index++)
    {
    tmpD = DArray[index];

    MUFree(&tmpD->Value);
    MUFree(&tmpD->SValue);

    MUFree((char **)&DArray[index]);
    }

  MUArrayListFree(DList);

  return(SUCCESS);
  } /* END MDAGDestroy() */
开发者ID:dhh1128,项目名称:cbase,代码行数:35,代码来源:MDAG.c


示例14: MCacheReadTriggers

int MCacheReadTriggers(

  marray_t *TArray,         /* O */
  marray_t *ConstraintList) /* I */

  {
  mhashiter_t HTIter;
  char *TrigID;
  mtranstrig_t *T;

  if (MCache == NULL)
    {
    return(FAILURE);
    }

  MUHTIterInit(&HTIter);

  pthread_rwlock_rdlock(&MCache->TriggerLock);

  while (MUHTIterate(&MCache->Triggers,&TrigID,(void **)&T,NULL,&HTIter) == SUCCESS)
    {
    if (MTrigTransitionMatchesConstraints(T,ConstraintList))
      {
      MUArrayListAppendPtr(TArray,T);
      }
    else
      {
      MDB(8,fSCHED) MLog("INFO:     Trigger %s does not meet constraints.\n",T->TrigID);
      }
    } /* END while (MUHTIterate) */

  pthread_rwlock_unlock(&MCache->TriggerLock);

  return(SUCCESS);
  }  /* END MCacheReadTriggers() */
开发者ID:dhh1128,项目名称:cbase,代码行数:35,代码来源:MCache.c


示例15: MLocalCheckFairnessPolicy

int MLocalCheckFairnessPolicy(

  mjob_t *J,
  long    StartTime,
  char   *Message)

  {
  const char *FName = "MLocalCheckFairnessPolicy";

  MDB(6,fSCHED) MLog("%s(%s,%ld,Message)\n",
    FName,
    (J != NULL) ? J->Name : "NULL",
    (unsigned long)StartTime);

/*
  if (ContribJobLengthFairnessPolicy(J,StartTime,Message) == FAILURE)
    {
    return(FAILURE);
    }
*/

/*
  if (ContribASCBackgroundJobPolicy(J,StartTime,Message) == FAILURE)
    {
    return(FAILURE);
    }
*/

  /* all local policies passed */

  return(SUCCESS);
  }  /* END MLocalFairnessPolicy() */
开发者ID:dhh1128,项目名称:cbase,代码行数:32,代码来源:MLocal.c


示例16: MWikiSDUpdate

int MWikiSDUpdate(

  char        *AString,  /* I */
  msdata_t    *SD,       /* I (modified) */
  mrm_t       *R)        /* I */

  {
  char *ptr;
  char *tail;

  char  SDAttr[MMAX_BUFFER];

  char  EMsg[MMAX_LINE];
  char  tmpLine[MMAX_LINE];

  const char *FName = "MWikiSDUpdate";

  MDB(2,fWIKI) MLog("%s(AString,SD,%s)\n",
    FName,
    (R != NULL) ? R->Name : "NULL");

  if ((SD == NULL) || (AString == NULL))
    {
    return(FAILURE);
    }

  ptr = AString;

  /* FORMAT:  <FIELD>=<VALUE> [<FIELD>=<VALUE>]... */

  while (ptr[0] != '\0')
    {
    if ((tail = MUStrChr(ptr,' ')) != NULL)
      {
      strncpy(SDAttr,ptr,MIN(MMAX_BUFFER - 1,tail - ptr));
      SDAttr[tail - ptr] = '\0';
      }
    else
      {
      MUStrCpy(SDAttr,ptr,MMAX_BUFFER);
      }

    if (MWikiSDUpdateAttr(SDAttr,SD,R,EMsg) == FAILURE)
      {
      snprintf(tmpLine,sizeof(tmpLine),"info corrupt for staging-data '%s -> %s' - %s",
        SD->SrcLocation,
        SD->DstLocation,
        EMsg);

      MMBAdd(&R->MB,tmpLine,NULL,mmbtNONE,0,0,NULL);
      }

    if (tail == NULL)
      break;

    ptr = tail + 1;
    }  /* END while ((tail = MUStrChr(ptr,';')) != NULL) */

  return(SUCCESS);
  }  /* END MWikiSDUpdate() */
开发者ID:dhh1128,项目名称:cbase,代码行数:60,代码来源:MWikiSD.c


示例17: MDAGCopy

int MDAGCopy(

  marray_t *DList,
  marray_t *SList)

  {
  mdepend_t *tmpS;

  const char *FName = "MDAGCopy";

  MDB(5,fALL) MLog("%s(DList,SList)\n",
    FName);

  if ((SList == NULL) || (DList == NULL))
    {
    return(FAILURE);
    }

 if (DList->Array != NULL)
    {
    MUArrayListFree(DList);
    }

  if (SList->Array == NULL)
    {
    /* nothing to copy */

    return(SUCCESS);
    }

  MUArrayListCreate(DList,SList->ElementSize,SList->NumItems);

  tmpS = ((mdepend_t **)SList->Array)[0];

  if (tmpS == NULL)
    {
    /* nothing to copy */

    return(SUCCESS);
    }

  while (tmpS != NULL)
    {
    MDAGSetAnd(DList,tmpS->Type,tmpS->Value,tmpS->SValue,&tmpS->BM);

    tmpS = tmpS->NextAnd;
    }

  tmpS = ((mdepend_t **)SList->Array)[0]->NextOr;

  while (tmpS != NULL)
    {
    MDAGSetOr(DList,tmpS->Type,tmpS->Value,NULL);

    tmpS = tmpS->NextOr;
    }

  return(SUCCESS);
  }  /* END MDAGCopy */
开发者ID:dhh1128,项目名称:cbase,代码行数:59,代码来源:MDAG.c


示例18: MDAGCreate

int MDAGCreate(

  marray_t   *DList,  /* I */
  mdepend_t **DP)     /* O (modified) */

  {
  mdepend_t *NewD = NULL;

  const char *FName = "MDAGCreate";

  MDB(5,fALL) MLog("%s(DList,DP)\n",
    FName);

  if (DP != NULL)
    {
    *DP = NULL;
    }

  if ((DList == NULL) || (DP == NULL))
    {
    return(FAILURE);
    }

  NewD = (mdepend_t *)MUCalloc(1,sizeof(mdepend_t));

  if (NewD == NULL)
    {
    MDB(1,fALL) MLog("ALERT:    could not allocate new dependency\n");

    return(FAILURE);
    }

  NewD->Satisfied = MBNOTSET;

  if (MUArrayListAppendPtr(DList,NewD) == FAILURE)
    {
    return(FAILURE);
    }

  *DP = NewD;

  NewD->Index = DList->NumItems-1;

  return(SUCCESS);
  }  /* END MDAGCreate() */
开发者ID:dhh1128,项目名称:cbase,代码行数:45,代码来源:MDAG.c


示例19: loadMaterial

bool loadMaterial(LoaderState& State, const char* name)
{
	XMLMaterialVector xMats;

	auto found = TryForEachPath(State.Paths, name, [&](auto& path) {
		return XMLParser::parseXMLMaterial(path.c_str(), xMats);	
	});
	if (!found)
	{
		DMLog("loadMaterial on %s failed\n", name);
		return false;
	}

	XMLMaterialVector::iterator itor;
	State.Materials.reserve(xMats.size());

	for (auto& mat : xMats)
	{
		EluMaterial mtl;
		mtl.cAmbient = { EXPAND_VECTOR(mat.ambient), 1 };
		mtl.cDiffuse = { EXPAND_VECTOR(mat.diffuse), 1 };
		mtl.cSpecular = { EXPAND_VECTOR(mat.specular), 1 };
		mtl.cEmissive = { 0, 0, 0, 0 };
		mtl.shininess = mat.SpecularLevel;
		mtl.roughness = 0.f;
		mtl.AlphaTestValue = mat.AlphaTestValue;
		mtl.TwoSided = mat.TwoSided;

		auto LoadTexture = [&](auto Flag, auto& Texture, auto& Filename) {
			if (Filename.empty())
				return false;

			auto fn = [&](auto& Path) {
				if (!FileExists(Path.c_str()))
					return false;
				Texture = Path;
				return true;
			};
			if (!TryForEachPath(State.Paths, Filename, fn))
				if (!TryForEachPath(State.Paths, Filename + ".dds", fn))
				{
					MLog("loadMaterial -- Failed to load texture %s!\n", Filename.c_str());
					return false;
				}
			return true;
		};

		LoadTexture(FLAG_DIFFUSE, mtl.tDiffuse, mat.DiffuseMap);
		LoadTexture(FLAG_NORMAL, mtl.tNormal, mat.NormalMap);
		LoadTexture(FLAG_SPECULAR, mtl.tSpecular, mat.SpecularMap);
		LoadTexture(FLAG_OPACITY, mtl.tOpacity, mat.OpacityMap);
		LoadTexture(FLAG_SELFILLUM, mtl.tEmissive, mat.SelfIlluminationMap);

		State.Materials.push_back(mtl);
	}
	return true;
}
开发者ID:Asunaya,项目名称:RefinedGunz,代码行数:57,代码来源:EluLoader.cpp


示例20: loadTree

bool loadTree(LoaderState& State, const char * sceneName, std::vector<RLIGHT>& Lights)
{
	DMLog("loadTree %s\n", sceneName);

	XMLActor actor;
	XMLObjectVector ret;
	XMLLightVector lights;

	auto found = TryForEachPath(State.Paths, sceneName, [&](auto& Path) {
		return XMLParser::parseScene(Path.c_str(), actor, ret, &lights);
	});
	if (!found)
	{
		MLog("loadTree -- Failed to load %s\n", sceneName);
		return false;
	}
	else
		DMLog("loadTree -- loaded %s\n", sceneName);

	for (auto& srcLight : lights)
	{
		Lights.emplace_back();
		auto& dstLight = Lights.back();
		dstLight.Position = srcLight.Position;
		dstLight.Color = srcLight.Diffuse;
		dstLight.fAttnStart = srcLight.AttStart;
		dstLight.fAttnEnd = srcLight.AttEnd;
		dstLight.fIntensity = srcLight.Intensity;
		dstLight.Name = srcLight.Name;
	}

	DMLog("loadTree -- actor.isValid = %d\n", actor.isValid);
	if (actor.isValid)
	{
		if (!load(State, actor.eluName.c_str()))
		{
			MLog("loadTree(%s) -- Failed to load actor thing\n", sceneName);
		}
	}

	ReadTree(State, ret);

	return true;
}
开发者ID:Asunaya,项目名称:RefinedGunz,代码行数:44,代码来源:EluLoader.cpp



注:本文中的MLog函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MMI_TRACE函数代码示例发布时间:2022-05-30
下一篇:
C++ ML_TRACE_IN函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap