ó
j$ËZc           @   sô   d  d l  Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l m	 Z	 m
 Z
 m Z m Z m Z m Z e j ƒ  Z d e f d „  ƒ  YZ e ƒ  g Z d „  Z d „  Z d „  Z d „  Z d	 „  Z d
 „  Z d e f d „  ƒ  YZ d S(   iÿÿÿÿN(   t	   blit_lockt   IDENTITYt   BLITt   DISSOLVEt   IMAGEDISSOLVEt	   PIXELLATEt   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_blitst   sett   forcedt
   old_forcedt   mutated(   t   self(    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   __init__)   s
    		c   '      C   sF  |  j  } |  j } |  j } |  j } |  j } | |  _  g  |  _ | |  _ t ƒ  |  _ t ƒ  |  _ t j j } t j j	 } | | }	 d d | | f }
 | r§ |
 |
 g f S| | B} |
 | k rÊ |
 |
 g f Sd } d } t | ƒ } xØ t
 r¼| t | ƒ k s| t | ƒ k rPn  | | } | | } | | k rtt | d ƒ | k r]| j | d  ƒ n  | d 7} | d 7} qå | | k rž| j | d  ƒ | d 7} qå | j | d  ƒ | d 7} qå W| j d „  | | Dƒ ƒ | j d „  | | Dƒ ƒ | sd g  f Sg  } x| D]ú \ } } } } \ } } } } | d 7} | d 7} | | k  rZ| } n  | | k  ro| } n  | | k r„| } n  | | k r™| } n  | | } | | } | d k s| d k rËqn  | | } | |	 k rî|
 |
 g f S| j | | | | | f ƒ qW| j ƒ  g  } d } x¾| rä| j ƒ  \ } } } } } t } | | |	 k rƒd d | | f d d | | f g f Sd }  x|  t | ƒ k  r˜| |  \ }! }" }# }$ }% | |" k oÎ| k n sï| |$ k oê| k n r‹| |# k o| k n s'| |% k o"| k n r‹t
 } t | |" ƒ } t | |$ ƒ } t | |# ƒ } t | |% ƒ } | | | | } | j |  ƒ qŒ|  d 7}  qŒW| r¾| j | | | | | f ƒ q'| j | | | | f ƒ | | 7} q'W| sõd g  f S| j ƒ  \ } } } } t | ƒ } t | ƒ } t t j | ƒ ƒ } t t j | ƒ ƒ } | | | | | | f g }& x¹ | D]± \ }" }# }$ }% t |" ƒ }" t |# ƒ }# t t j |$ ƒ ƒ }$ t t j |% ƒ ƒ }% t | |" ƒ } t | |# ƒ } t | |$ ƒ } t | |% ƒ } |& j |" |# |$ |" |% |# f ƒ qs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   |  ] } | d   Vq d S(   i   N(    (   t   .0t   i(    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pys	   <genexpr>|   s    c         s   s   |  ] } | d   Vq d S(   i   N(    (   R   R   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pys	   <genexpr>}   s    N(   R   R   R   R
   R   R	   t   renpyt   configt   screen_widtht   screen_heightt   Truet   lent   idt   addt   updatet   Nonet   appendt   sortt   popt   Falset   mint   maxt   intt   matht   ceil('   R   t   full_redrawt   bl0t   bl1R   R
   R   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<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   compute8   sÒ    									

	$



(

				


 
	%88
%(   t   __name__t
   __module__t   __doc__R   RF   (    (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyR   #   s   	c         C   se   | r, t  j |  d | d f t  j ƒ } n  t  j |  d | d f d ƒ } | j d d |  | f ƒ S(   sd   
    Creates a surface that shares a pixel format with the screen. The created
    surface will
    i   i    i   (   t   pygamet   Surfacet   SRCALPHAt
   subsurface(   R:   R;   t   alphat   rv(    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   surfaceî   s    & c         C   s>   |  j  ƒ  \ } } t | | t ƒ } t j j j |  | ƒ | S(   N(   t   get_sizeRP   R   R   t   displayt   acceleratort
   nogil_copy(   t   surfR:   R;   RO   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   copy_surfaceü   s    c      	   C   s„  | j  ƒ  \ } } t | |  j | ƒ } t | |  j | ƒ } | d k sV | d k rZ d S|  j t k rL|  j d d j t ƒ } |  j d d j t ƒ }	 |  j	 r» t
 | | t ƒ }
 n | j d d | | f ƒ }
 t j j j | j | | | | f ƒ |	 j | | | | f ƒ |
 t |  j d ƒ ƒ |  j	 r€| j |
 d ƒ q€n4|  j t k rà|  j d d j t ƒ } |  j d d j t ƒ } |  j d d j t ƒ }	 |  j	 rÇt
 | | t ƒ }
 n | j d d | | f ƒ }
 |  j } d d } x/ t d | ƒ D] } | t d | | ƒ 7} qW| d d 7} t |  j d | ƒ } | | | d !} t j j j | j | | | | f ƒ |	 j | | | | f ƒ |
 | j | | | | f ƒ | ƒ |  j	 r€| j |
 d ƒ q€n  |  j t k rm|  j d d j | j ƒ  d	 ƒ } |  j } t j j j | j | | | | f ƒ | j d d | | f ƒ | | | | ƒ n t d
 |  j ƒ ‚ d S(   sØ   
    This handles the special drawing operations, such as dissolve and
    image dissolve. `x` and `y` are the offsets of the thing to be drawn
    relative to the destination rectangle, and are always negative.
    i    Ni   iÿ   i   t    i   s   ÿi   s   Unknown operation: %d(   i    i    (   i    i    (   RQ   R   t   widtht   heightt	   operationR   t   childrent   render_to_textureR   t   operation_alphaRP   RM   R   RR   t   modulet   blendR!   t   operation_completet   blitR   t   operation_parametert   xranget   chrt
   imageblendR   t	   get_maskst	   pixellatet	   Exception(   t   whatt   destt   xt   yt   dwt   dhR:   R;   t   bottomt   topt   targett   imaget   ramplent   rampR   t   stepRU   t   px(    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   draw_special  s`    				
	$	c   "   
   C   s<  t  | t j j j ƒ s6t  | t ƒ rÎ t  | t ƒ rÎ | rQ t j | | ƒ } n  | r™ | j ƒ  \ } } |  j	 j
 | | | | | | | | d f ƒ q2z$ t j ƒ  |  j | | | f ƒ Wd t j ƒ  Xnd | r| j ƒ  \ } } |  j	 j
 | | | | | | | | d f ƒ n t j j j | |  | | ƒ d S| j r`| j | | d ƒ t j j _ n  | j t k rät | ƒ } t | ƒ } | r¶| \ } }	 }
 } |
 | } | |	 } n |  j ƒ  \ } } | d k rãd } | } n | } d } | d k r
d } | } n | } d } | | k s.| | k r2d St | | | j | ƒ } t | | | j | ƒ } | d k s~| d k r‚d S| r²|  j j | | | | | | | f ƒ n. |  j | | | | f ƒ } t | | | | ƒ d S| j rZ| r˜| \ } } } } t  | | ƒ } t  | | ƒ } t | | | j ƒ } t | | | j ƒ } | | k sg| | k rkd S| | | | f } |  j j | | f ƒ d S| d k r³| } d } n d } | d k rÔ| } d } n d } |  j ƒ  \ } } t | | | j | ƒ } t | | | j | ƒ } | d k  s8| d k  r<d S|  j | | | | f ƒ }  n  | j! d k s–| j" d k s–| j# d k	 rô| j# t$ k	 rôxW | j% D]L \ } } } }  }! t& |  | | | | | | | j! | j" | j# | j' ƒ q Wd SxA | j% 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   g      ð?()   t
   isinstanceR   RR   t   rendert   RenderR!   t	   rle_cachet   getRQ   R   R   R   R    t   acquireRa   t   releaseR^   t   subpixelt
   text_inputt   screen_rectt	   interfacet	   text_rectRZ   R   R   RX   RY   R
   R   RM   Rw   t   clippingR    RN   t   overt   forwardR   t   visible_childrent   draw_transformedt   reverset   draw("   Rj   t   clipRi   t   xot   yot   screenR:   R;   t   dx0t   dy0t   dx1t   dy1Rm   Rn   t   newxt   subxt   newyt   subyt   subwt   subht   newdestt   cx0t   cy0t   cx1t   cy1Rk   Rl   RX   RY   t   childt   cxot   cyot   _focust   _main(    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyRŠ   V  s     0
0	!
		*			<!c   -      C   s´  | d k r d  S| d  k r+ t } t } n  t | t j j j ƒ sÒ| j ƒ  \ } }	 | r„ | \ }
 } } } | |
 } | | } n |  j ƒ  \ } } d \ } } | j | d ƒ \ } } | j | |	 ƒ \ } } | j d |	 ƒ \ } } t	 j
 t | | | | ƒ | ƒ } t	 j t | | | | ƒ | ƒ } t	 j
 t | | | | ƒ | ƒ } t	 j t | | | | ƒ | ƒ } | d k  r‡d } n  | d k  rœd } n  | | k r±| } n  | | k rÆ| } n  | | k sö| | k sö| d k  sö| d k  rúd  S| j | | | | ƒ \ } } | rq|  j j | | | |
 | | | | | | | j | j | j | j | f f ƒ n] |  j | | | | | | f ƒ }  t j j j | |  | | | j | j | j | j | t ƒ
 d  S| j rü| j | | | ƒ t j j _ n  | j rÄ| j s| j rCt |  | | j t ƒ | | | | | ƒ d  S| j | j } | j | j } | r| \ }  }! }" }# t |  | ƒ }  t |! | ƒ }! t |" | | ƒ }" t |# | | ƒ }# |  |" k s×|! |# k rÛd  S|  |! |" |# f } |  j  j! | | f ƒ d  S| d k r#| }$ d } n d }$ | d k rD| }% d } n d }% |  j ƒ  \ } } t | |$ | | ƒ } t | |% | | ƒ } | d k  s¢| d k  r¦d  S|  j |$ |% | | f ƒ }  n  | j" sÜ| j# t$ k r| j t ƒ }& t |  | |& | | | | | ƒ d  SxŸ | j% D]” \ }& }' }( }) }* | j |' |( ƒ \ }' }( | j& rk| | j& }+ | j' | }, n | }+ | }, t |  | |& | |' | |( | | j( | j) |+ |, ƒ qWd  S(   Ngú~j¼t“h?g        i    (   g        g        (*   R   R   Rx   R   RR   Ry   Rz   RQ   t	   transformR"   t   floorR   R#   R    R   R   t   xdxt   ydxt   xdyt   ydyRM   R^   R   R€   R   R‚   Rƒ   R„   Rˆ   t   pygame_surfaceRX   RY   R
   R   t	   draw_funcRZ   R   R‡   R†   R‰   RN   R…   (-   Rj   R‹   Ri   RŒ   R   RN   R†   R‰   R'   R(   R   R   R‘   R’   Rm   Rn   R2   R3   R4   R5   t   x2t   y2t   x3t   y3t   minxt   maxxt   minyt   maxyt   cxt   cyRX   RY   Rš   R›   Rœ   R   Rk   Rl   Rž   RŸ   R    R¡   R¢   t   child_forwardt   child_reverse(    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyRˆ   ð  s¶    	
""""				0 	#
	!	(			c         C   s¿   d } } |  j  ƒ  | | | |  j | |  j f } t d } t | | |  | | t ƒ | j | ƒ \ } } | d k r| g  S| \ }	 }
 } } | j j	 | ƒ } t | d |  |	 |
 t ƒ | S(   sC   
    Draws the render produced by render_screen to the screen.
    i    N(
   t	   is_opaqueRX   RY   t   clippersRŠ   R   RF   R   t   windowRM   (   t   screen_renderR$   t   swdrawt   yoffsett   xoffsetR‹   t   clippert   cliprectRE   Rk   Rl   t   _wt   _hRj   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   do_draw_screen„  s    

 
t   SWDrawc           B   sò   e  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 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z e d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s@   
    This uses the software renderer to draw to the screen.
    c         C   s   d  |  _ |  j ƒ  d  S(   N(   R   t   display_infot   reset(   R   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyR   ¤  s    	c         C   sá   t  |  _ d |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _	 i d d 6t  d 6t  d 6|  _
 t j j ƒ  t j j j ƒ  |  j d  k r§ t j j ƒ  |  _ n  d |  _ d t j k |  _ d  |  _ d  |  _ t  |  _ d  S(   Ni    R'   t   renderert	   resizablet   additiveg      ð?t   RENPY_SCALE_FAST(   R   t   suppressed_blitt
   next_frameR   t   mouse_locationt   mouse_backingt   mouse_backing_post
   mouse_infot   mouse_old_visiblet   fullscreen_surfacet   infoRJ   RR   t   initR   R‚   t	   post_initRÄ   t   get_infot   scale_factort   ost   environt
   scale_fastRŽ   R¹   t   showing_video(   R   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyRÅ   ©  s$    											c         C   sà  t  j j j ƒ  |  j ƒ  | \ } } |  j j } |  j j } | s[ | d 8} | d 8} n  t d | | d | | d ƒ } d t	 j
 k r¢ t t	 j
 d ƒ } n  | |  _ | r½ t j }	 n d }	 t | | ƒ }
 t | | ƒ } t j j |
 | f |	 d ƒ |  _ | d k r(t | | t ƒ |  _ n |  j |  _ t  j j j ƒ  d |  _ t  j j j |  j d d |  j ƒ |  _ t  j j j d |  j d d d |  j ƒ |  _ t |  _ |  j |  _ d  |  _ d  |  _  d  |  _! d  |  _" t S(   Nif   g      ð?t   RENPY_SCALE_FACTORi    i    (#   R   RR   R‚   t   kill_textures_and_surfacesRÅ   RÄ   t	   current_wt	   current_hR   R×   RØ   t   floatRÖ   RJ   t
   FULLSCREENR!   t   set_modeRŽ   RP   R   R¹   t   pgrendert   set_rgba_maskst   draw_per_virtRy   t   Matrix2Dt   virt_to_drawt   draw_to_virtR$   RÑ   R   RÌ   RÍ   RÎ   RÏ   (   R   t   virtual_sizet   physical_sizeR*   RX   RY   R   R   RÖ   t   fsflagt   scaled_widtht   scaled_height(    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyRá   Ö  s@    

"	!	'/					c         C   sÅ   | |  _  | |  _ | \ } } } | \ } } | j ƒ  \ } }	 | | }
 | | } |
 | f |  _ t | |	 t ƒ |  _ |  j j |  j d |
 | | |	 f ƒ |  j	 j | |
 | f ƒ |
 | | |	 f S(   s+   
        Actually shows the mouse.
        i    (   i    i    (
   RÌ   RÏ   RQ   RÎ   RP   R   RÍ   Ra   R¹   RŽ   (   R   t   posRÒ   t   mxot   myot   text   mxt   myt   mwt   mht   bxt   by(    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt
   show_mouse  s    		

%c         C   sT   |  j  j ƒ  } |  j j |  j  |  j ƒ |  j | } d |  _  d |  _ d |  _ | S(   s+   
        Actually hides the mouse.
        N(   RÍ   RQ   RŽ   Ra   RÎ   R   RÌ   (   R   t   sizeRO   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt
   hide_mouse-  s    			c   	      C   s  t  j j j ƒ  \ } } } } |  j | k rI t j j | ƒ | |  _ n  |  j rV g  S| se d } n  | | | f } t j j
 ƒ  } | |  j k r« | r« | |  j k r« g  Sg  } |  j rÐ | j |  j ƒ  ƒ n  | r| rt  j j j r| j |  j | | ƒ ƒ n  | S(   sÚ   
        This draws the mouse to the screen, if necessary. It uses the
        buffer to minimize the amount of the screen that needs to be
        drawn, and only redraws if the mouse has actually been moved.
        N(   R   t   gameR‚   t   get_mouse_infoRÐ   RJ   t   mouset   set_visibleRÊ   R   t   get_posRÌ   RÏ   R   Rù   t   mouse_focusedR÷   (	   R   R÷   t   hardwareRk   Rl   Rð   RÒ   Rí   RE   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt
   draw_mouse>  s$    		$	c         C   s$   | |  j  :} | |  j  :} | | f S(   N(   RÖ   (   R   Rk   Rl   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   translate_pointc  s    c         C   s$   | |  j  9} | |  j  9} | | f S(   N(   RÖ   (   R   Rk   Rl   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   untranslate_pointh  s    c         C   s,   |  j  t ƒ } | r( t j j | ƒ n  d S(   s?   
        Draws the mouse, and then updates the screen.
        N(   R  R   RJ   RR   R   (   R   RE   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   update_mousem  s    c         C   sE   t  | d t j j ƒ  ƒ \ } } | |  j :} | |  j :} | | f S(   NRí   (   t   getattrRJ   Rü   Rþ   RÖ   (   R   t   evRk   Rl   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   mouse_eventw  s    !c         C   s9   t  j j ƒ  \ } } | |  j :} | |  j :} | | f S(   N(   RJ   Rü   Rþ   RÖ   (   R   Rk   Rl   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   get_mouse_pos  s    c         C   s0   | |  j  9} | |  j  9} t j j | | g ƒ S(   N(   RÖ   RJ   Rü   t   set_pos(   R   Rk   Rl   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   set_mouse_pos‡  s    c         C   s   |  j  S(   sC   
        Returns a pygame surface containing a screenshot.
        (   R¹   (   R   t   surftreet   fullscreen_video(    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt
   screenshotŽ  s    c         C   s   | s
 t  St j j } | d k r& t S|  j } t j j	 ƒ  } d | } | | | k ra | } n  | | k  rx | rx t  S| | } | |  _ t S(   sN   
        Uses the framerate to determine if we can and should redraw.
        g     @@N(
   R   R   R   t	   framerateR   R   RË   RJ   t   timet	   get_ticks(   R   t   needs_redrawt
   first_passR  RË   t   nowt	   frametime(    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   should_redraw•  s    	
	
	c         C   s™  | r| |  j  s" |  j j d ƒ n  |  j j ƒ  \ } } t j j j d | | ƒ } | d k	 rg | } n  t	 |  _
 t	 |  _  n	 t |  _  g  } | j |  j t ƒ ƒ t | |  j
 |  ƒ } | rÌ | j | ƒ n  t |  _
 |  j |  j k r| j |  j t	 ƒ ƒ t j j | ƒ ns |  j rAt j j |  j |  j j ƒ  |  j ƒ n( t j j j |  j |  j j ƒ  |  j ƒ |  j t	 ƒ t j j ƒ  | r•t	 |  _
 n  d S(   s#   
        Draws the screen.
        i    iÿ   t   movieN(   i    i    i    iÿ   (   RÚ   R¹   t   fillRQ   R   RR   t   videot   render_movieR   R   R$   R   t   extendR  RÂ   RŽ   RJ   R   RÙ   R£   t   scalet   smoothscalet   flip(   R   R  R  R:   R;   t   frameRE   t   damage(    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   draw_screen¹  s4    						((c         C   s5   t  | j | j | ƒ } t | d  | d d t ƒ | S(   Ni    (   RP   RX   RY   RŠ   R   R   (   R   Ry   RN   RO   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyR\   ì  s    c         C   s›  | j  t k rW |  j | j d d | | ƒ } |  j | j d d | | ƒ } | | S| d k  s | d k  s | | j k s | | j k r‘ d Sx| j D]ø \ } } } }	 }
 | | } | | } | j rë | j j | | ƒ \ } } n  t | t	 j
 j j ƒ r|  j | | | ƒ r“t Sq› t | ƒ } t | ƒ } | j ƒ  \ } } | | k sa| | k ret S| j ƒ  d s| j | | f ƒ d r› t Sq› Wt S(   Ni    i   i   (   RZ   R   t   is_pixel_opaqueR‡   RX   RY   R†   R£   Rx   R   RR   Ry   Rz   R   R!   RQ   R   Rf   t   get_at(   R   Ri   Rk   Rl   t   a0t   a2Rž   RŒ   R   R¡   R¢   R³   R´   t   cwt   ch(    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyR!  ó  s,      6

	*c         C   sA   x$ t  D] } | j j t | ƒ ƒ q W| t k r= t | =n  d S(   sH   
        Called to indicate that the given surface has changed.
        N(   R¸   R   R   R   R{   (   R   RU   R   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   mutated_surface  s    c         C   sW   | t  k r t  | St | ƒ } | s< | j d t j ƒ n  |  j | ƒ | t  | <| S(   sÀ   
        Creates a texture from the surface. In the software implementation,
        the only difference between a texture and a surface is that a texture
        is in the RLE cache.
        iÿ   (   R{   RV   t	   set_alphaRJ   t   RLEACCELR'  (   R   RU   t	   transientt   rle_surf(    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   load_texture&  s    
c         C   s`   t  | d | d t ƒ } | j | ƒ |  j | ƒ | j d d | | f ƒ } |  j | ƒ | S(   sC   
        Creates a texture filled to the edges with color.
        i   i   (   RP   R   R  R'  RM   (   R   R:   R;   t   colorRU   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   solid_texture:  s    c         C   s   t  j ƒ  d S(   s"   
        Frees up memory.
        N(   R{   t   clear(   R   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   free_memoryH  s    c         C   s   t  j j j ƒ  d S(   s.   
        Called when we're restarted.
        N(   R   RR   Ry   R0  (   R   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   deinitO  s    c         C   s   t  j j ƒ  d S(   s0   
        Shuts down the drawing system.
        N(   RJ   RR   t   quit(   R   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyR2  X  s    c         C   s   t  j d ƒ d S(   s@   
        Wait a little bit so the CPU doesn't speed up.
        g-Cëâ6?N(   R  t   sleep(   R   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   event_peek_sleepa  s    c         C   s   t  j j t  j j f S(   sE   
        Return the physical width and height of the screen.
        (   R   R   R   R   (   R   (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   get_physical_sizeh  s    (   RG   RH   RI   R   RÅ   Rá   R÷   Rù   R  R  R  R  R  R  R
  R  R  R   R\   R!  R'  R   R,  R.  R0  R1  R2  R4  R5  (    (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyRÃ   Ÿ  s4   		-	>			%			
					$	3		(								(   t   renpy.displayR   t   pygame_sdl2RJ   R"   t   weakrefR  R×   t   renpy.display.renderR    R   R   R   R   R   t   WeakKeyDictionaryR{   t   objectR   R¸   RP   RV   Rw   RŠ   Rˆ   RÂ   RÃ   (    (    (    s<   E:\Version 1-0-7\Games\DDLC-1.1.1-pc\renpy\display\swdraw.pyt   <module>   s    .È			R	š	”	