diff --git a/LunaTranslator/LunaTranslator/gui/settingpage_xianshishezhi.py b/LunaTranslator/LunaTranslator/gui/settingpage_xianshishezhi.py index 731374a8..4176c6f1 100644 --- a/LunaTranslator/LunaTranslator/gui/settingpage_xianshishezhi.py +++ b/LunaTranslator/LunaTranslator/gui/settingpage_xianshishezhi.py @@ -237,7 +237,6 @@ def setTabThree_lazy(self) : setsubtype() losslessgrid=[ [('LosslessScaling_路径',4),(getcolorbutton(globalconfig,'',callback=lambda x: getsomepath1(self,'LosslessScaling_路径',globalconfig['lossless'],'path','LosslessScaling_路径',isdir=True),icon='fa.gear',constcolor="#FF69B4"),1)], - [('If version is not 2.2.6 or 2.5.0.1.Beta2, maybe not useful.',10)], [('缩放模式',4),(getsimplecombobox(['自动','自定义'],globalconfig['lossless'],'scalingMode',lambda _: setenables()),6),''], [('',4),(sfm,6)], [('',4),('缩放系数',4),(sf,2)], @@ -247,7 +246,7 @@ def setTabThree_lazy(self) : [('',4),('锐度',4),(sharp,2)], [('',4),('优化版本',4),(sub1,2)], [('',4),('尺寸',4),(sub2,2)], - [('',4),('Performance',4),(sub3,2)], + [('',4),('性能',4),(sub3,2)], [('',4),('VRS',4),(vrs,2)], [('Frame Generation',4),(getsimplecombobox(['Off','LSFI'],globalconfig['lossless'],'frameGeneration'),6)], [('光标选项',4)], @@ -256,6 +255,7 @@ def setTabThree_lazy(self) : [('',4),('隐藏光标',4),(getsimpleswitch(globalconfig['lossless'],'hideCursor'),2)], [('',4),('缩放光标',4),(getsimpleswitch(globalconfig['lossless'],'scaleCursor'),2)], [('渲染选项',4)], + [('',4),('Sycn Interval',4),(getspinbox(0,4,globalconfig['lossless'],'syncInterval'),2)], [('',4),('双缓冲',4),(getsimpleswitch(globalconfig['lossless'],'doubleBuffering'),2)], [('',4),('VRR支持',4),(getsimpleswitch(globalconfig['lossless'],'vrrSupport'),2)], [('',4),('HDR支持',4),(getsimpleswitch(globalconfig['lossless'],'hdrSupport'),2)], diff --git a/LunaTranslator/LunaTranslator/myutils/fullscreen.py b/LunaTranslator/LunaTranslator/myutils/fullscreen.py index 8e59cb15..c78d187c 100644 --- a/LunaTranslator/LunaTranslator/myutils/fullscreen.py +++ b/LunaTranslator/LunaTranslator/myutils/fullscreen.py @@ -55,7 +55,7 @@ class fullscreen(): # windows.keybd_event(mp1[mp[k]],0,windows.KEYEVENTF_KEYUP,0) def _4(self,hwnd,full): if full: - self.engine= subproc_w(r'./files/plugins/shareddllproxy64.exe lossless "{}" "{}" {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}'.format(globalconfig['lossless']['path'],hwnd, + self.engine= subproc_w(r'./files/plugins/shareddllproxy64.exe lossless "{}" "{}" {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {}'.format(globalconfig['lossless']['path'],hwnd, globalconfig['lossless']['scalingMode'], globalconfig['lossless']['scalingFitMode'], @@ -84,7 +84,8 @@ class fullscreen(): globalconfig['lossless']['captureOffsetBottom'], globalconfig['lossless']['multiDisplayMode'], os.getpid(), - globalconfig['lossless']['frameGeneration']),cwd=globalconfig['lossless']['path']) + globalconfig['lossless']['frameGeneration'], + globalconfig['lossless']['syncInterval']),cwd=globalconfig['lossless']['path']) self._waitenginestop() else: endevent =windows.AutoHandle(windows.CreateEvent(False, False,'LOSSLESS_WAITFOR_STOP_SIGNAL'+str(self.engine.pid))) diff --git a/LunaTranslator/files/defaultconfig/config.json b/LunaTranslator/files/defaultconfig/config.json index ae2769de..afeb84c8 100644 --- a/LunaTranslator/files/defaultconfig/config.json +++ b/LunaTranslator/files/defaultconfig/config.json @@ -1206,6 +1206,7 @@ "cursorSensitivity":false, "hideCursor":false, "scaleCursor":false, + "syncInterval":0, "doubleBuffering":false, "vrrSupport":false, "hdrSupport":false, diff --git a/plugins/shareddllproxy/lossless.cpp b/plugins/shareddllproxy/lossless.cpp index 4c6372a8..a291b495 100644 --- a/plugins/shareddllproxy/lossless.cpp +++ b/plugins/shareddllproxy/lossless.cpp @@ -14,6 +14,7 @@ typedef void (*UnInit_t)(); typedef bool (*Activate_t)(HWND hwnd); typedef void(*ApplySettings_t1)(int scalingMode, int scalingFitMode, int scalingType, int scalingSubtype, float scaleFactor, bool resizeBeforeScale, bool windowedMode, int sharpness, bool VRS, bool clipCursor, bool cursorSensitivity, bool hideCursor, bool scaleCursor, bool doubleBuffering, bool vrrSupport, bool hdrSupport, bool allowTearing, bool legacyCaptureApi, bool drawFps, int gpuId, int displayId, int captureOffsetLeft, int captureOffsetTop, int captureOffsetRight, int captureOffsetBottom, bool multiDisplayMode); typedef void(*ApplySettings_t2)(int scalingMode, int scalingFitMode, int scalingType, int scalingSubtype, float scaleFactor, bool resizeBeforeScale, bool windowedMode, int sharpness, bool VRS,int frameGeneration, bool clipCursor, bool cursorSensitivity, bool hideCursor, bool scaleCursor, bool doubleBuffering, bool vrrSupport, bool hdrSupport, bool allowTearing, bool legacyCaptureApi, bool drawFps, int gpuId, int displayId, int captureOffsetLeft, int captureOffsetTop, int captureOffsetRight, int captureOffsetBottom, bool multiDisplayMode); +typedef void(*ApplySettings_t3)(int scalingMode, int scalingFitMode, int scalingType, int scalingSubtype, float scaleFactor, bool resizeBeforeScale, bool windowedMode, int sharpness, bool VRS,int frameGeneration, bool clipCursor, bool cursorSensitivity, bool hideCursor, bool scaleCursor,int syncInterval, bool doubleBuffering, bool vrrSupport, bool hdrSupport, bool allowTearing, bool legacyCaptureApi, bool drawFps, int gpuId, int displayId, int captureOffsetLeft, int captureOffsetTop, int captureOffsetRight, int captureOffsetBottom, bool multiDisplayMode); enum ErrorCode { NO_CODE, @@ -78,6 +79,13 @@ int checkversion(uintptr_t ApplySettings_ptr) { } } if (retptr == 0)return 0; + //2.5.1.0 + /* + .text:0000000180016E93 0F B6 84 24 E0 00 00 00 movzx eax, [rsp+arg_D8] + .text:0000000180016E9B 88 05 05 4D 01 00 mov cs:byte_18002BBA6, al + .text:0000000180016EA1 44 89 0D 1C 4D 01 00 mov cs:dword_18002BBC4, r9d + .text:0000000180016EA8 C3 retn + */ //2.5.0.1.b2 /* .text:0000000180016DCE 0F B6 84 24 D8 00 00 00 movzx eax, [rsp + arg_D0] .text:0000000180016DD6 88 05 CA 4D 01 00 mov cs : byte_18002BBA6, al @@ -100,6 +108,7 @@ int checkversion(uintptr_t ApplySettings_ptr) { wprintf(L"%x\n", argnum); if (argnum == 0xd0)return 1; else if (argnum == 0xd8)return 2; + else if (argnum == 0xE0)return 3; return 0; } void enable_log(LPVOID Initptr) { @@ -166,9 +175,9 @@ int losslesswmain(int argc, wchar_t* wargv[]) auto captureOffsetRight=std::stoi(wargv[26]); auto captureOffsetBottom=std::stoi(wargv[27]); auto multiDisplayMode=wcscmp(wargv[28],L"True")==0; - - lunapid=std::stoi(wargv[29]); + lunapid=std::stoi(wargv[29]); auto frameGeneration=std::stoi(wargv[30]); + auto syncInterval=std::stoi(wargv[31]); auto Lossless = LoadLibraryW(LR"(.\Lossless.dll)"); if (Lossless == 0)return 0; @@ -206,6 +215,8 @@ int losslesswmain(int argc, wchar_t* wargv[]) ((ApplySettings_t1)ApplySettings)(scalingMode, scalingFitMode, scalingType, scalingSubtype, scaleFactor, resizeBeforeScale, windowedMode, sharpness, VRS, clipCursor, cursorSensitivity, hideCursor, scaleCursor, doubleBuffering, vrrSupport, hdrSupport, allowTearing, legacyCaptureApi, drawFps, gpuId, displayId, captureOffsetLeft, captureOffsetTop, captureOffsetRight, captureOffsetBottom, multiDisplayMode); else if(version==2) ((ApplySettings_t2)ApplySettings)(scalingMode, scalingFitMode, scalingType, scalingSubtype, scaleFactor, resizeBeforeScale, windowedMode, sharpness, VRS,frameGeneration, clipCursor, cursorSensitivity, hideCursor, scaleCursor, doubleBuffering, vrrSupport, hdrSupport, allowTearing, legacyCaptureApi, drawFps, gpuId, displayId, captureOffsetLeft, captureOffsetTop, captureOffsetRight, captureOffsetBottom, multiDisplayMode); + else if(version==3) + ((ApplySettings_t3)ApplySettings)(scalingMode, scalingFitMode, scalingType, scalingSubtype, scaleFactor, resizeBeforeScale, windowedMode, sharpness, VRS,frameGeneration, clipCursor, cursorSensitivity, hideCursor, scaleCursor,syncInterval, doubleBuffering, vrrSupport, hdrSupport, allowTearing, legacyCaptureApi, drawFps, gpuId, displayId, captureOffsetLeft, captureOffsetTop, captureOffsetRight, captureOffsetBottom, multiDisplayMode); SetForegroundWindow(hwnd); Activate(hwnd); std::thread([=]() {