Difference between revisions of "WkUseDesktopWindow"
From Worms Knowledge Base
(fixed the article) |
(Public domain.) |
||
Line 5: | Line 5: | ||
| games = [[Worms World Party|WWP]], [[Worms Armageddon|W:A]] | | games = [[Worms World Party|WWP]], [[Worms Armageddon|W:A]] | ||
| language = C++ | | language = C++ | ||
− | | license = Open-source | + | | license = Open-source; public-domain. |
| download = [http://worms2d.info/files/wkUseDesktopWindow2.zip wkUseDesktopWindow2.zip (174KB)] | | download = [http://worms2d.info/files/wkUseDesktopWindow2.zip wkUseDesktopWindow2.zip (174KB)] | ||
}} | }} | ||
Line 44: | Line 44: | ||
Note to developers: I have a feeling there might be a stack corruption bug somewhere (partially due to stupidity most likely, and perhaps to do with the lack of documentation and few, conflicting examples), as I was having a straight crash in WA when I was compiling it with -O2, but I can't seem to find one - if anyone does find one, let me know, or if you get a game to crash with it when it wouldn't normally in that situation, again let me know. | Note to developers: I have a feeling there might be a stack corruption bug somewhere (partially due to stupidity most likely, and perhaps to do with the lack of documentation and few, conflicting examples), as I was having a straight crash in WA when I was compiling it with -O2, but I can't seem to find one - if anyone does find one, let me know, or if you get a game to crash with it when it wouldn't normally in that situation, again let me know. | ||
+ | |||
+ | === Copyright notice === | ||
+ | |||
+ | I hereby release this software and its source code into the public domain, to be used, modified, redistributed and relicensed in any way. No credit/attribution is necessary but it would be appreciated ;) | ||
{{OSS}} | {{OSS}} |
Revision as of 14:44, 21 September 2012
wkUseDesktopWindow | |
---|---|
Developer: | Muzer |
Supported games: | WWP, W:A |
Language: | C++ |
License: | Open-source; public-domain. |
Download: | wkUseDesktopWindow2.zip (174KB) |
I have made a WormKit module that enables WWP to work on wine without needing a wine patch (as well as older versions of WA if these should be needed for any reason, eg bug regression testing or just historical interest).
Contents
Instructions
- Download WormKitDS. The vanilla plain-and-simple Wormkit doesn't work under wine so this is the one you'll need. It's probably easier to get the archive version since you're a Linux user. Extract madCHook.dll and dsound.dll into your WWP dir.
- Download my module, extract the DLL file into your WWP dir (the Source directory is only of interest to developers, you can delete it to save a few k if you aren't one).
- Launch WWP under wine - if it's anything like WA, it works best if you use a virtual desktop (and then you get window mode as a bonus!).
Known/possible issues
- I have not actually tested ANY of this under Linux. Ironically, I made this because I might not have access to a Windows machine for a few months; but I don't actually have access to a Linux one right now! However, it SHOULD work, or at least stop the main glitch of the black screen of death
- WWP seems to have a very strange bug not present in any version I dared try of WA, when used in conjunction with this app. Many of the menu screens are shifted up. Oddly, this seems to be resolved after starting and quitting a game, so there's a workaround for you. I'm not a DX programmer, so anyone who can help diagnose this would be much appreciated
Compatibility
This app has been tested (again, not under Linux but it should work there!) in Worms Armageddon versions as early as 3.6.19.19 (nothing special about that version aside from it being the one I clicked on ) and as late as the latest version (where it's unnecessary anyway due to the existing implementation), as well as in WWP (but it's hard to tell if it actually works there, I expect it does due to the aforementioned bugs!).
FAQs
See above; this is a bug!
I get an error telling me it's a bad module!
You probably forgot madCHook.dll.
I can't minimise ingame!
That shows it's working! Also, you're obviously playing WA because WWP doesn't have a minimise option. Try not minimising ingame. No, seriously, use a wine virtual desktop to put the game in its own window, that way you can use your window manager to minimise it.
How the hell did you do this?
It's incredibly simple. WA/WWP use the SetCooperativeLevel DirectDraw call to tell DirectX to draw on their drawing window. However, in wine, this makes it draw behind the input window (which wine refuse to fix, apparently it will break other things due to the way wine and ddraw don't really mix very well), resulting in a black screen possibly with a few bits of weird. This module intercepts calls to SetCooperativeLevel and tell them to draw on the desktop window instead, which is DirectX speak for "DRAW ON EVERYTHING!!!11!1!1!1!", which (in theory) makes it work.
How long did it take?
Far too long. At first I tried to do it in Delphi because all the examples are in Delphi. But after much head-scratching and downloading of dodgy free trials of things, I worked out that the latest version of Delphi (the only one I could find) doesn't work with the old version of madCodeHook that is the free version. So, I rewrote the whole thing in C++, with no documentation and few examples, and as such, it also took me far longer than it should to get it working!
Note to developers: I have a feeling there might be a stack corruption bug somewhere (partially due to stupidity most likely, and perhaps to do with the lack of documentation and few, conflicting examples), as I was having a straight crash in WA when I was compiling it with -O2, but I can't seem to find one - if anyone does find one, let me know, or if you get a game to crash with it when it wouldn't normally in that situation, again let me know.
Copyright notice
I hereby release this software and its source code into the public domain, to be used, modified, redistributed and relicensed in any way. No credit/attribution is necessary but it would be appreciated ;)