elishacloud / dxwrapper

Fixes compatibility issues with older games running on Windows 10/11 by wrapping DirectX dlls. Also allows loading custom libraries with the file extension .asi into game processes.
zlib License
1.2k stars 88 forks source link

Somewhat minor Plants vs. Zombies Rendering issues [Dd7to9] #282

Open Windowslover1234 opened 1 month ago

Windowslover1234 commented 1 month ago

Issue 1

This only happens when you toggle "3D Acceleration" in the settings menu. The issue goes away when you restart the game. The Location of the bugged backdrop is rendered in the front-most layer and it's position dependent on the game window's position as well. 20240704122432_1

Issue 2

The "Full screen" option's scaling is broken with "3D Acceleration" enabled. The game is rendered in the corner of the screen while the button hitboxes are scaled in the center of the screen. 20240704123653_1(1)

Final Thoughts

Disabling "3D Acceleration" fixes both these issues, but this wrapper gives me much higher performance than WineD3D on my system in the "Seed Selection" screen in the first screenshot, about 30FPS with 3D Acceleration enabled, excellent work!

elishacloud commented 1 month ago

Issue 1: This only happens when you toggle "3D Acceleration" in the settings menu.

Can you confirm what build you are using or upload your log files?

Issue 2: The "Full screen" option's scaling is broken with "3D Acceleration" enabled.

Yeah, I have not yet built scaling for the 3D games yet. It is showing the original size of the game and just stretching the window to fill the screen. I may be able to put a quick fix in for this. I will take a look when I have some time. I think issue 1 should not happen in full screen. BTW: can you confirm with full screen setting you are using?

Windowslover1234 commented 1 month ago

Issue 1 Log: dxwrapper-popcapgame1.log Still happens in full screen. This happens in any part of the game that gameplay happens and stays onscreen until you quit.

Issue 2 Understandable that you haven't gotten 3D scaling working yet.

I'm using the game's built-in fullscreen option with 3D Accel, without 3D Accel basically does the same thing as the "ForceExclusiveFullscreen" option in the config file. With or without 3D Accel, the game caps the framerate to 60FPS. The mentioned "ForceExclusiveFullscreen" option works perfectly with this game, but I would like to be able to use the game's built in option.

elishacloud commented 1 month ago

For the full screen try setting DdrawOverrideWidth to 800 and DdrawOverrideHeight to 600 in the dxwrapper.ini file. This should force the game into this resolution and then allow the scaling to be done by your monitor.

Windowslover1234 commented 1 month ago

DdrawOverride caps the resolution so that the window looks correct but the hitboxes are unaffected.

Toggling 3D Acceleration with DdrawOverride also causes a 1600x900 canvas to be created which looks like the Issue 2 but is squished into windowed mode, but can be fixed by alt-entering to toggle full screen on and off. With or without DdrawOverride, the "Full Screen" option in settings causes Issue 1 to occur where gameplay happens as-well.

Also, the game window flashes when any part of the window is off-screen on the right when 3D Acceleration is enabled and spams this in the log:

9604 14:06:14.484 m_IDirectDrawX::CreateD3D9Device Direct3D9 device! 1600x900 refresh: 0 format: D3DFMT_UNKNOWN wnd: WND(000907F4,MainWindow,{840,162,1646,791}) params: {1600,900,D3DFMT_UNKNOWN,1,0,0,1,WND(000907F4,MainWindow,{840,162,1646,791}),1,0,D3DFMT_UNKNOWN,0x0,0,0x80000000} flags: 0x46
9604 14:06:14.549 m_IDirectDrawX::CreateSurface2 Primary surface 0x0 dwFlags: 0x1 ddsCaps: 0x2200, 0x0, 513
9604 14:06:14.574 m_IDirectDrawX::CreateD3D9Device Direct3D9 device! 800x600 refresh: 0 format: D3DFMT_UNKNOWN wnd: WND(000907F4,MainWindow,{840,162,1646,791}) params: {800,600,D3DFMT_UNKNOWN,1,0,0,1,WND(000907F4,MainWindow,{840,162,1646,791}),1,0,D3DFMT_UNKNOWN,0x0,0,0x80000000} flags: 0x46

Seems like either the game or the wrapper is constantly swapping between 800x600 and 1600x900 for some reason.