³ò
~×YKc        
   @   s©  d  d k  Z  d  d k Z d  d k Z d  d k Z d  d k Z e i ƒ  Z d a e  i e	 ƒ Z
 g  a e a e a e ƒ  a e ƒ  a d „  Z d „  Z d „  Z e a d „  Z d „  Z d „  Z d	 „  Z d
 e f d „  ƒ  YZ e d d d d ƒ Z d e f d „  ƒ  YZ e ƒ  g Z d „  Z  d „  Z! d „  Z" d „  Z# d „  Z$ d „  Z% d „  Z& d „  Z' d Z( d Z) d Z* d Z+ d Z, d e f d „  ƒ  YZ- d e f d „  ƒ  YZ. d S(   iÿÿÿÿNi    c          C   s€   t  o# t  i d 8_ t  i ƒ  d a  n x t D] }  |  i ƒ  q1 Wx t D] }  |  i ƒ  qL Wt ƒ  a t ƒ  a t i ƒ  d S(   s1   
    Frees memory used by the render system.
    i   N(	   t   screen_rendert   refcountt   killt   Nonet   new_parentlesst   old_parentlesst   sett   render_cachet   clear(   t   i(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt   free_memory;   s    	

  		c           C   sA   t  i i p d Sn t ƒ  t d j o t d t ƒ ‚ n d S(   s~   
    This is called at shutdown time to check that everything went okay.
    The big thing it checks for is memory leaks.
    Ni    sT   Render count is %d at shutdown. This probably indicates a memory leak bug in Ren'Py.(   t   renpyt   configt	   developerR
   t   render_countt	   Exception(    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt   check_at_shutdownU   s
    c         C   s  t  i i i } | | | | | | f } t |  i | d ƒ } | d j	 o | Sn |  i } | i }	 | i	 }
 |	 d j	 o7 t
 |	 t ƒ o t | |	 ƒ } q³ t |	 | ƒ } n |
 d j	 o7 t
 |
 t ƒ o t | |
 ƒ } q÷ t |
 | ƒ } n | d j  o
 d } n | d j  o
 d } n | | | | | | f } t |  i | d ƒ } | d j	 o | Sn |  i | | | | ƒ } | i i |  ƒ | i o; | i d d | i | i f d t ƒ} | i i |  ƒ n | t |  | <| t |  | <t i | ƒ t i | ƒ | S(   så   
    Causes the displayable `d` to be rendered in an area of size
    width, height.  st and at are the times of this render, but once
    rendered the Render will remain cached until the displayable needs
    to be redrawn.
    i    t   focusN(   R   t   gamet	   interfacet
   frame_timeR   t   getR   t   stylet   xmaximumt   ymaximumt
   isinstancet   floatt   intt   mint   rendert	   render_oft   appendt   clippingt
   subsurfacet   widtht   heightt   TrueR   t   discardR   t   add(   t   dR"   R#   t   stt   att   ftt   orig_wht   rvR   R   R   t   wh(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyR   c   sD    			


'c         C   s@   |  t  j o/ x" t  |  i ƒ  D] } | i ƒ  q Wt a n d S(   sd   
    Removes d from the render cache. If we're not in a redraw, triggers
    a redraw to start.
    N(   R   t   valuest
   kill_cacheR$   t   invalidated(   R'   t   v(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt
   invalidate¢   s
     c          C   sÖ   t  i ƒ  t i i i ƒ  }  t } g  } t ƒ  } xž t  D]– } | \ } } | | j o q8 n | i | ƒ | t	 j o q8 n | |  j o/ x" t	 | i
 ƒ  D] } | i ƒ  q Wt } n | i | ƒ | a  q8 W| S(   s€   
    Called to determine if any redraws are pending. Returns true if we
    need to redraw the screen now, false otherwise.
    (   t   redraw_queuet   sortR   t   displayt   coret   get_timeR0   R   R&   R   R.   R/   R$   R   (   t   nowR,   t   new_redraw_queuet   seent   tt   whenR'   R1   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt   process_redraws°   s*    
	  

c           C   s   t  o t  d d Sn d S(   sA   
    Returns the time at which the next redraw is scheduled.
    i    N(   R3   R   (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt   redraw_timeÞ   s    c         C   s9   t  i i p d Sn t i | t  i i i |  f ƒ d S(   s>   
    Called to cause `d` to be redrawn in `when` seconds.
    N(   R   R   R   R3   R   R   (   R'   R<   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt   redrawé   s    t   Matrix2Dc           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   sd   
    This represents a 2d matrix that can be used to transform
    points and things like that.
    c         C   s(   | |  _  | |  _ | |  _ | |  _ d  S(   N(   t   xdxt   xdyt   ydxt   ydy(   t   selfRA   RB   RC   RD   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt   __init__ú   s    			c         C   s.   | |  i  | |  i | |  i | |  i f S(   N(   RA   RB   RC   RD   (   RE   t   xt   y(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt	   transform   s    c         C   ss   t  | i |  i | i |  i | i |  i | i |  i | i |  i | i |  i | i |  i | i |  i ƒ S(   N(   R@   RA   RB   RC   RD   (   RE   t   other(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt   __mul__  s
    (   t   __name__t
   __module__t   __doc__RF   RI   RK   (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyR@   ô   s   		i   t   Clipperc           B   s    e  Z d  Z d „  Z d „  Z RS(   s~   
    This is used to calculate the clipping rectangle and update rectangles
    used for a particular draw of the screen.
    c         C   s:   g  |  _  g  |  _ t ƒ  |  _ t ƒ  |  _ t ƒ  |  _ d  S(   N(   t   blitst	   old_blitsR   t   forcedt
   old_forcedt   mutated(   RE   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyRF     s
    		c   '      C   su  |  i  } |  i } |  i } |  i } |  i } | |  _  g  |  _ | |  _ t ƒ  |  _ t ƒ  |  _ t i i } t i i	 } | | }	 d d | | f }
 | o |
 |
 g f Sn | | B} |
 | j o |
 |
 g f Sn d } d } t | ƒ } xã t
 oÛ | t | ƒ j p | t | ƒ j o Pn | | } | | } | | j oD t | d ƒ | j o | i | d  ƒ n | d 7} | d 7} qï | | j o | i | d  ƒ | d 7} qï | i | d  ƒ | d 7} qï W| i d „  | | Dƒ ƒ | i d „  | | Dƒ ƒ | p d g  f Sn g  } xþ | D]ö \ } } } } \ } } } } | | j  o
 | } n | | j  o
 | } n | | j o
 | } n | | j o
 | } n | | } | | } | d j p | d j o q*n | | } | |	 j o |
 |
 g f Sn | i | | | | | f ƒ q*W| i ƒ  g  } d } xÒ| oÊ| i ƒ  \ } } } } } t } | | |	 j o) d d | | f d d | | f g f Sn d }  x|  t | ƒ j  o| |  \ }! }" }# }$ }% | |" j o
 | j n p | |$ j o
 | j n o¡ | |# j o
 | j n p | |% j o
 | j n oe t
 } t | |" ƒ } t | |$ ƒ } t | |# ƒ } t | |% ƒ } | | | | } | i |  ƒ q¨|  d 7}  q¨W| o  | i | | | | | f ƒ q=| i | | | | f ƒ | | 7} q=W| p d g  f Sn | i ƒ  \ } } } } t | ƒ } t | ƒ } t t i | ƒ ƒ } t t i | ƒ ƒ } | | | | | | f g }& x¹ | D]± \ }" }# }$ }% t |" ƒ }" t |# ƒ }# t t i |$ ƒ ƒ }$ t t i |% ƒ ƒ }% t | |" ƒ } t | |# ƒ } t | |$ ƒ } t | |% ƒ } |& i |" |# |$ |" |% |# f ƒ q¢W| | | | | | f |& f S(   s“   
        This returns a clipping rectangle, and a list of update rectangles
        that cover the changes between the old and new frames.
        i    i   i   c         s   s   x |  ] } | d   Vq Wd S(   i   N(    (   t   .0R	   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pys	   <genexpr>e  s    c         s   s   x |  ] } | d   Vq Wd S(   i   N(    (   RU   R	   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pys	   <genexpr>f  s    N(   RQ   RP   RS   RR   RT   R   R   R   t   screen_widtht   screen_heightR$   t   lent   idR&   t   updateR   R   R4   t   popt   FalseR   t   maxR   t   matht   ceil('   RE   t   full_redrawt   bl0t   bl1RS   RR   RT   t   swt   sht   sat
   fullscreent   changest   i0t   i1t   bl1sett   b0t   b1t   sizedt   x0t   y0t   x1t   y1t   sx0t   sy0t   sx1t   sy1t   wt   ht   areat   noncontt   ncat   mergedR	   t   iareat   ix0t   iy0t   ix1t   iy1t   updates(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt   compute!  sÒ    									


&


 !






 

)<<  %(   RL   RM   RN   RF   R‚   (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyRO     s   	c   "      C   s  t  | t ƒ p:t  | t ƒ o¼ t  | t ƒ o¬ | o% t i i i i t | ƒ | ƒ } n | oC | i	 ƒ  \ } } |  i
 i | | | | | | | | d f ƒ qBz$ t i ƒ  |  i | | | f ƒ Wd t i ƒ  Xng | oC | i	 ƒ  \ } } |  i
 i | | | | | | | | d f ƒ n t i i i | |  | | ƒ d Sn | i ot | ƒ } t | ƒ } | o* | \ } }	 }
 } |
 | } | |	 } n |  i	 ƒ  \ } } | d j o d } | } n | } d } | d j o d } | } n | } d } | | j p | | j o d Sn t | | | i | ƒ } t | | | i | ƒ } | d j p | d j o d Sn | o+ |  i i | | | | | | | f ƒ n/ |  i | | | | f ƒ } | i | | | ƒ d Sn | i oh| o” | \ } } } } t | | ƒ } t | | ƒ } t | | | i ƒ } t | | | i ƒ } | | j p | | j o d Sn | | | | f } qS| d j o | } d } n d } | d j o | } d } n d } |  i	 ƒ  \ } } t | | | i | ƒ } t | | | i | ƒ } | d j  p | d j  o d Sn |  i | | | | f ƒ }  n | i d j p
 | i o[ xP | i D]E \ } } } }  }! t |  | | | | | | | i | i | i  ƒ qwWd Sn xA | i D]6 \ } } } }  }! t! |  | | | | | | | ƒ qÒWd S(   sý  
    This is the simple draw routine, which only works when alpha is 1.0
    and the matrices are None. If those aren't the case, draw_complex
    is used instead.

    `dest` - Either a destination surface, or a clipper.
    `clip` - If None, we should draw. Otherwise we should clip, and this is
    the rectangle to clip to.
    `what` - The Render or Surface we're drawing to.
    `xo` - The X offset.
    `yo` - The Y offset.
    `screen` - True if this is a blit to the screen, False otherwise.    
    Ni    i   ("   R   t   RenderR   R   R5   t   imt	   rle_cacheR   RY   t   get_sizeRP   R   R   t	   blit_lockt   acquiret   blitt   releaset   modulet   subpixelt	   draw_funcR   R"   R#   RR   R&   R!   R    R]   t   alphat   forwardt   visible_childrent   draw_transformedt   reverset   draw("   t   destt   clipt   whatt   xot   yot   screenRv   Rw   t   dx0t   dy0t   dx1t   dy1t   dwt   dht   newxt   subxt   newyt   subyt   subwt   subht   newdestt   cx0t   cy0t   cx1t   cy1RG   RH   R"   R#   t   childt   cxot   cyoR   t   main(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyR“   Ô  sœ     %1
1



+



 
 c   -      C   sv  | d j o d  Sn | d  j o t } t } n t | t ƒ p| i ƒ  \ } }	 | o* | \ }
 } } } | |
 } | | } n |  i ƒ  \ } } d \ } } | i | d ƒ \ } } | i | |	 ƒ \ } } | i d |	 ƒ \ } } t i t | | | | ƒ | ƒ } t i	 t
 | | | | ƒ | ƒ } t i t | | | | ƒ | ƒ } t i	 t
 | | | | ƒ | ƒ } | d j  o
 d } n | d j  o
 d } n | | j o
 | } n | | j o
 | } n | | j p | | j o d  Sn | i | | | | ƒ \ } } | oR |  i i | | | |
 | | | | | | | i | i | i | i | f f ƒ n^ |  i | | | | | | f ƒ }  t i i i | |  | | | i | i | i | i | t ƒ
 d  Sn | i oÀ| i p
 | i o0 t |  | | i t ƒ | | | | | ƒ d  Sn | i | i } | i | i } | oŽ | \ }  }! }" }# t
 |  | ƒ }  t
 |! | ƒ }! t |" | | ƒ }" t |# | | ƒ }# |  |" j p |! |# j o d  Sn |  |! |" |# f } q™| d j o | }$ d } n d }$ | d j o | }% d } n d }% |  i ƒ  \ } } t | |$ | | ƒ } t | |% | | ƒ } | d j  p | d j  o d  Sn |  i |$ |% | | f ƒ }  n | i o2 | i t ƒ }& t |  | |& | | | | | ƒ n xš | i D] \ }& }' }( }) }* | i |' |( ƒ \ }' }( | i o | | i }+ | i | }, n | }+ | }, t |  | |& | |' | |( | | i |+ |, ƒ qßWd  S(   Ngú~j¼t“h?g        i    (   g        g        (    R   t   IDENTITYR   Rƒ   R†   RI   R^   t   floorR   R_   R]   RP   R   RA   RC   RB   RD   R!   R   R5   R‹   R$   R    R‘   t   pygame_surfaceR"   R#   R   R   R   R’   RŽ   (-   R”   R•   R–   R—   R˜   RŽ   R   R’   Rc   Rd   Rš   R›   Rœ   R   Rž   RŸ   Rn   Ro   Rp   Rq   t   x2t   y2t   x3t   y3t   minxt   maxxt   minyt   maxyt   cxt   cyR"   R#   R§   R¨   R©   Rª   RG   RH   R«   R¬   R­   R   R®   t   child_forwardt   child_reverse(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyR‘   f  s®    

""""



 	#

(


#
 
c         C   s=   t  a t |  | | d d ƒ } | a  t  i d 7_ t a | S(   si   
    Renders `root` (a displayable) as the root of a screen with the given
    `width` and `height`.
    i    i   (   R    t   old_screen_renderR   R   R\   R0   (   t   rootR"   R#   R,   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt   render_screenû  s    
c         C   sÀ   t  i ƒ  |  | |  t  i | t  i f } t d } t | | t  |  | t ƒ | i | ƒ \ } } | d j o g  Sn | \ } } }	 }
 t	 i
 i ƒ  i | ƒ } t | d t  | | t ƒ | S(   sC   
    Draws the render produced by render_screen to the screen.
    i    N(   R    t	   is_opaqueR"   R#   t   clippersR“   R$   R‚   R   t   pygameR5   t   get_surfaceR!   (   t   xoffsett   yoffsetR`   R•   t   clippert   cliprectR   RG   RH   Rv   Rw   R”   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt   draw_screen  s    
 
c          C   sw   t  d j o d Sn t  i d 8_ t  t j o d Sn t  i ƒ  d a  x t D] }  |  i ƒ  qP Wt a t ƒ  a d S(   sI   
    Kills the old screen if it's different from the current screen.
    Ni   (   R¾   R   R   R    R   R   R   R   (   R	   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt   kill_old_screen'  s    	
 c      	   C   s,   t  i d d t  i t  i t d d |  ƒ d S(   sG   
    Adds a list of rectangular focus regions to the focuses list.
    i    N(   R    t   take_focusesR"   R#   R¯   (   t   focuses(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyRË   B  s    c         C   sY   t  i |  | ƒ } | d j o d Sn/ | \ } } t i i i | | d d d d ƒ Sd S(   sƒ   
    Returns a focus object corresponding to the uppermost displayable
    at point, or None if nothing focusable is at point.
    N(   R    t   focus_at_pointR   R   R5   R   t   Focus(   RG   RH   t   cfR'   t   arg(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyRÍ   K  s
    c         C   s+   x$ t  D] } | i i t |  ƒ ƒ q Wd S(   sA   
    Called to indicate that the given surface has changed. 
    N(   RÂ   RT   R&   RY   (   t   surfR	   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt   mutated_surfaceY  s     i   i   i   Rƒ   c        	   B   sã   e  Z d d d d  „ Z d „  Z e e d „ Z e e d „ Z d „  Z e d „ Z	 e
 d „ Z e
 d „ Z d „  Z d	 „  Z d d
 d
 d d d d d d „ Z d „  Z d „  Z d d „ Z d „  Z d „  Z d „  Z d „  Z RS(   c         C   sò   t  d 7a  | |  _ | |  _ | |  _ g  |  _ t ƒ  |  _ t ƒ  |  _ t ƒ  |  _ d |  _	 t
 |  _ d |  _ d |  _ d |  _ d |  _ g  |  _ g  |  _ g  |  _ t |  _ t |  _ | |  _ | |  _ |  i |  _ t |  _ d |  _ d |  _ d S(   sÉ   
        Creates a new render corresponding to the given widget with
        the specified width and height.

        If `layer_name` is given, then this render corresponds to a
        layer.
        i   i    g        N(   R   R"   R#   t
   layer_namet   childrenR   t   parentst   depends_on_sett   depends_on_usR   t   BLITt	   operationt   dissolveR   R   R’   RŽ   RÌ   t   pass_focusesR   R\   t   cache_killedt   deadR   t   opaqueR   R    t   surfacet   alpha_surface(   RE   R"   R#   R   RÓ   RÞ   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyRF   y  s2    

																			c         C   s4   |  i  o
 d } n d } d t |  ƒ | |  i f S(   NRÝ   t   lives   <Render %x %s of %r>(   RÝ   RY   R   (   RE   RÝ   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt   __repr__Ö  s    

c         C   s¤   | \ } } | |  j o t  d ƒ ‚ n t | ƒ } t | ƒ } |  i i | | | | | f ƒ t | t ƒ o# | i i |  ƒ | i d 7_ n t	 i
 | ƒ d S(   s÷   
        Blits `source` (a Render or Surface) to this Render, offset by
        xo and yo.

        If `focus` is true, then focuses are added from the child to the
        parent.

        This will only blit on integer pixel boundaries.
        s   Blitting to self.i   N(   R   R   RÔ   R   R   Rƒ   RÕ   R&   R   R   R%   (   RE   t   sourcet   .2R   R®   R—   R˜   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyR‰   à  s   c         C   s‡   | \ } } t  | ƒ } t  | ƒ } |  i i | | | | | f ƒ t | t ƒ o# | i i |  ƒ | i d 7_ n t i	 | ƒ d S(   sñ   
        Blits `source` (a Render or Surface) to this Render, offset by
        xo and yo.

        If `focus` is true, then focuses are added from the child to the
        parent.

        This blits at fractional pixel boundaries.
        i   N(
   R   RÔ   R   R   Rƒ   RÕ   R&   R   R   R%   (   RE   Rã   Rä   R   R®   R—   R˜   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt   subpixel_blitø  s   c         C   s   |  i  |  i f S(   s²   
        Returns the size of this Render, a mostly ficticious value
        that's taken from the inputs to the constructor. (As in, we
        don't clip to this size.)
        (   R"   R#   (   RE   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyR†     s    c   
      C   sã  | o |  i  d j	 o |  i  SqA n |  i d j	 o |  i Sn d } |  i ot |  i ƒ d j o|  i d \ } } } } } | i ƒ  \ } }	 | d j oÃ | d j o¶ | | |  i j o¢ |	 | |  i j oŽ t	 | t
 ƒ o | i | ƒ } n | d j p- | d j p  | |  i j p |	 |  i j o' | i | | |  i |  i f ƒ } qf| } qjn | d j oK |  i ƒ  t i i i |  i |  i f | ƒ } t | d |  d d t ƒ n | o | |  _  n
 | |  _ | S(   sø   
        Returns a pygame surface constructed from this Render. This
        may return a cached surface, if one already has been rendered
        (so you probably shouldn't change the output of this much).

        `alpha` is now ignored.
        i   i    N(   Rà   R   Rß   R   RX   RÔ   R†   R"   R#   R   Rƒ   R±   R!   RÁ   R   R5   t   pgrenderR“   R\   (
   RE   RŽ   R,   R«   RG   RH   R   R®   t   cwt   ch(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyR±     s.    	!B:'
$	c         C   sL   | \ } } } } t  | | ƒ } t | _ | i |  | | f d | ƒ| S(   s   
        Returns a subsurface of this render. If `focus` is true, then
        the focuses are copied from this render to the child.
        R   (   Rƒ   R$   R    R‰   (   RE   t   rectR   RG   RH   Rv   Rw   R,   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyR!   H  s
    	c         C   sŒ   | |  j o t  d ƒ ‚ n | |  i j o3 |  i i | ƒ | i i |  ƒ | i d 7_ n | o |  i i | ƒ n t i | ƒ d S(   sÏ   
        Used to indicate that this render depends on another
        render. Useful, for example, if we use pygame_surface to make
        a surface, and then blit that surface into another render.
        s   Render depends on itself.i   N(	   R   RÖ   R&   R×   R   RÛ   R   R   R%   (   RE   Rã   R   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt
   depends_onU  s    c      	   C   sÀ   |  i  o d Sn t |  _  x |  i D] } | i ƒ  q% Wx |  i D] } | i ƒ  qC Wxb |  i D]W } t | } x2 | i ƒ  D]$ \ } } | |  j o | | =q~ q~ W| p t | =qa qa Wd S(   sP   
        Removes this render and its transitive parents from the cache.
        N(   RÜ   R$   RÕ   R/   R×   R   R   t   items(   RE   R	   t   rot   cachet   kR1   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyR/   j  s$    
	
 
 
 
 c         C   s  |  i  o d Sn |  i d j o d Sn t |  _  t d 8a xt |  i D]i \ } } } } } t | t ƒ p qG n | i i |  ƒ | i d 8_ | i d j o | i	 ƒ  qG qG WxN |  i
 D]C } | i i |  ƒ | i d 8_ | i d j o | i	 ƒ  q¾ q¾ W|  i ƒ  d S(   s‰   
        Removes this Render from its children, and kills those children if
        doing so causes their refcount to fall to 0.
        Ni    i   (   RÝ   R   R$   R   RÔ   R   Rƒ   RÕ   R%   R   RÖ   R×   t   removeR/   (   RE   t   cR—   R˜   R   R®   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyR   ƒ  s*    
	

 
 i    c
   
   
   C   sZ   |	 d j	 o |	 |  j	 o |  i |	 ƒ n |  i i | | | | | | | | |	 f	 ƒ d S(   sŒ  
        This is called to indicate a region of the screen that can be
        focused.

        `d` - the displayable that is being focused.
        `arg` - an argument.

        The rest of the parameters are a rectangle giving the portion of
        this region corresponding to the focus. If they are all None, than
        this focus is assumed to be the singular full-screen focus.
        N(   R   Rê   RÌ   R   (
   RE   R'   RÐ   RG   RH   Rv   Rw   t   mxt   myt   mask(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt	   add_focusª  s    c	         C   s´  |  i  o | |  i  } n x|  i D]t\	 }	 }
 } } } } } } } | d j o2 | i t i i i |	 |
 d d d d ƒ ƒ q% n | i | | ƒ \ } } | i | | | | ƒ \ } } t	 | | ƒ | } t	 | | ƒ | } t
 | | ƒ | } t
 | | ƒ | } t
 | | ƒ } t
 | | ƒ } t	 | | ƒ } t	 | | ƒ } | | j p | | j o q% n | i t i i i |	 |
 | | | | | | ƒ ƒ q% W|  i oN t
 | | ƒ } t
 | | ƒ } t	 | | |  i ƒ } t	 | | |  i ƒ } n x‚ |  i D]w \ } } } } } | p t | t ƒ o qÿn | i | | ƒ \ } } | i | | | | | | | | | | ƒ qÿWx3 |  i D]( } | i | | | | | | | | ƒ q„Wd S(   s±  
        This adds to focuses Focus objects corresponding to the focuses
        added to this object and its children, transformed into screen
        coordinates.

        `cminx`, `cminy`, `cmaxx`, `cmaxy` - The clipping rectangle.
        `reverse` - The transform from render to screen coordinates.
        `x`, `y` - The offset of the upper-left corner of the render.
        `focuses` - The list of focuses to add to.
        N(   R’   RÌ   R   R   R   R5   R   RÎ   RI   R   R]   R    R"   R#   RÔ   R   Rƒ   RË   RÛ   (   RE   t   cminxt   cminyt   cmaxxt   cmaxyR’   RG   RH   RÌ   R'   RÐ   R—   R˜   Rv   Rw   Rñ   Rò   Ró   Rp   Rq   R²   R³   R¶   R¸   R·   R¹   R«   R   R®   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyRË   ¼  sD    

 !+ 7

 .
 c      
   C   sH  |  i  oF | d j  p- | |  i j p | d j  p | |  i j o d SqP n d } x|  i D]ú \	 } } } } } }	 }
 } } | d j o q` q` |
 d j	 od | |
 } | | } |  i o |  i i | | ƒ \ } } n | i | | ƒ o | | f } qZq` | | j o | | j  n o2 | | j o | |	 j  n o | | f } q` q` Wx¦ |  i D]› \ } } } } } | p t	 | t
 ƒ o qhn | | } | | } |  i o |  i i | | ƒ \ } } n | i | | ƒ } | d j	 o
 | } qhqhWx: |  i D]/ } | i | | ƒ } | d j	 o
 | } qqW| S(   sK   
        This returns the focus of this object at the given point.
        i    N(   R    R"   R#   R   RÌ   R   RI   t   is_pixel_opaqueRÔ   R   Rƒ   RÍ   RÛ   (   RE   RG   RH   R,   R'   RÐ   R—   R˜   Rv   Rw   Rñ   Rò   Ró   Rº   R»   R«   R   R®   RÏ   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyRÍ   ó  sD    
:
 !


D
 



 c         C   sY  g  } | d j  p- | d j  p  | |  i  j p | |  i j o | Sn | d j	 oA xX |  i D]/ } | i | |  i  |  i | f ƒ | d 7} q_ Wn |  i | j o
 d } n x¢ |  i D]— \ } } }	 }
 } | p t | t ƒ o qº n | | } | |	 } |  i	 o |  i	 i
 | | ƒ \ } } n | i | | | | ƒ } | i | ƒ qº W| S(   so   
        Returns the displayable at `x`, `y` on one of the layers in
        the set or list `layers`.
        i    i   N(   R"   R#   R   R   R   RÓ   RÔ   R   Rƒ   R   RI   t   main_displayables_at_pointt   extend(   RE   RG   RH   t   layerst   depthR,   R'   R«   R—   R˜   R   R®   Rº   R»   RÏ   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyRú   '  s*    :
 

 


c         C   s<  |  i  d j	 o |  i  Sn |  i o t |  _  t Sn t } g  } xá |  i D]Ö } | \ } } } } } | d j o¡ | d j o” | i ƒ  \ }	 }
 |	 | |  i j  p |
 | |  i j  oV t | t	 ƒ o! | i
 ƒ  o g  } t } qq| i ƒ  d p g  } t } qqn | i | ƒ qL W| |  _ | |  _  | S(   sz   
        Returns true if this displayable is opaque, or False otherwise.
        Also sets self.visible_children.
        i    i   N(   RÞ   R   R   R\   RÔ   R†   R"   R#   R   Rƒ   RÁ   R$   t	   get_masksR   R   (   RE   R,   t   vcR	   R«   R—   R˜   R   R®   Rç   Rè   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyRÁ   I  s0    
	
 (		c         C   s=  | d j  p- | d j  p  | |  i  j p | |  i j o t Sn xô |  i D]é \ } } } } } | | } | | }	 |  i o |  i i | |	 ƒ \ } }	 n t | t ƒ o | i | |	 ƒ o t	 Sq5qL | i
 ƒ  \ }
 } | |
 j p |	 | j o t Sn | i ƒ  d p | i | |	 f ƒ d o t	 SqL qL Wt S(   sE   
        Determine if the pixel at x and y is opaque or not.
        i    i   (   R"   R#   R\   RÔ   R   RI   R   Rƒ   Rù   R$   R†   Rþ   t   get_at(   RE   RG   RH   R«   R—   R˜   R   R®   Rº   R»   Rç   Rè   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyRù   q  s"    :
 


,c         C   sq   t  i i | ƒ } t  i i i | |  i |  i ƒ } t | |  i |  i d d ƒ } |  i	 | d d t
 d t
 ƒd S(   s9   
        Fills this Render with the given color.
        i    R   R®   N(   i    i    (   R   t   easyt   colorR5   R„   t
   SolidImageR"   R#   R   R‰   R\   (   RE   R  t   solidRÑ   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt   fill  s    !c         C   sH   t  i i i |  i |  i f t ƒ } t | ƒ |  i | d ƒ t	 | ƒ S(   sD   
        Returns a canvas object that draws to this Render.
        i    (   i    i    (
   R   R5   Ræ   Rß   R"   R#   R$   RÒ   R‰   t   Canvas(   RE   RÑ   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyt   canvas—  s    $
N(   RL   RM   R   RF   Râ   R$   R‰   Rå   R†   R±   R\   R!   Rê   R/   R   Rô   RË   RÍ   Rú   RÁ   Rù   R  R  (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyRƒ   w  s$   ]	
		2		'!	7	4"	(		
R  c           B   s}   e  Z d  „  Z d d „ Z d d „ Z d d „ Z d d „ Z d d „ Z d d „ Z d d	 „ Z	 d d
 „ Z
 d d „ Z RS(   c         C   s   | |  _  d  S(   N(   RÑ   (   RE   RÑ   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyRF   ¦  s    i    c         C   sH   z6 t  i ƒ  t i i |  i t i i | ƒ | | ƒ Wd  t  i	 ƒ  Xd  S(   N(
   R‡   Rˆ   RÃ   R“   Ré   RÑ   R   R  R  RŠ   (   RE   R  Ré   R"   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyRé   ©  s    
c         C   sH   z6 t  i ƒ  t i i |  i t i i | ƒ | | ƒ Wd  t  i	 ƒ  Xd  S(   N(
   R‡   Rˆ   RÃ   R“   t   polygonRÑ   R   R  R  RŠ   (   RE   R  t	   pointlistR"   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyR  ´  s    
c      	   C   sK   z9 t  i ƒ  t i i |  i t i i | ƒ | | | ƒ Wd  t  i	 ƒ  Xd  S(   N(
   R‡   Rˆ   RÃ   R“   t   circleRÑ   R   R  R  RŠ   (   RE   R  t   post   radiusR"   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyR
  ¾  s    
c         C   sH   z6 t  i ƒ  t i i |  i t i i | ƒ | | ƒ Wd  t  i	 ƒ  Xd  S(   N(
   R‡   Rˆ   RÃ   R“   t   ellipseRÑ   R   R  R  RŠ   (   RE   R  Ré   R"   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyR  Ë  s    
i   c      
   C   sN   z< t  i ƒ  t i i |  i t i i | ƒ | | | | ƒ Wd  t  i	 ƒ  Xd  S(   N(
   R‡   Rˆ   RÃ   R“   t   arcRÑ   R   R  R  RŠ   (   RE   R  Ré   t   start_anglet
   stop_angleR"   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyR  Ö  s    
c      	   C   sK   z9 t  i ƒ  t i i |  i t i i | ƒ | | | ƒ Wd  t  i	 ƒ  Xd  S(   N(
   R‡   Rˆ   RÃ   R“   t   lineRÑ   R   R  R  RŠ   (   RE   R  t	   start_post   end_posR"   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyR  ã  s    
c      	   C   sK   z9 t  i ƒ  t i i |  i t i i | ƒ | | | ƒ Wd  t  i	 ƒ  Xd  S(   N(
   R‡   Rˆ   RÃ   R“   t   linesRÑ   R   R  R  RŠ   (   RE   R  t   closedR	  R"   (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyR  î  s    
c      	   C   sK   z9 t  i ƒ  t i i |  i t i i | ƒ | | | ƒ Wd  t  i	 ƒ  Xd  S(   N(
   R‡   Rˆ   RÃ   R“   t   aalineRÑ   R   R  R  RŠ   (   RE   R  t   startpost   endpost   blend(    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyR  ù  s    
c      	   C   sK   z9 t  i ƒ  t i i |  i t i i | ƒ | | | ƒ Wd  t  i	 ƒ  Xd  S(   N(
   R‡   Rˆ   RÃ   R“   t   aalinesRÑ   R   R  R  RŠ   (   RE   R  R  R	  R  (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyR    s    
(   RL   RM   RF   Ré   R  R
  R  R  R  R  R  R  (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pyR  ¤  s   	
(/   t   collectionsRÃ   t	   threadingR^   R   t	   ConditionR‡   R   t   defaultdictt   dictR   R3   R   R    R¾   R   R   R   R
   R   R   R\   R0   R2   R=   R>   R?   t   objectR@   R¯   RO   RÂ   R“   R‘   RÀ   RÉ   RÊ   RË   RÍ   RÒ   RØ   t   OPAQUE_DISSOLVEt   ALPHA_DISSOLVEt   OPAQUE_IMAGE_DISSOLVEt   ALPHA_IMAGE_DISSOLVERƒ   R  (    (    (    s<   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\display\render.pys   <module>   sR   					=		.		Æ	’	•							ÿ ÿ /