War2.ru Slogan
News: If your graphics are broken you can fix with the new ddraw version.
** Read how to install it here **


Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Welcome to the forums! We're glad to have you here! :) You can register your account here, then feel free to introduce yourself in the Server.War2.ru board & let us know who you are on the server.

War2 graphics for Win Vista/7/8/8.1/10/2012 fixed 52107  205

Grunt Posts: 80 Karma: +7/-0 ***

xboi209

  • Grunt
  • ***
  • Posts: 80
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #195 on: August 14, 2016, 02:11:28 AM »
Could you tell me how to fix the Korean text using invasive hooking? I think I'll just separate it into another DLL. Don't bother with overriding the Arial font, StarCraft uses custom font files embedded inside its data files.

Regarding #2, how easy would it be to lock the 32bpp surface?

The 1.17.0 patch along with the HD announcement seems like it's weird timing. There are a few scenarios I have in mind about what Blizzard would do, and releasing the 1.17.0 patch alongside the HD version (that should be backwards compatible with original BW players) is one possibility. I'd like to see your code become compatible with 1.17.0 though because the windowed mode hack that the community uses is broken with 1.17.0.

And FYI, I profiled the code and this is the result:
Peon Posts: 38 Karma: +5/-0 **

aqrit

  • Peon
  • **
  • Posts: 38
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #196 on: August 16, 2016, 02:59:55 AM »
> Could you tell me how to fix the Korean text using invasive hooking?
http://www.teamliquid.net/forum/viewpost.php?post_id=25568672
IIRC, the game creates an offscreen gdi surface the same color depth as the display
it draws the korean text to that surface using gdi
then it just does a straight memcpy of those bits to the (8bpp) ddraw surface.

it all happens around the GetBitmapBits() call

so pick one of the following:
A) hook some gdi calls so the gdi surface is 8bpp
B) color convert the data as it is moved between the 32bpp gdi surface and the 8bpp ddraw surface
C) output the text straight to the 32bpp d3d surface
D) replace the whole function with custom "draw string" code

> Regarding #2, how easy would it be to lock the 32bpp surface?
we DON'T want to lock the 32bpp surface.
instead we want to remove all calls to color_convert() and multiblt()
...
If you really want to lock the 32bpp surface... IIRC, the previous versions did it so check the git commit history.

> profiled the code
seems to be missing :p
but this project is not at the optimization stage...
it still has other fundamental issues :-/

Assuming the palette code gets optimized...

then the only thing going on in-game really is the mapping between video memory and system memory for the 8bpp texture? I don't know much about it and the docs seems vague on what is actually going on behind the scenes...

You can try using different texture creation flags, or different color format for the 32bpp surface or something, idk.

One could switch between exclusive mode in-game then pop back to normal mode on the menu...
which kinda leads to what I was saying about hooking WM_DRAWITEM/PAINT because (afaik) thats the only way to stay in exclusive mode 100% of the time.

/random
I was wondering awhile ago, if one flipped the GDI primary to the ddraw back buffer... could it be accessed simultaneous by ddraw and gdi? I suspect that behavior has also been broken, though.

> windowed mode
if the drawing was fixed in the 1.17 (alpha?) couldn't one just use dxwnd again?
Grunt Posts: 80 Karma: +7/-0 ***

xboi209

  • Grunt
  • ***
  • Posts: 80
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #197 on: August 16, 2016, 06:01:09 PM »
so pick one of the following:
A) hook some gdi calls so the gdi surface is 8bpp
B) color convert the data as it is moved between the 32bpp gdi surface and the 8bpp ddraw surface
C) output the text straight to the 32bpp d3d surface
D) replace the whole function with custom "draw string" code
I wouldn't really know how to do any of that without some really specific details :/
Ogre Mage Posts: 2467 Karma: +78/-1 ********

tupac

  • Ogre Mage
  • ********
  • *
  • Posts: 2467
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #198 on: August 16, 2016, 08:19:44 PM »
> Could you tell me how to fix the Korean text using invasive hooking?
http://www.teamliquid.net/forum/viewpost.php?post_id=25568672
IIRC, the game creates an offscreen gdi surface the same color depth as the display
it draws the korean text to that surface using gdi
then it just does a straight memcpy of those bits to the (8bpp) ddraw surface.

it all happens around the GetBitmapBits() call

so pick one of the following:
A) hook some gdi calls so the gdi surface is 8bpp
B) color convert the data as it is moved between the 32bpp gdi surface and the 8bpp ddraw surface
C) output the text straight to the 32bpp d3d surface
D) replace the whole function with custom "draw string" code

> Regarding #2, how easy would it be to lock the 32bpp surface?
we DON'T want to lock the 32bpp surface.
instead we want to remove all calls to color_convert() and multiblt()
...
If you really want to lock the 32bpp surface... IIRC, the previous versions did it so check the git commit history.

> profiled the code
seems to be missing :p
but this project is not at the optimization stage...
it still has other fundamental issues :-/

Assuming the palette code gets optimized...

then the only thing going on in-game really is the mapping between video memory and system memory for the 8bpp texture? I don't know much about it and the docs seems vague on what is actually going on behind the scenes...

You can try using different texture creation flags, or different color format for the 32bpp surface or something, idk.

One could switch between exclusive mode in-game then pop back to normal mode on the menu...
which kinda leads to what I was saying about hooking WM_DRAWITEM/PAINT because (afaik) thats the only way to stay in exclusive mode 100% of the time.

/random
I was wondering awhile ago, if one flipped the GDI primary to the ddraw back buffer... could it be accessed simultaneous by ddraw and gdi? I suspect that behavior has also been broken, though.

> windowed mode
if the drawing was fixed in the 1.17 (alpha?) couldn't one just use dxwnd again?



Dxwnd never worked for battle.net.... yours is perfect just need to add a frame so we can move the window.
Administrator Ogre Posts: 1076 Karma: +104/-9 *****

iL

  • Administrator
  • Ogre
  • *****
  • *
  • Posts: 1076
    • View Profile
*

iL

Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #199 on: January 02, 2017, 11:25:18 AM »
Just tried war2 with all versions of ddraw.dll on my computer: core i5-4460, win7 x64, integrated video adapter (generic vga).
Dxdiag shows directx 11.

Test2 works fine. Test3 and test4 causes ddraw error. Test4 minimal causes black screen. (Also test4 causes a kaspersky antivirus false-positive: win32 trojan-generic).
I just planned to use something working with windowed mode by alt-enter (test 3 and test 4 should work, as i remember).

So, looks like all these tests are still far from production. Need some final product from tests.
Otherwise i can't implement it to new combat.
Ogre Mage Posts: 2467 Karma: +78/-1 ********

tupac

  • Ogre Mage
  • ********
  • *
  • Posts: 2467
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #200 on: January 02, 2017, 12:57:52 PM »
Just tried war2 with all versions of ddraw.dll on my computer: core i5-4460, win7 x64, integrated video adapter (generic vga).
Dxdiag shows directx 11.

Test2 works fine. Test3 and test4 causes ddraw error. Test4 minimal causes black screen. (Also test4 causes a kaspersky antivirus false-positive: win32 trojan-generic).
I just planned to use something working with windowed mode by alt-enter (test 3 and test 4 should work, as i remember).

So, looks like all these tests are still far from production. Need some final product from tests.
Otherwise i can't implement it to new combat.
Why would you test them of windows 7? This is a Windows 8.1, 10, etc fix.
Administrator Ogre Posts: 1076 Karma: +104/-9 *****

iL

  • Administrator
  • Ogre
  • *****
  • *
  • Posts: 1076
    • View Profile
*

iL

Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #201 on: January 03, 2017, 06:53:34 PM »
Why would you test them of windows 7? This is a Windows 8.1, 10, etc fix.
Because i try everything everywhere.
My motherboard is asus h81m-k.

Well, test4_minimal is a windows 8+ fix, that's ok, but test 3, test 4 should work everywhere. And they don't on my configuration.

The problem is gone when inserting external video card (NVIDIA Quadro FX 4500), both test3 and test4 work perfect on win7. (test4_minimal works also, but crashes on alt-tab). But sad that only test2 works with integrated video.
Not user-friendly behavior for new users. I even have no idea how to detect proper version for win-7 in new combat.
"Just to try test4, if not working, then try test3, if not working try test2"? Sad.
Administrator Ogre Mage Posts: 1862 Karma: +98/-109 *****

mousEtopher

  • Administrator
  • Ogre Mage
  • *****
  • *
  • Posts: 1862
    • View Profile
    • War2.me
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #202 on: March 11, 2017, 10:54:33 AM »
Not sure if it's been noticed before, but just helped burton install I think test2 (the version that fixes blurry text) and it crashes war2 when UAC is enabled. Win7 x64
Administrator Ogre Mage Posts: 1862 Karma: +98/-109 *****

mousEtopher

  • Administrator
  • Ogre Mage
  • *****
  • *
  • Posts: 1862
    • View Profile
    • War2.me
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #203 on: August 20, 2018, 05:28:45 PM »
new ddraw version released by @FF on discord!

Quote from: FF
forked the ddraw and made a release with fps limiter for those having performance issues

https://github.com/FunkyFr3sh/Aqrit-DDraw-Hack/releases
Administrator Ogre Posts: 1076 Karma: +104/-9 *****

iL

  • Administrator
  • Ogre
  • *****
  • *
  • Posts: 1076
    • View Profile
*

iL

Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #204 on: August 28, 2018, 09:42:39 AM »
Wow!
Interesting, someone tries to continue that great job!

Need to test that new versions carefully, the main thing is stability.
Administrator Ogre Mage Posts: 1862 Karma: +98/-109 *****

mousEtopher

  • Administrator
  • Ogre Mage
  • *****
  • *
  • Posts: 1862
    • View Profile
    • War2.me
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #205 on: September 07, 2018, 01:18:26 PM »
@FF aka fois[as] continuing to release updated versions of the ddraw that provide cool new features, now including toggleable window mode
https://github.com/FunkyFr3sh/Aqrit-DDraw-Hack/releases