diff --git a/Common/FileUtil.cpp b/Common/FileUtil.cpp index 8152762ad313..776913f63c0e 100644 --- a/Common/FileUtil.cpp +++ b/Common/FileUtil.cpp @@ -121,7 +121,7 @@ std::string ResolvePath(const std::string &path) { if (hFile == INVALID_HANDLE_VALUE) { wcscpy_s(buf, BUF_SIZE - 1, input.c_str()); } else { - int result = GetFinalPathNameByHandle(hFile, buf, BUF_SIZE - 1, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); + int result = getFinalPathNameByHandleW(hFile, buf, BUF_SIZE - 1, FILE_NAME_NORMALIZED | VOLUME_NAME_DOS); if (result >= BUF_SIZE || result == 0) wcscpy_s(buf, BUF_SIZE - 1, input.c_str()); } diff --git a/Core/Config.cpp b/Core/Config.cpp index 048bb4baad54..03e1043ddbe4 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1210,18 +1210,10 @@ void Config::AddRecent(const std::string &file) { if (iMaxRecent <= 0) return; - const std::string filename = File::ResolvePath(file); - for (auto iter = recentIsos.begin(); iter != recentIsos.end();) { - const std::string recent = File::ResolvePath(*iter); - if (filename == recent) { - // Note that the increment-erase idiom doesn't work with vectors. - iter = recentIsos.erase(iter); - // We'll add it back below. - } else { - iter++; - } - } + // We'll add it back below. This makes sure it's at the front, and only once. + RemoveRecent(file); + const std::string filename = File::ResolvePath(file); recentIsos.insert(recentIsos.begin(), filename); if ((int)recentIsos.size() > iMaxRecent) recentIsos.resize(iMaxRecent); diff --git a/GPU/GLES/FragmentShaderGeneratorGLES.cpp b/GPU/GLES/FragmentShaderGeneratorGLES.cpp index 674cbaa42d70..19dc1ba37dc0 100644 --- a/GPU/GLES/FragmentShaderGeneratorGLES.cpp +++ b/GPU/GLES/FragmentShaderGeneratorGLES.cpp @@ -359,7 +359,7 @@ bool GenerateFragmentShader(const FShaderID &id, char *buffer, uint64_t *uniform } else { WRITE(p, " vec2 uv = %s.xy;\n vec2 uv_round;\n", texcoord); } - WRITE(p, " vec2 tsize = textureSize(tex, 0);\n"); + WRITE(p, " vec2 tsize = vec2(textureSize(tex, 0));\n"); WRITE(p, " vec2 fraction;\n"); WRITE(p, " bool bilinear = (u_depal >> 31) != 0;\n"); WRITE(p, " if (bilinear) {\n");