[Bug 26365] Geneforge 1 - text gets cut away

wine-bugs at winehq.org wine-bugs at winehq.org
Sat Nov 28 11:51:48 CST 2015


https://bugs.winehq.org/show_bug.cgi?id=26365

Pierre Lupien <flowkclab at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |flowkclab at gmail.com

--- Comment #22 from Pierre Lupien <flowkclab at gmail.com> ---
A possible fix... or at the very least a working hack...

I've stepped through the application with the debugger and I believe I
found what could be the problem (at least in one case).

My test case (wine version: 1.8-rc1, running on ArchLinux/x86_64):
  - Start the application
  - Click "Start New Game" and accept all defaults and lick Ok until
    the main game screen appears
  - Click on the journal icon, the "Welcome to Geneforge" text appears
     correctly
  - Close the journal window
  - Move the mouse over the character on screen. A green circle will
    appear around the character. Move the mouse away.
  - Click on the journal icon again, the "Welcome to Geneforge" text
    will now be clipped (which, obviously, is a problem). Other
    text in the game will also be clipped from that point on.

Calls from the application:

When the mouse is moved over the character, the following happens:
  - App calls ddraw_surface_GetDC and sets background color, 
    text color, etc
  - App calls CreateRectRgn, SelectClipRgn and DeleteObject(hrgn)  
    (the DeleteObject is expected/ok, since SelectClipRgn makes a copy)
  - App makes various calls to draw the selection circle.
  - App calls ddraw_surface1_ReleaseDC (which in turn calls
    ddraw_surface7_ReleaseDC [dlls/ddraw/surface.c:2197]).
  - App moves on to other things.

The app never explicetly un-selects the clip region, so it seems it 
expects the clip region to be un-selected by the call to 
ddraw_surface1_ReleaseDC  (assumption supported by the fact that the
text always appears properly on Windows).

I was able to fix it by adding the following call to 
ddraw_surface7_ReleaseDC (before the mutex lock):

    SelectClipRgn(hdc, NULL);

Now, I have absolutely no idea what kind of unwanted side-effect(s)
this addition might have (performance-related  or otherwise) or if
a better solution could be found (like a call to SaveDC in GetDC and
RestoreDC in ReleaseDC), or if instead the fix belongs in the
deeper function wined3d_surface_releasedc.  I also haven't played the
game much further to check other test cases, but the journal text is
now ok as well as the text from game events (e.g. tutorial messages).

So this could be a fix or a very bad hack. In any case, if a 
knowledgeable Wine developper is interested in taking a look, this 
could be a good place to start.

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list