FunkyFr3sh / cnc-ddraw

GDI, OpenGL and Direct3D 9 re-implementation of the DirectDraw API for classic 2D games for better compatibility with Windows ME, 2000, XP, Vista, 7, 8, 10, 11, Wine (Linux/macOS/Android) and Virtual Machines
https://discord.gg/afWXJNDDF5
MIT License
2.33k stars 148 forks source link

Road Rash: very minor HUD related (?) issue #190

Closed AvinashReddy3108 closed 1 year ago

AvinashReddy3108 commented 1 year ago

Issue Details

OS: Arch Linux (game is run via WINE version wine-7.22 (Staging)) Game: Road Rash (ROADRASH.EXE) cnc-ddraw version: v4.9.0.0 (Used WINEDLLOVERRIDES='ddraw=n,b' ["native, builtin" override])

Configuration (ddraw.ini) ```ini ; cnc-ddraw - https://github.com/FunkyFr3sh/cnc-ddraw [ddraw] ; ### Optional settings ### ; Use the following settings to adjust the look and feel to your liking ; Stretch to custom resolution, 0 = defaults to the size game requests width=0 height=0 ; Override the width/height settings shown above and always stretch to fullscreen ; Note: Can be combined with 'windowed=true' to get windowed-fullscreen aka borderless mode fullscreen=false ; Run in windowed mode rather than going fullscreen windowed=false ; Maintain aspect ratio maintas=false ; Windowboxing / Integer Scaling boxing=false ; Real rendering rate, -1 = screen rate, 0 = unlimited, n = cap ; Note: Does not have an impact on the game speed, to limit your game speed use 'maxgameticks=' maxfps=-1 ; Vertical synchronization, enable if you get tearing - (Requires 'renderer=auto/opengl/direct3d9') ; Note: vsync=true can fix tearing but it will cause input lag vsync=false ; Automatic mouse sensitivity scaling ; Note: Only works if stretching is enabled. Sensitivity will be adjusted according to the size of the window adjmouse=true ; Preliminary libretro shader support - (Requires 'renderer=opengl') https://github.com/libretro/glsl-shaders ; 2x scaling example: https://imgur.com/a/kxsM1oY - 4x scaling example: https://imgur.com/a/wjrhpFV ; shader=Shaders\cubic\catmull-rom-bilinear.glsl ; Window position, -32000 = center to screen posX=-32000 posY=-32000 ; Renderer, possible values: auto, opengl, gdi, direct3d9 (auto = try direct3d9/opengl, fallback = gdi) renderer=auto ; Developer mode (don't lock the cursor) devmode=false ; Show window borders in windowed mode border=true ; Save window position/size/state on game exit and restore it automatically on next game start ; Possible values: 0 = disabled, 1 = save to global 'ddraw' section, 2 = save to game specific section savesettings=0 ; Should the window be resizable by the user in windowed mode? resizable=true ; Enable linear (D3DTEXF_LINEAR) upscaling filter for the direct3d9 renderer d3d9linear=true ; Enable upscale hack for high resolution patches (Supports C&C1, Red Alert 1 and KKND Xtreme) vhack=false ; cnc-ddraw config program language, possible values: auto, english, chinese, german, spanish, russian, hungarian, french configlang=auto ; Where should screenshots be saved screenshotdir=.\Screenshots\ ; ### Compatibility settings ### ; Use the following settings in case there are any issues with the game ; Hide WM_ACTIVATEAPP and WM_NCACTIVATE messages to prevent problems on alt+tab noactivateapp=true ; Max game ticks per second, possible values: -1 = disabled, -2 = refresh rate, 0 = emulate 60hz vblank, 1-1000 = custom game speed ; Note: Can be used to slow down a too fast running game, fix flickering or too fast animations ; Note: Usually one of the following values will work: 60 / 30 / 25 / 20 / 15 (lower value = slower game speed) maxgameticks=0 ; Windows API Hooking, Possible values: 0 = disabled, 1 = IAT Hooking, 2 = Microsoft Detours, 3 = IAT+Detours Hooking (All Modules), 4 = IAT Hooking (All Modules) ; Note: Change this value if windowed mode or upscaling isn't working properly ; Note: 'hook=2' will usually work for problematic games, but 'hook=2' should be combined with renderer=gdi hook=4 ; Force minimum FPS, possible values: 0 = disabled, -1 = use 'maxfps=' value, -2 = same as -1 but force full redraw, 1-1000 = custom FPS ; Note: Set this to a low value such as 5 or 10 if some parts of the game are not being displayed (e.g. menus or loading screens) minfps=0 ; Disable fullscreen-exclusive mode for the direct3d9/opengl renderers ; Note: Can be used in case some GUI elements like buttons/textboxes/videos/etc.. are invisible nonexclusive=false ; Force CPU0 affinity, avoids crashes/freezing, *might* have a performance impact singlecpu=true ; Available resolutions, possible values: 0 = Small list, 1 = Very small list, 2 = Full list ; Note: Set this to 2 if your chosen resolution is not working, set to 1 if the game is crashing resolutions=0 ; Child window handling, possible values: 0 = Disabled, 1 = Display top left, 2 = Display top left + repaint, 3 = Hide ; Note: Disables upscaling if a child window was detected fixchilds=2 ; Set the precision for Direct3D9 floating-point calculations to the precision used by the calling thread ; Note: Enable this if there are desyncs in online games fpupreserve=false ; Undocumented settings d3d9_adapter=0 opengl_core=false d3d9on12=false guard_lines=200 max_resolutions=0 limit_bltfast=false game_handles_close=false accuratetimers=false fixpitch=true fixwndprochook=false novidmem=false locktopleft=false lock_surfaces=false releasealt=true gdilinear=false allow_wmactivate=false dinputhook=false flipclear=false fixmousehook=false bpp=0 ; ### Hotkeys ### ; Use the following settings to configure your hotkeys, 0x00 = disabled ; Virtual-Key Codes: https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes ; Switch between windowed and fullscreen mode = [Alt] + ??? keytogglefullscreen=0x0D ; Maximize window without frame = [Alt] + ??? keytogglemaximize=0x22 ; Unlock cursor 1 = [Ctrl] + ??? keyunlockcursor1=0x09 ; Unlock cursor 2 = [Right Alt] + ??? keyunlockcursor2=0xA3 ; Screenshot keyscreenshot=0x2C ```

First things first, this is the ONLY wrapper that works perfectly for this game on my Linux system (huge kudos for that) [even the shaders work perfectly, except for this HUD issue given below].

Now onto the one minor issue:

When using cnc-ddraw, there's this box area that's appreoximately the same as the HUD area in race that's unaffected by the shaders (I know shader support is not stable yet) and produces a screen tearing like effect (this effect even exists when I don't use any shaders)

Screenshot (without cnc-ddraw):

Y0109_083039

Screenshot (with cnc-ddraw):

Y0109_083255

Edited screenshot

I marked the screenshot to show the affected region (region below the blue line)

Y0109_083255-annotated

Notice how the white line of the road [near the blue line I marked] is sliced more than it should be (compared to the screenshot without cnc-ddraw). I have marked that with a red circle..

Y0109_083255-annotated2

I'll appreciate any help I can get to try to fix this, and am ready to provide any logs required.

AvinashReddy3108 commented 1 year ago

Here's another screenshot (I used the handheld/gbc-gambatte-color.glsl shader) Also changed the HUD (can be done by F10 key in race)

Y0109_085323

Notice how the HUD area is unaffected by the shader, can be seen from the fire hydrant in the lower left of the screen

AvinashReddy3108 commented 1 year ago

Used the ddraw.dll from #44, here's the debug logs it generated.

cnc-ddraw.log

AvinashReddy3108 commented 1 year ago

With some tinkering of the config file, I have figured out the fix.. Simply use fixchilds=1, and the problem is solved..

Even custom shaders work perfectly now.