URL:
  <http://gna.org/patch/?3176>

                 Summary: "Ghost images" for units covered by fog
                 Project: Battle for Wesnoth
            Submitted by: jamit
            Submitted on: Thu 01 Mar 2012 03:09:46 PM EST
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

This patch will cause units that get recovered by fog to still be rendered
until the start of the viewing side's next turn. They will disappear should
the hex be uncovered again, and they will not change if the unit they
represent should move or otherwise change (such as by WML event). They can be
moused over to see their stats, but they cannot be clicked upon, nor do they
impact pathfinding.

I broke this patch into five stages.
* _const-reports_ This preliminary stage simply adds "const" qualifiers
throughout reports.cpp. Fairly routine stuff, but necessary for proper
qualification of later modifications.
0 _ghost-unit-support-a_ This stage adds the *option* for fake units to be
described in the side panel when the player mouses over them. This is done in
a benign fashion, with (almost) no change to existing functionality. (I'll
describe the one change below.)
0 _ghost-unit-support-b_ This stage makes mouse-overs of fake units respect
the "exclusive draw" setting. ("Exclusive draw" is currently used exclusively
by the whiteboard.) This appears to not change functionality, but unlike the
earlier stages, a lack of functional change cannot be proven based solely on
the code that was changed.
0 _ghost-units-base_ This is the main stage, where the earlier stages are used
to produce images of units that become obscured by fog.
0 _ghost-units-full_ This final stage adds some cleanup of how/when fog and
shroud are cleared and recalculated. (I don't know if this is still required
to make the ghost units function, but at one point during their development it
looked like it would be.)

The one functional change introduced by "ghost-unit-support-a" is rather
limited in scope. When drawing a hex, the "hex_top_layer" for a moused-over
hex can be either LAYER_MOUSEOVER_BOTTOM or LAYER_MOUSEOVER_TOP, depending on
whether or not the hex has a visible unit. The old code ignored the
viewpoint_/see_all setting for this, while the patched version does not. (If
this change turns out to be a bug, I can restore the old behavior. That
particular part of the code was added in revision 52594.)



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thu 01 Mar 2012 03:09:46 PM EST  Name: 0-const-reports.diff  Size: 10kB 
 By: jamit

<http://gna.org/patch/download.php?file_id=15312>
-------------------------------------------------------
Date: Thu 01 Mar 2012 03:09:46 PM EST  Name: 1-ghost-unit-support-a.diff 
Size: 19kB   By: jamit

<http://gna.org/patch/download.php?file_id=15313>
-------------------------------------------------------
Date: Thu 01 Mar 2012 03:09:46 PM EST  Name: 2-ghost-unit-support-b.diff 
Size: 20kB   By: jamit

<http://gna.org/patch/download.php?file_id=15314>
-------------------------------------------------------
Date: Thu 01 Mar 2012 03:09:46 PM EST  Name: 3-ghost-units-base.diff  Size:
32kB   By: jamit

<http://gna.org/patch/download.php?file_id=15315>

    _______________________________________________________

Reply to this item at:

  <http://gna.org/patch/?3176>

_______________________________________________
  Message sent via/by Gna!
  http://gna.org/


_______________________________________________
Wesnoth-bugs mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-bugs

Reply via email to