Author Topic: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed  (Read 181689 times)

Offline 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:
« Last Edit: August 14, 2016, 02:50:49 AM by xboi209 »

Offline aqrit

  • Peon
  • **
  • Posts: 41
    • 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?
« Last Edit: August 16, 2016, 03:07:56 AM by aqrit »

Offline 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 :/

Offline Delete mine too

  • Death Knight
  • *********
  • Posts: 2652
  • http://meatspin.com
    • View Profile
    • http://meatspin.com
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.

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1650
    • View Profile
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.
Need help to translate War2Combat to German, French, Italian, Polish or another language: http://forum.war2.ru/index.php/topic,4728.0.html
Please, contact me if you are interested in that.

Offline Delete mine too

  • Death Knight
  • *********
  • Posts: 2652
  • http://meatspin.com
    • View Profile
    • http://meatspin.com
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.

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1650
    • View Profile
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.
Need help to translate War2Combat to German, French, Italian, Polish or another language: http://forum.war2.ru/index.php/topic,4728.0.html
Please, contact me if you are interested in that.

Offline mousEtopher

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 2065
    • 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
squeak!

Offline mousEtopher

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 2065
    • 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
squeak!

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1650
    • View Profile
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.
Need help to translate War2Combat to German, French, Italian, Polish or another language: http://forum.war2.ru/index.php/topic,4728.0.html
Please, contact me if you are interested in that.

Offline mousEtopher

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 2065
    • 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



squeak!

Offline fois

  • Grunt
  • ***
  • Posts: 230
  • Chicken
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #206 on: March 15, 2019, 03:49:12 AM »
Latest version comes now with a resizable window, It does also remember the window position now and comes with a new settings file with additional settings for fine tuning.

https://github.com/FunkyFr3sh/Aqrit-DDraw-Hack/releases


Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1650
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #207 on: March 15, 2019, 04:37:59 AM »
Latest version comes now with a resizable window, It does also remember the window position now and comes with a new settings file with additional settings for fine tuning.
Wow! Even 2 days ago, right after i looked into GOG Diablo release, i began to look into ddraw to maybe rewrite it myself!
And now you appear with your update! Thanks!
Please, post your updates here, i even didn't know about your project.

What i liked in GOG ideas: using current resolution, to not switch the game to 640x480 or w/e. That's great and very pleasant. What i disliked: that works for single player only, now for bnet chat.
Quote
This ddraw is meant to be used for online games only
That will be very interesting to look, how you released a resizable window with GDI elements for bnet-chat. I thought about that, but i still didn't make even a 1-st step that way...

Also thanks a lot for the opensource project: GOG's didn't make their code sources, they even used some kind of angry cryptor, so debugger can just see unlimited list of senseless jmps and calls...

UPD: also another interesting question:
which aqrit version it based on?
test2, test3, test4?
As i don't see d3d shaders, i'd suppose it's test2? Not so quick as test4 which supports d3d, but compatible with all videocards?
« Last Edit: March 15, 2019, 05:34:11 AM by iL »
Need help to translate War2Combat to German, French, Italian, Polish or another language: http://forum.war2.ru/index.php/topic,4728.0.html
Please, contact me if you are interested in that.

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1650
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #208 on: March 15, 2019, 04:53:15 AM »
@fois, i looked into your repositories and see one forked from narzoul/DDrawCompat. I also looked into narzoul's thing, to adapt it to war2. I like their coding style and lots complicated bugfixes. What do you think about to use fork from DDrawCompat for war2?
Need help to translate War2Combat to German, French, Italian, Polish or another language: http://forum.war2.ru/index.php/topic,4728.0.html
Please, contact me if you are interested in that.

Offline shesycompany

  • Death Knight
  • *********
  • Posts: 3587
  • retired, be in music section
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #209 on: March 15, 2019, 10:20:41 AM »
omg! best performance love it!!!!

omg!!!!!!! like omg i need some beer!!!! thanks for the options!!!! i can use my little widgets!!


1 more thing,i have a dosbox that uses, i think its called scalers, im not sure..like 2x eagle2xsai,mame stuff..that makes the graphics almost perfect but no biggie cool as hell!
« Last Edit: March 15, 2019, 11:10:06 AM by easycompany »