本文整理汇总了C++中LogFile::Log方法的典型用法代码示例。如果您正苦于以下问题:C++ LogFile::Log方法的具体用法?C++ LogFile::Log怎么用?C++ LogFile::Log使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogFile
的用法示例。
在下文中一共展示了LogFile::Log方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PakLoadAnyFile
int PakLoadAnyFile(const char *filename, void **bufferptr)
{
char cWork[WORK_LEN];
if (g_bPK3)
{
PK3FileInfo *pInfo;
Str strKey;
// need to lookup the file without the base/texture path on it
Str strBase(g_strBasePath);
AddSlash(strBase);
__ConvertDOSToUnixName(cWork, strBase);
Str strFile(filename);
__ConvertDOSToUnixName(strFile, strFile);
strFile.MakeLower();
strlwr(cWork);
FindReplace(strFile, cWork, "");
PK3FileInfo infoFind;
infoFind.m_pName = __StrDup(strFile.GetBuffer());
PK3List *pList = g_PK3Files.Find(&infoFind);
if (pList)
{
pInfo = pList->Ptr();
memcpy(pInfo->m_zFile, &pInfo->m_zInfo, sizeof(unz_s));
if (unzOpenCurrentFile(pInfo->m_zFile) == UNZ_OK)
{
void *buffer = __qblockmalloc(pInfo->m_lSize+1);
int n = unzReadCurrentFile(pInfo->m_zFile , buffer, pInfo->m_lSize);
*bufferptr = buffer;
unzCloseCurrentFile(pInfo->m_zFile);
return n;
}
}
#ifdef LOG_PAKFAIL
sprintf(cWork, "PAK failed on %s\n", filename);
g_LogFile.Log(cWork);
#endif
return -1;
}
for (int i = 0; i < dirsize; i++)
{
if(!stricmp(filename, pakdirptr[i].name))
{
if (fseek(pakfile[m_nPAKIndex], pakdirptr[i].offset, SEEK_SET) >= 0)
{
void *buffer = __qmalloc (pakdirptr[i].size+1);
((char *)buffer)[pakdirptr[i].size] = 0;
if (fread(buffer, 1, pakdirptr[i].size, pakfile[m_nPAKIndex]) == pakdirptr[i].size)
{
*bufferptr = buffer;
return pakdirptr[i].size;
}
}
}
}
#ifdef LOG_PAKFAIL
sprintf(cWork, "PAK failed on %s\n", filename);
g_LogFile.Log(cWork);
#endif
return -1;
}
示例2: Birth
//.........这里部分代码省略.........
MY_WINDOW_NAME,
dwStyle | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
WindowRect.left,
WindowRect.top,
WindowRect.right - WindowRect.left,
WindowRect.bottom - WindowRect.top,
NULL,
NULL,
GetModuleHandle(0),
NULL
);
FASSERT(Application::Vars.win.MHWnd);
ShowWindow(Application::Vars.win.MHWnd, SW_SHOW);
SetForegroundWindow(Application::Vars.win.MHWnd);
SetFocus(Application::Vars.win.MHWnd);
// Получаем контекст устройства
Application::Vars.win.DC = GetDC(Application::Vars.win.MHWnd);
FASSERT(Application::Vars.win.DC);
// Установка формата пикселей
PIXELFORMATDESCRIPTOR mainPFD;
memset(&mainPFD,0,sizeof(PIXELFORMATDESCRIPTOR));
mainPFD.nSize = sizeof(PIXELFORMATDESCRIPTOR);
mainPFD.nVersion = 1;
mainPFD.iPixelType = PFD_TYPE_RGBA;
mainPFD.dwFlags = PFD_DRAW_TO_WINDOW |PFD_DOUBLEBUFFER |PFD_SUPPORT_OPENGL;
mainPFD.iLayerType = PFD_MAIN_PLANE;
mainPFD.cDepthBits = 16;
int PF;
PF = ChoosePixelFormat(Application::Vars.win.DC,&mainPFD);
FASSERT(PF); // Выбрали!
FASSERT(SetPixelFormat(Application::Vars.win.DC,PF,&mainPFD)); // Поставили!
// Создание контекста рендера
Application::Vars.win.RC = wglCreateContext (Application::Vars.win.DC);
FASSERT(Application::Vars.win.RC);
// Установка полученого контекста главным
FASSERT(wglMakeCurrent (Application::Vars.win.DC, Application::Vars.win.RC));
#else
dpy = XOpenDisplay(0); // Открываем дисплей по-умолчанию (может быть сетевой)
vi = glXChooseVisual( dpy, // Получаем подходящий визуал
DefaultScreen(dpy),
attributeList);
cx = glXCreateContext(dpy, vi, 0, GL_TRUE); // Создание контекста
// create a color map
cmap = XCreateColormap(dpy, RootWindow(dpy, vi->screen),
vi->visual, AllocNone);
// Создаём окно
swa.colormap = cmap;
swa.border_pixel = 0;
swa.event_mask = StructureNotifyMask;
win = XCreateWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, 100, 100,
0, vi->depth, InputOutput, vi->visual,
CWBorderPixel|CWColormap|CWEventMask, &swa);
XMapWindow(dpy, win);
XIfEvent(dpy, &event, WaitForNotify, (char*)win);
glXMakeCurrent(dpy, win, cx); // Привязка контекста к окну
#endif
GetSysInfo();
#ifndef _DEBUG
if (AVIp.Open("data/VIDEO/logo.avi") == FJC_NO_ERROR)
{
AVIp.Caching();
GT.Start();
ShowMovie(true);
AVIp.CloseAVI();
}
else
{
LF.Logf("Birth","Невозможно загрузить и проиграть заставку");
}
#endif
// Инициализация библиотек и глобальных объектов
InitOpenGL(); // Графика - OpenGL
LF.Log("BIRTH","Init OpenGL complete");
InitOpenIL(); // Поддержка изображений - OpenIL(DevIL)
LF.Log("BIRTH","Init OpenIL complete");
// инициализация менеджера ресурсов
rm.INIT("Consolas.LFont","default.png","cube.lwo");
CCons.SetFont(rm.SELECT_Font("Console"));
SimpleLogo.init(&SwapBuffersEXT,IL_PNG,"data/textures/Logos/NewLOGO.PNG");
SimpleLogo.render_logo(FJC_STARTUP_LOGO_MODE_BEGIN);
rm.SELECT_Font("Courier")->SetColor(1,0,0);
SimpleLogo.render_logo( FJC_STARTUP_LOGO_MODE_PROCEED_WITH_TEXT,1,
TextBlock(rm.SELECT_Font("Consolas"),"Now loading, please wait",250.0f,300.0f));
Sound.Init();
TestBuf.Init();
TestBuf.LoadWav("data/sounds/KDE_Startup_new2.wav");
TestSource.Init();
TestSource.LinkWithBufer(&TestBuf);
LF.Log("BIRTH","Init OpenAL complete");
InitMATH(); // Математическая библиотека
LF.Log("BIRTH","InitMATH");
LF.Msg("Init complete");
LoadResources();
PS.INIT();
return NO_ERROR;
};