本文整理汇总了C++中SDLOG函数的典型用法代码示例。如果您正苦于以下问题:C++ SDLOG函数的具体用法?C++ SDLOG怎么用?C++ SDLOG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SDLOG函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SAFEDELETE
void RSManager::reloadScao() {
SAFEDELETE(ssao);
ssao = new SSAO(d3ddev, Settings::get().getRenderWidth(), Settings::get().getRenderHeight(), Settings::get().getSsaoStrength()-1, SSAO::SCAO);
SDLOG(0, "Reloaded SSAO\n");
}
示例2: GENERATE_INTERCEPT_HEADER
GENERATE_INTERCEPT_HEADER(D3DXCreateTextureFromFileInMemory, HRESULT, WINAPI, _In_ LPDIRECT3DDEVICE9 pDevice, _In_ LPCVOID pSrcData, _In_ UINT SrcDataSize, _Out_ LPDIRECT3DTEXTURE9 *ppTexture) {
SDLOG(4, "DetouredD3DXCreateTextureFromFileInMemory\n");
HRESULT res = TrueD3DXCreateTextureFromFileInMemory(pDevice, pSrcData, SrcDataSize, ppTexture);
if(RSManager::exists()) RSManager::getDX9().registerD3DXCreateTextureFromFileInMemory(pSrcData, (SrcDataSize == 2147483647u || SrcDataSize == 4294967295u) ? 256 : SrcDataSize, *ppTexture);
return res;
}
示例3: GENERATE_INTERCEPT_HEADER
GENERATE_INTERCEPT_HEADER(GetMessagePos, DWORD, WINAPI) {
SDLOG(12, "DetouredGetMessagePos\n");
DWORD ret = TrueGetMessagePos();
return ret;
}
示例4: GENERATE_INTERCEPT_HEADER
GENERATE_INTERCEPT_HEADER(CreateDXGIFactory1, HRESULT, WINAPI, _In_ REFIID riid, _Out_ void **ppFactory) {
SDLOG(0, "DetouredCreateDXGIFactory1\n");
return TrueCreateDXGIFactory1(riid, ppFactory);
}
示例5: SDLOG
BOOL APIENTRY hkIDXGIFactory1::IsCurrent() {
SDLOG(20, "hkIDXGIFactory1::IsCurrent\n");
return pWrapped->IsCurrent();
}
示例6: SDLOG
HRESULT APIENTRY hkIDirect3D9::QueryInterface(REFIID riid, void **ppvObj) {
SDLOG(1, "hkIDirect3D9::QueryInterface\n");
return m_pD3Dint->QueryInterface(riid, ppvObj);
}
示例7: DetouredTimeGetTime
DWORD WINAPI DetouredTimeGetTime() {
SDLOG(13, "T %6lu: Detouring: TimeGetTime - real: %10lu, returned: %10lu\n", GetCurrentThreadId(), TrueTimeGetTime(), TrueTimeGetTime() + timeIncrease);
//timeIncrease += 16;
return TrueTimeGetTime() + timeIncrease;
}
示例8: DetouredD3DXCreateTextureFromFileInMemory
HRESULT WINAPI DetouredD3DXCreateTextureFromFileInMemory(_In_ LPDIRECT3DDEVICE9 pDevice, _In_ LPCVOID pSrcData, _In_ UINT SrcDataSize, _Out_ LPDIRECT3DTEXTURE9 *ppTexture) {
SDLOG(4, "DetouredD3DXCreateTextureFromFileInMemory\n");
HRESULT res = TrueD3DXCreateTextureFromFileInMemory(pDevice, pSrcData, SrcDataSize, ppTexture);
RSManager::get().registerD3DXCreateTextureFromFileInMemory(pSrcData, SrcDataSize, *ppTexture);
return res;
}
示例9: applyFPSPatch
//----------------------------------------------------------------------------------------
// Game Patches
//----------------------------------------------------------------------------------------
void applyFPSPatch() {
SDLOG(0, "Starting FPS unlock...\n");
#ifndef WITHOUT_GFWL_LIB
SDLOG(0, "Applying GFWL compatibility\n");
enableGFWLCompatibility();
#endif
// Get image info
MODULEINFO moduleInfo;
PIMAGE_DOS_HEADER dosHeader;
PIMAGE_NT_HEADERS ntHeader;
IMAGE_FILE_HEADER header;
if(GetModuleInformation(GetCurrentProcess(), GetModuleHandle(NULL), &moduleInfo, sizeof(moduleInfo)))
{
ImageBase = (DWORD)moduleInfo.lpBaseOfDll;
SDLOG(0, "ImageBase at 0x%08X\n", ImageBase);
dosHeader = (PIMAGE_DOS_HEADER)ImageBase;
ntHeader = (PIMAGE_NT_HEADERS)((DWORD)(dosHeader) + (dosHeader->e_lfanew));
header = ntHeader->FileHeader;
DWORD TimeStamp = header.TimeDateStamp;
SDLOG(0, "Executable timestamp: 0x%08X, config: 0x%08X\n", TimeStamp, EXE_TIMESTAMP);
// Perform pattern matching if timestamp differs
if (TimeStamp != EXE_TIMESTAMP) {
SDLOG(0, "Trying pattern matching...\n");
DWORD address;
address = GetMemoryAddressFromPattern(NULL, TS_PATTERN, TS_OFFSET);
if(address != NULL) {
SDLOG(0, "ADDR_TS found at 0x%08X\n", address);
ADDR_TS = address;
}
else {
SDLOG(0, "Could not match ADDR_TS pattern, FPS not unlocked\n");
return;
}
address = GetMemoryAddressFromPattern(NULL, PRESINT_PATTERN, PRESINT_OFFSET);
if(address != NULL) {
SDLOG(0, "ADDR_PRESINT found at 0x%08X\n", address);
ADDR_PRESINT = address;
}
else {
SDLOG(0, "Could not match ADDR_PRESINT pattern, FPS not unlocked\n");
return;
}
address = GetMemoryAddressFromPattern(NULL, GETCMD_PATTERN, GETCMD_OFFSET);
if(address != NULL) {
SDLOG(0, "ADDR_GETCMD found at 0x%08X\n", address);
ADDR_GETCMD = address;
}
else {
SDLOG(0, "Could not match ADDR_GETCMD pattern, FPS not unlocked\n");
return;
}
SDLOG(0, "Pattern matching successful\n");
}
else
SDLOG(0, "Using configured addresses\n");
}
else
{
SDLOG(0, "GetModuleInformation failed, FPS not unlocked\n");
return;
}
// Init counter for frame-rate calculations
lastRenderTime = 0.0f;
QueryPerformanceFrequency(&timerFreq);
QueryPerformanceCounter(&counterAtStart);
// Binary patches
//--------------------------------------------------------------
DWORD address;
DWORD data;
// Override D3D Presentation Interval
address = convertAddress(ADDR_PRESINT);
data = 5; //Set to immediate
writeToAddress(&data, address, sizeof(data));
// Detour call to getDrawThreadMsgCommand
address = convertAddress(ADDR_GETCMD);
DetourApply((BYTE*)address, (BYTE*)getDrawThreadMsgCommand, 5, CALLOP);
SDLOG(0, "FPS unlocked\n");
}
示例10: resumeHudRendering
HRESULT RSManager::redirectDrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) {
//if(onHudRT) {
// SDLOG(0, "HUD render: primitive type: %d, MinIndex: %u, NumVertices: %u, PrimitiveCount: %u, IndexDataFormat: %s\n", PrimitiveType, MinIndex, NumVertices, PrimitiveCount, D3DFormatToString(IndexDataFormat));
// // Print vertex decl type
// IDirect3DVertexDeclaration9* vDecl;
// d3ddev->GetVertexDeclaration(&vDecl);
// D3DVERTEXELEMENT9 decl[MAXD3DDECLLENGTH];
// UINT numElements;
// vDecl->GetDeclaration(decl, &numElements);
// for(size_t i=0; i<numElements; ++i) {
// SDLOG(0, "element %u -- stream: %d, offset: %d, type: %s, usage: %s\n", i, decl->Stream, decl->Offset, D3DDeclTypeToString((D3DDECLTYPE)decl->Type), D3DDeclUsageToString((D3DDECLUSAGE)decl->Usage));
// }
// vDecl->Release();
//
// // Print indices
// //SDLOG(0, "Indices: \n");
// //INT16 *indices = (INT16*)pIndexData;
// //for(size_t i=0; i<PrimitiveCount+2; ++i) {
// // SDLOG(0, "%8hd, ", indices[i]);
// //}
// //SDLOG(0, "\n");
// // Print vertices
// SDLOG(0, "Vertices: \n");
// INT16 *values = (INT16*)pVertexStreamZeroData;
// for(size_t i=0; i<NumVertices*4*2; ++i) {
// SDLOG(0, "%8hd, ", values[i]);
// if((i+1)%2 == 0) SDLOG(0, "; ");
// if((i+1)%8 == 0) SDLOG(0, "\n");
// }
// //return d3ddev->DrawIndexedPrimitiveUP(PrimitiveType, MinIndex, NumVertices, PrimitiveCount, pIndexData, IndexDataFormat, hudVertices, VertexStreamZeroStride);
//}
if(hudStarted && hideHud) {
return D3D_OK;
}
bool isTargetIndicator = false;
if(pausedHudRT) {
IDirect3DBaseTexture9 *t;
d3ddev->GetTexture(0, &t);
// check for target indicator
if(isTextureHudHealthbar(t)) {
INT16 *vertices = (INT16*)pVertexStreamZeroData;
if(vertices[3] > -2000) {
resumeHudRendering();
}
} else {
resumeHudRendering();
}
t->Release();
}
if(onHudRT) {
IDirect3DBaseTexture9 *t;
d3ddev->GetTexture(0, &t);
SDLOG(4, "On HUD, redirectDrawIndexedPrimitiveUP texture: %s\n", getTextureName(t));
if((hddp < 5 && isTextureHudHealthbar(t)) || (hddp >= 5 && hddp < 7 && isTextureCategoryIconsHumanityCount(t)) || (hddp>=7 && !isTextureCategoryIconsHumanityCount(t))) hddp++;
// check for target indicator
if(isTextureHudHealthbar(t)) {
INT16 *vertices = (INT16*)pVertexStreamZeroData;
if(vertices[3] < -2000) {
isTargetIndicator = true;
pauseHudRendering();
}
}
t->Release();
if(hddp == 8) {
finishHudRendering();
} else if(!isTargetIndicator) {
//d3ddev->SetRenderState(D3DRS_COLORWRITEENABLE, D3DCOLORWRITEENABLE_RED | D3DCOLORWRITEENABLE_GREEN | D3DCOLORWRITEENABLE_BLUE | D3DCOLORWRITEENABLE_ALPHA);
//d3ddev->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_ADD);
//d3ddev->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
//d3ddev->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_CURRENT);
}
}
HRESULT hr = d3ddev->DrawIndexedPrimitiveUP(PrimitiveType, MinIndex, NumVertices, PrimitiveCount, pIndexData, IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride);
//if(onHudRT) {
// if(takeScreenshot) dumpSurface("HUD_IndexPrimUP", rgbaBuffer1Surf);
//}
return hr;
}
示例11: SDLOG
void RSManager::enableTakeScreenshot() {
takeScreenshot = true;
SDLOG(0, "takeScreenshot: %s\n", takeScreenshot?"true":"false");
}