Difference between revisions of "WkUseDesktopWindow"

From Worms Knowledge Base

Jump to: navigation, search
(First version of page - needs wikification, etc.)
 
(New version.)
Line 35: Line 35:
 
  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.
  
http://worms2d.info/files/wkUseDesktopWindow.zip
+
http://worms2d.info/files/wkUseDesktopWindow2.zip

Revision as of 21:20, 20 September 2012

TODO: Wikify, infoboxify, etc.

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).

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!).
OK, now for the fun parts, known issues/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:
* All the menus are shifted up in WWP!
** 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.

http://worms2d.info/files/wkUseDesktopWindow2.zip

Personal tools