B
    0\                 @   sV   d dl mZ d dlmZ yddlZW n  ek
rD   ddlZeZY nX dd ZdZ	dS )   )Image)i32le    Nc          	   C   s:   dd }t | dr|| S t| d
}||S Q R X dS )a  
    Load texture from a Quake2 WAL texture file.

    By default, a Quake2 standard palette is attached to the texture.
    To override the palette, use the <b>putpalette</b> method.

    :param filename: WAL file name, or an opened file handle.
    :returns: An image instance.
    c          	   S   s   |  d}t|dt|df}t|d}| | t| td||  |d |d  }|t d|_d	|_	|d d 
d
dd |jd< |dd 
d
dd }|r||jd< |S )Nd       $   (   Pr   r   ZWALzQuake2 Texture    name8   X   	next_name)readi32seekr   Z_decompression_bomb_checkZ	frombytesZ
putpalettequake2paletteformatZformat_descriptionsplitinfo)fpheadersizeoffsetZimr    r   /lib/python3.7/site-packages/PIL/WalImageFile.pyimopen/   s    



 

zopen.<locals>.imopenr   rbN)hasattrbuiltinsopen)filenamer   r   r   r   r   r    "   s
    
r    s   """&&&))),,,///222555777:::<<<$" 


##&""%" #!"  -( )$'"%8.1),%& <07,3(-$("
10.,*'
%!


)#'!& %#! 

&# 

3"5)&7/-95479:379046+14'.1"+/(,%* &%"
 
,!!*)'&$"!


.0)-.'+,&**$()#''!&&$$""
0-,*(&$!



()8&'6%&4$$1""/ !-*'%!
/2)-0&+.$),!'*%(#&!%"

?<9 5#1#-#)?????9??1??*?? ???<?9?5?2?-=*;&9!742/-*'#=???<.*6' 0!)<9772/1,(+&!0" )
 r   Z_binaryr   r   r   ImportErrorZ__builtin__r    r   r   r   r   r   <module>   s   
.