[Ohrrpgce] SVN: teeemcee/7792 Fix Select slices updating child visibility when drawing instead of refr

James Paige Bob at HamsterRepublic.com
Mon Mar 14 07:30:35 PDT 2016


On Sat, Mar 12, 2016 at 8:05 PM, <subversion at hamsterrepublic.com> wrote:

> teeemcee
> 2016-03-12 20:05:27 -0800 (Sat, 12 Mar 2016)
> 1750
> Fix Select slices updating child visibility when drawing instead of
> refreshing
>
> This change affects when a script will see up-to-date visibility of select
> child slices. You still need to do something to cause the slice to be
> refreshed.
> This also affects "slice at pixel" and "find colliding slice" called with
> visibleonly=true.
>
> ChildRefresh is now called even on non-visible slices by DrawSlice, but it
> takes an additional visibleonly argument to skip refreshing the size and
> position in that case. This is both to avoid unneeded processing for hidden
> slices and to exactly match the previous behaviour for non-select slices
> (although I really hope noone is relying on the size of hidden slices not
> being
> updated!)
>

I know I am not worried. All of my invisible-slice-voodoo is using
container slices, not selects.


> Slices shouldn't modify themselves when drawn, aside from calling
> ChildRefresh,
> so that we can draw slices more or less than expected without breaking
> anything
> as long as they're refreshed somehow (e.g. RefreshSliceTreeScreenPos()).
> For example, slice velocity is applied in AdvanceSlice, not DrawSlice.
> In future this will allow things like frame skpping and drawing slices
> multiple
> times on small wrapping maps.
>

Will this allow multiple views of the same map? I had some crazy ideas a
while back about split screen multiplayer, but gave up on them at the time
because I couldn't do that with mapslices.



> Unfortunately other slice types don't entirely obey the pure-draw-function
> rule.
> Both rect and sprite slices delay loading styles or sprites until the first
> draw, which causes modifications.
> Even worse, auto-advancing dissolving sprites advance when being drawn;
> which
> is definitely the wrong place to do so.
> Text slices toggle .insert_tog and recompute .line_count when drawn. The
> latter
> doesn't directly affect drawing but is related to the bug that the height
> of
> text slices isn't recomputed when their .line_count changes (e.g. because
> their
> width changes), because that's only done when ChangeTextSlice is called.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20160314/3c7dc3a7/attachment.htm>


More information about the Ohrrpgce mailing list