VOGONS


First post, by OpenRift

User metadata
Rank Member
Rank
Member

The one thing that I find that dgVoodoo doesn't do very well is whenever it utilizes system fonts in combination with game graphics (I assume thru GDI), it causes a lot of issues. Black squares around text, graphical elements being misaligned or showing as black squares, elements not scaling properly, so on. This appears to happen in the following scenarios:
- Battle.net interface for Diablo 1 and Warcraft II Battle.net Edition
- The menus for the WON version of Half-Life

There are probably other games that have similar issues, but those are just the ones I know of.

That said, are there any plans to improve support for these sorts of scenarios?

EDIT: Forgot to mention DDrawCompat seems to fix most of these issues, perhaps some code can be borrowed from there?

Last edited by OpenRift on 2023-01-24, 23:11. Edited 1 time in total.

Reply 1 of 12, by aqrit

User metadata
Rank Member
Rank
Member

> Battle.net interface for Diablo 1 and Warcraft II Battle.net Edition

DWM redirects GDI and DDRAW drawing to different layers. Which prevents DDRAW from erasing things drawn by GDI.

A proper fix for this issue would require the ability to redirect GDI drawing operations to an offscreen device context under our control, including the drawing done by the default USER32 WndProcs. Instead, this mod tries to sync bits between ddraw and gdi surfaces during dds->Lock/Unlock.

Reply 2 of 12, by OpenRift

User metadata
Rank Member
Rank
Member
aqrit wrote on 2023-01-24, 21:27:

> Battle.net interface for Diablo 1 and Warcraft II Battle.net Edition

DWM redirects GDI and DDRAW drawing to different layers. Which prevents DDRAW from erasing things drawn by GDI.

A proper fix for this issue would require the ability to redirect GDI drawing operations to an offscreen device context under our control, including the drawing done by the default USER32 WndProcs. Instead, this mod tries to sync bits between ddraw and gdi surfaces during dds->Lock/Unlock.

Updated my main post.

Reply 3 of 12, by Dege

User metadata
Rank l33t
Rank
l33t

GDI and DDraw cannot draw into the same window since DWM appeared in Windows.

dgVoodoo's GDI hook basically does (in general) what Aqrit said but the current implementation implements 'write only' mode. That is, GDI can only write into the primary DD surface but the content of the DD surface is not read back for the GDI access (I primarily developed it for MCI AVI/DirectShow video playback). I'll try to implement the read mode and that should solve the problem (when I have some time).

Reply 4 of 12, by Deffnator

User metadata
Rank Member
Rank
Member
Dege wrote on 2023-02-04, 19:19:

GDI and DDraw cannot draw into the same window since DWM appeared in Windows.

dgVoodoo's GDI hook basically does (in general) what Aqrit said but the current implementation implements 'write only' mode. That is, GDI can only write into the primary DD surface but the content of the DD surface is not read back for the GDI access (I primarily developed it for MCI AVI/DirectShow video playback). I'll try to implement the read mode and that should solve the problem (when I have some time).

Dege, may i suggest using shadow of the horned rat and HOMM1 as your testbed if you go full on wing32.dll addon?
i saw the wip post, in SOTHR's case is due to the game using their own font file and the use of two different windows, one for menu and other for battle, dxwnd tries to circumvent this but the game also has scaling issues.
HOMM that was covered a while ago, had the same issues and even the rainbow screen of doom, A guy managed to fix this, He managed to convert wing32 calls into opengl, i don't know how he did. But the patch itself became hard to find due to the author deleting everything in protest against the war at ukraine and asking for donations.

Reply 5 of 12, by aqrit

User metadata
Rank Member
Rank
Member

It looks like WinG is a simple pass-thru to GDI, though I haven't check the SDK.
https://github.com/wine-mirror/wine/blob/mast … wing32/wing32.c

I'm think SOTHR runs fine (without Dgvoodoo2) on both Windows and Wine?

Anyways...

Narzoul's DDrawCompat is interesting. (aside: I tried to port the wndprocs from Wine but never got it working quite right.)
DDrawCompat appears to hook the wndproc's. However, just registering a local class of the same name (e.g. "Button") gets precedence from CreateWindow (maybe that doesn't catch the hard-coded class atoms, but who uses those?).

Reply 6 of 12, by Deffnator

User metadata
Rank Member
Rank
Member
aqrit wrote on 2023-02-05, 23:28:
It looks like WinG is a simple pass-thru to GDI, though I haven't check the SDK. https://github.com/wine-mirror/wine/blob/mast … […]
Show full quote

It looks like WinG is a simple pass-thru to GDI, though I haven't check the SDK.
https://github.com/wine-mirror/wine/blob/mast … wing32/wing32.c

I'm think SOTHR runs fine (without Dgvoodoo2) on both Windows and Wine?

Anyways...

Narzoul's DDrawCompat is interesting. (aside: I tried to port the wndprocs from Wine but never got it working quite right.)
DDrawCompat appears to hook the wndproc's. However, just registering a local class of the same name (e.g. "Button") gets precedence from CreateWindow (maybe that doesn't catch the hard-coded class atoms, but who uses those?).

SOTHR requires DPLAY to run on windows, even the gog release install is busted, and the game has aspect ratio issues that you need to fix it by using your own GPU app config.
Windows 3.1 release is fine and runs on dosbox but the game hates resolutions above 640x480 there and it even gives you a message about it.
strangely though it came with one of the earliest directx releases included with the CD install

another game that seems to suffer the same issues is Final Liberation by SSI, the game simply doesn't like window scaling and high res.

Reply 7 of 12, by aqrit

User metadata
Rank Member
Rank
Member

SOTHR doesn't have multiplayer. Dark Omen requires DPLAY for multiplayer but it doesn't have a gog release.

I'm not trying to give anyone a hard time. I am interested. I've done mods for all of these games (execpt HOMM).

Reply 8 of 12, by Deffnator

User metadata
Rank Member
Rank
Member
aqrit wrote on 2023-02-07, 21:42:

SOTHR doesn't have multiplayer. Dark Omen requires DPLAY for multiplayer but it doesn't have a gog release.

I'm not trying to give anyone a hard time. I am interested. I've done mods for all of these games (execpt HOMM).

https://www.gog.com/forum/warhammer_sha ... ont_launch
here it is, people begged GoG to ask EA about the source code for years(since they own Mindscape), but they never cared.

Reply 9 of 12, by Dege

User metadata
Rank l33t
Rank
l33t
aqrit wrote on 2023-02-05, 23:28:
It looks like WinG is a simple pass-thru to GDI, though I haven't check the SDK. https://github.com/wine-mirror/wine/blob/mast … […]
Show full quote

It looks like WinG is a simple pass-thru to GDI, though I haven't check the SDK.
https://github.com/wine-mirror/wine/blob/mast … wing32/wing32.c

I'm think SOTHR runs fine (without Dgvoodoo2) on both Windows and Wine?

Anyways...

Narzoul's DDrawCompat is interesting. (aside: I tried to port the wndprocs from Wine but never got it working quite right.)
DDrawCompat appears to hook the wndproc's. However, just registering a local class of the same name (e.g. "Button") gets precedence from CreateWindow (maybe that doesn't catch the hard-coded class atoms, but who uses those?).

Ah, yes, that was the conclusion I previously came to. WinG is just a few functions that were kind of "extensions" to the Win3.1(?) or Win32S(?) GDI API but they became part of the GDI API later. So, WinG games are just pure GDI games requiring the WinG library for simply passing through some GDI calls.

So, that's the problem with WinG from my point of view... Writing a 'WinG' wrapper in fact means writing a GDI/USER wrapper to hook several functions for acquiring DC's, setting the display mode, etc.

Reply 10 of 12, by SoulEater

User metadata
Rank Newbie
Rank
Newbie
OpenRift wrote on 2023-01-23, 19:52:
The one thing that I find that dgVoodoo doesn't do very well is whenever it utilizes system fonts in combination with game graph […]
Show full quote

The one thing that I find that dgVoodoo doesn't do very well is whenever it utilizes system fonts in combination with game graphics (I assume thru GDI), it causes a lot of issues. Black squares around text, graphical elements being misaligned or showing as black squares, elements not scaling properly, so on. This appears to happen in the following scenarios:
- Battle.net interface for Diablo 1 and Warcraft II Battle.net Edition
- The menus for the WON version of Half-Life

There are probably other games that have similar issues, but those are just the ones I know of.

That said, are there any plans to improve support for these sorts of scenarios?

EDIT: Forgot to mention DDrawCompat seems to fix most of these issues, perhaps some code can be borrowed from there?

I think DOW2 Retribution has the same issues when using dgvoodoo. Some of the UI elements like unit healthbars, player HUD etc. can disappear, which is strange..

Reply 11 of 12, by Deffnator

User metadata
Rank Member
Rank
Member
Dege wrote on 2023-02-08, 08:50:
aqrit wrote on 2023-02-05, 23:28:
It looks like WinG is a simple pass-thru to GDI, though I haven't check the SDK. https://github.com/wine-mirror/wine/blob/mast … […]
Show full quote

It looks like WinG is a simple pass-thru to GDI, though I haven't check the SDK.
https://github.com/wine-mirror/wine/blob/mast … wing32/wing32.c

I'm think SOTHR runs fine (without Dgvoodoo2) on both Windows and Wine?

Anyways...

Narzoul's DDrawCompat is interesting. (aside: I tried to port the wndprocs from Wine but never got it working quite right.)
DDrawCompat appears to hook the wndproc's. However, just registering a local class of the same name (e.g. "Button") gets precedence from CreateWindow (maybe that doesn't catch the hard-coded class atoms, but who uses those?).

Ah, yes, that was the conclusion I previously came to. WinG is just a few functions that were kind of "extensions" to the Win3.1(?) or Win32S(?) GDI API but they became part of the GDI API later. So, WinG games are just pure GDI games requiring the WinG library for simply passing through some GDI calls.

So, that's the problem with WinG from my point of view... Writing a 'WinG' wrapper in fact means writing a GDI/USER wrapper to hook several functions for acquiring DC's, setting the display mode, etc.

the HOMM patches did that, also it added amore options per pressing the F1-F5 keys, but verokster went missing after all of the ukraine shenanigans started and he deleted all of his page in protest, since then he got missing.

Reply 12 of 12, by aqrit

User metadata
Rank Member
Rank
Member

note: Verokster's HOMM patches fork.
It is missing at least two commits:

commit 115: Fixed smack for H2  (September 2021?)
commit 116: Added italian & german versions (Nov 16, 2021)