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

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 #30 on: December 13, 2015, 01:39:26 PM »
Alright thanks once again man!! I might actually start playing again you made it work right.

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 #31 on: December 13, 2015, 01:42:30 PM »
it did fix my sc1  8) so anyone wanna play in ru holler! so giving a thx.i got paypal only if u like a pizza or something.
« Last Edit: December 13, 2015, 01:47:06 PM by easycompany »

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 #32 on: December 13, 2015, 01:54:35 PM »
Yeah at least a charity of choice.

Anyways looks like team liquid is happy and some people are experiencing some lag for sc though. I haven't tried the fix yet but will check it out tonight. I'm also wondering who is aqrit he comes in here and fix shit like it was nothing. Very cool!

Offline xboi209

  • Grunt
  • ***
  • Posts: 80
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #33 on: December 13, 2015, 02:16:08 PM »
aqrit, so your DLL is too slow for competitive play in StarCraft, is there anything you could do? Also, what should I change so I could use the C/C++ standard library?

Also, would it be possible to hook the DirectDraw functions in memory at a later point in time(after the loading screen) rather than make a redirect DLL?
« Last Edit: December 13, 2015, 03:10:09 PM by xboi209 »

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 #34 on: December 13, 2015, 03:48:32 PM »
This is so cool! Tried it out and it's working great. Props to aqrit for releasing this fix! c:

Also need to try live streaming software with this DLL. It's quite possible it will be blinking also, i'll check that later. I never tried to stream videos... So would be great if someone experienced in live streaming check that faster.

Tried out OBS and it seems fine -- no blinking like in the warvid. Everyone needs to set up streaming right away, this is now the optimal replay recording strategy!

But here's the bug still exists while making SS in-chat: it saves cyan screen in-chat to PCX. That is a declared behaviour and works the same on all the checked systems.But here's a way to bypass broken SS in-chat: You can use Alt-PrtSrc instead of PrtSrc, then screenshot will be copied to clipboard instead of PCX-file, then you can Alt-Tab, run "mspaint" or any other graphics editor and paste (Ctrl-V) the clipboard content.

Another workaround is to install the free app Greenshot, you can configured it to use a custom hotkey for full screen capture (e.g. an unused function key or ctrl+alt+something), and to automatically save to desktop without a prompt, works great. Don't set it to PrtScr to avoid the save as box popping up though.


Hey do you guys think this fixed the banner bug? So we can use the animated ones now?

Checked last night, and it seems yes! I don't think we'll be able to use rotating banners for the forseeable future though because it's such a bad glitch without the new ddraw fix, and it'll take a while for the fix to be widely distributed. Plus like xboi209 says, the fix causes some slight lag that interferes with competitive play? Swift & Joe were saying in channel last night that they won't use it, it makes gamplay "spongy".
squeak!

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 #35 on: December 13, 2015, 04:13:17 PM »
all i could tell was in sc1 not war2.sc1 is lagged unplayable.

Offline aqrit

  • Peon
  • **
  • Posts: 41
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #36 on: December 13, 2015, 04:37:23 PM »
Quote
C/C++ standard library?
why would you want to?
rename DllEntryPoint to DllMain then set the appropriate linker options.

Quote
hook the DirectDraw functions in memory at a later point in time(after the loading screen) rather than make a redirect DLL?
anything is possible... IMO it is best to hook DirectDrawCreate at the very beginning then redirect internally between real and emulated functions. Using a "ddraw.dll" file is optional, if one wants to inject some other way. A full answer to this question would be a long essay :p

Quote
too slow for competitive play
The game(s) actually do all their ddraw drawing in software.
They only uses ddraw as a way to copy "the output" to video memory.

War2 does not use GDI in-game (I assume). So plain ddraw only output could be ported away from the emulated ddraw and to anything one wants... The patch current uses GDI for "in-game" "output", which is notoriously slow(?)... Using OpenGL, Direct2D, Direct3D, D3DKMT,  or (insert favorite graphics api here ) would probably be faster at the needed tasks: DMA, color conversion, and optionally updating only the dirty rectangles. We could even switch back and use real ddraw in-game on Win8 and Win10.

If starcraft mixes GDI and DDraw "in-game" then things don't look too good. The mixed gdi and ddraw areas are the frustrating part of this patch... as GDI can not be easily redirected. I don't know how well the other APIs would mix with GDI, they might have the same compatibility problems as ddraw. Which forces us to keep using GDI to do output...  However, one could try different GDI functions like MaskBlt instead of GdiTransparentBlt or try blitting only dirty rectangles instead of the whole screen, etc.. One could also try to beat GDIs performance by doing color converstion and detecting dirty rects by hand using SSE2, thread tiling, etc.

The performance of FindWindowEx is unknown. The function could probably be replaced, if needed.
« Last Edit: December 13, 2015, 05:19:55 PM by aqrit »

Offline tolsty

  • Peon
  • **
  • Posts: 27
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #37 on: December 14, 2015, 03:25:15 AM »
Quote
Here is the 10 second fix:
http://www.bitpatch.com/downloads/war2_ddraw_test2.zip

put the shadow was gone, the clarity was the same as was on the original library. Thank you.

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1653
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #38 on: December 14, 2015, 04:47:26 AM »
If starcraft mixes GDI and DDraw "in-game" then things don't look too good. The mixed gdi and ddraw areas are the frustrating part of this patch...

Not sure if that could help, but maybe to use an idea from cpu savior? http://forum.war2.ru/index.php/topic,409.0.html
The idea was to add sleep 1ms in each gdi drawing loop or w/e.
If it redraws mixed ddraw+GDI millions times per second, it causes CPU utilization. If you add timeout into the graphics loop, if will free the CPU.
Another idea is to enforce your code 1 time of 1000, not every time. Then interface will be fixed not in realtime but with a little delay.

Anyways, your code if perfect already for war2, that is what we've been need for all these years since vista have been released.

however. the screen is somehow a bit blurry. hurts eyes :S.

put the shadow was gone, the clarity was the same as was on the original library. Thank you.

Looks like you're talking about the same thing, can you see that on my screenshots in my 1-st post here? I didn't see any problems with fonts on my ss. I'm not careful or it didn't appear for me?
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 #39 on: December 14, 2015, 06:36:06 AM »
Looks like you're talking about the same thing, can you see that on my screenshots in my 1-st post here? I didn't see any problems with fonts on my ss. I'm not careful or it didn't appear for me?

It does show up in screenshots but it's very slight. You have to zoom way in to really see but it makes the text very slightly blurry.



Right half is with ddraw2 that aqrit posted earlier.
squeak!

Offline tk[as]

  • Server Admin
  • Dragon
  • *****
  • Posts: 5021
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #40 on: December 14, 2015, 07:12:53 AM »
FTP link broke

Offline iL

  • Administrator
  • Ogre Mage
  • *****
  • Posts: 1653
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #41 on: December 14, 2015, 07:51:57 AM »
FTP link broke
works perfect for me...
oh the link works in firefox without
"ftp://"

:P

ok. i have it. lets try it.


this?

Right half is with ddraw2 that aqrit posted earlier.
ah, thx, i'll look at that more careful...
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 Fredrik Eriksson

  • Grunt
  • ***
  • Posts: 131
  • Grosshandlaren i Enköping
    • View Profile
    • Grosshandlaren
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #42 on: December 14, 2015, 12:40:49 PM »
For me, it dont know if this is better :)

Thing is, I have never had a problem with the colors except when I "alt tab". Replaced the file and now "alt tab" seems working fine. The problem is that the graphics in the chat is worse than before, everything is a little fuzzier. I havent check if it is same when playing, will be back.

Offline Fredrik Eriksson

  • Grunt
  • ***
  • Posts: 131
  • Grosshandlaren i Enköping
    • View Profile
    • Grosshandlaren
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #43 on: December 14, 2015, 12:45:00 PM »
I havent check if it is same when playing, will be back.

Ok, tested and graphics is fine in game mode :)

Thanks for this!

Offline xboi209

  • Grunt
  • ***
  • Posts: 80
    • View Profile
Re: War2 graphics for Win Vista/7/8/8.1/10/2012 fixed
« Reply #44 on: December 14, 2015, 02:30:20 PM »
Not sure if that could help, but maybe to use an idea from cpu savior? http://forum.war2.ru/index.php/topic,409.0.html
The idea was to add sleep 1ms in each gdi drawing loop or w/e.
If it redraws mixed ddraw+GDI millions times per second, it causes CPU utilization. If you add timeout into the graphics loop, if will free the CPU.
Another idea is to enforce your code 1 time of 1000, not every time. Then interface will be fixed not in realtime but with a little delay.

The CPU utilization doesn't slow things down since the majority of the stuff is single threaded. I'm not completely sure but I think the for loop that erases the video memory in ToScreen() is partly responsible for slowly down the code. Oddly, replacing that loop with std::memset() from the standard library doesn't work as expected for some reason. I'm thinking of having multiple threads erase different parts of the video memory at the same time since it's erasing 76800 bytes of memory one byte at a time which is quite a lot.