From f8f7dadba40d7a09a237703774dbea0cbfd10086 Mon Sep 17 00:00:00 2001 From: gmvbif Date: Thu, 31 Dec 2015 14:47:34 +0300 Subject: [PATCH 1/3] Delete fields from FrameBufferDX9 with the same names as in the FrameBufferCommon --- GPU/Directx9/FramebufferDX9.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/GPU/Directx9/FramebufferDX9.h b/GPU/Directx9/FramebufferDX9.h index 64114a750f..31dc9fe320 100644 --- a/GPU/Directx9/FramebufferDX9.h +++ b/GPU/Directx9/FramebufferDX9.h @@ -130,8 +130,6 @@ private: TextureCacheDX9 *textureCache_; ShaderManagerDX9 *shaderManager_; TransformDrawEngineDX9 *transformDraw_; - bool usePostShader_; - bool postShaderAtOutputResolution_; // Used by post-processing shader std::vector extraFBOs_; From 1794ca908fe07fc30afb207f73e8caa24239928e Mon Sep 17 00:00:00 2001 From: gmvbif Date: Sat, 2 Jan 2016 08:56:40 +0300 Subject: [PATCH 2/3] Fixed some warnings from Native project - fastMode assigned twice in ChunkFIle constructor - added checking for fail while reading ini file (possible infinity loop) - zim_save assigned dithval twice (Please double check this) - in http_client added checking progress againt nullptr --- ext/native/file/chunk_file.cpp | 1 - ext/native/file/ini_file.cpp | 2 +- ext/native/image/zim_save.cpp | 2 +- ext/native/net/http_client.cpp | 3 ++- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/native/file/chunk_file.cpp b/ext/native/file/chunk_file.cpp index 7fb050abb0..dd627b9522 100644 --- a/ext/native/file/chunk_file.cpp +++ b/ext/native/file/chunk_file.cpp @@ -8,7 +8,6 @@ ChunkFile::ChunkFile(const char *filename, bool _read) { data=0; fn = filename; - fastMode=false; numLevels=0; read=_read; pos=0; diff --git a/ext/native/file/ini_file.cpp b/ext/native/file/ini_file.cpp index 9070bb8079..14d0b6b370 100644 --- a/ext/native/file/ini_file.cpp +++ b/ext/native/file/ini_file.cpp @@ -531,7 +531,7 @@ bool IniFile::Load(std::istream &in) { // Maximum number of letters in a line static const int MAX_BYTES = 1024*32; - while (!in.eof()) + while (!(in.eof() || in.fail())) { char templine[MAX_BYTES]; in.getline(templine, MAX_BYTES); diff --git a/ext/native/image/zim_save.cpp b/ext/native/image/zim_save.cpp index be9bb5485d..ba753a79be 100644 --- a/ext/native/image/zim_save.cpp +++ b/ext/native/image/zim_save.cpp @@ -164,7 +164,7 @@ void Convert(const uint8_t *image_data, int width, int height, int pitch, int fl for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { int dithval = dith[(x&3)+((y&0x3)<<2)] - 8; - dithval = 0; + //dithval = 0; please check this int r = clamp32((image_data[i * 4] + dithval/2) >> 3); int g = clamp64((image_data[i * 4 + 1] + dithval/4) >> 2); int b = clamp32((image_data[i * 4 + 2] + dithval/2) >> 3); diff --git a/ext/native/net/http_client.cpp b/ext/native/net/http_client.cpp index aecee2ae1d..739923519e 100644 --- a/ext/native/net/http_client.cpp +++ b/ext/native/net/http_client.cpp @@ -323,7 +323,8 @@ int Client::ReadResponseEntity(Buffer *readbuf, const std::vector & bool result = decompress_string(compressed, &decompressed); if (!result) { ELOG("Error decompressing using zlib"); - *progress = 0.0f; + if (progress) + *progress = 0.0f; return -1; } output->Append(decompressed); From 63ee113af406817d80fa198a145ea925c7216cb5 Mon Sep 17 00:00:00 2001 From: gmvbif Date: Sat, 2 Jan 2016 09:13:42 +0300 Subject: [PATCH 3/3] Added break for every switch case in DescribePixelRGBA. Please double check this. --- Windows/GEDebugger/GEDebugger.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Windows/GEDebugger/GEDebugger.cpp b/Windows/GEDebugger/GEDebugger.cpp index b2982bae78..850e28faa6 100644 --- a/Windows/GEDebugger/GEDebugger.cpp +++ b/Windows/GEDebugger/GEDebugger.cpp @@ -349,20 +349,24 @@ void CGEDebugger::DescribePixelRGBA(u32 pix, GPUDebugBufferFormat fmt, int x, in r = Convert5To8((pix >> 0) & 0x1F); g = Convert6To8((pix >> 5) & 0x3F); b = Convert5To8((pix >> 11) & 0x1F); + break; case GPU_DBG_FORMAT_565_REV: b = Convert5To8((pix >> 0) & 0x1F); g = Convert6To8((pix >> 5) & 0x3F); r = Convert5To8((pix >> 11) & 0x1F); + break; case GPU_DBG_FORMAT_5551: r = Convert5To8((pix >> 0) & 0x1F); g = Convert5To8((pix >> 5) & 0x1F); b = Convert5To8((pix >> 10) & 0x1F); a = (pix >> 15) & 1 ? 255 : 0; + break; case GPU_DBG_FORMAT_5551_REV: a = pix & 1 ? 255 : 0; b = Convert5To8((pix >> 1) & 0x1F); g = Convert5To8((pix >> 6) & 0x1F); r = Convert5To8((pix >> 11) & 0x1F); + break; case GPU_DBG_FORMAT_5551_BGRA: b = Convert5To8((pix >> 0) & 0x1F); g = Convert5To8((pix >> 5) & 0x1F);