o
    OZŽhð	  ã                   @   sb   d Z ddlZddlZddlmZ ddlZej ej 	e
¡¡d Zdd„ Zedkr/eƒ  e ¡  dS )a'   pygame.examples.liquid

This example demonstrates a simplish water effect of an
image. It attempts to create a hardware display surface that
can use pageflipping for faster updates. Note that the colormap
from the loaded GIF image is copied to the colormap for the
display surface.

This is based on the demo named F2KWarp by Brad Graham of Freedom2000
done in BlitzBasic. I was just translating the BlitzBasic code to
pygame to compare the results. I didn't bother porting the text and
sound stuff, that's an easy enough challenge for the reader :]
é    N)Úsinc               
   C   sH  t  ¡  t j dt jt jB ¡} tj t	dd¡}t j
 |¡}t j |¡}t j |¡}|  ¡ dkr7|  | ¡ ¡ n| ¡ }d}tdddƒ}tdd	dƒ}t jt jt jf}	 t j ¡ D ]
}|j|v ra d S qW|d }|D ]0}|t||d  ƒd  d }	|D ]}
|
t||
d  ƒd  d }|  |||
f|	|ddf¡ qzqht j ¡  t d¡ qR)N)é€  éà  Údataz
liquid.bmpé   g        r   r   é   r   Tg{®Gáz”?g{®Gáz„?é   )ÚpgÚinitÚdisplayÚset_modeZ	HWSURFACEZ	DOUBLEBUFÚosÚpathÚjoinÚmain_dirÚimageÚloadZ	transformZscale2xZget_bitsizeZset_paletteZget_paletteÚconvertÚrangeZQUITZKEYDOWNZMOUSEBUTTONDOWNÚeventÚgetÚtyper   ZblitÚflipÚtimeÚsleep)ÚscreenZ	imagenameZbitmapZanimZxblocksZyblocksZ
stopeventsÚeÚxZxposÚyZypos© r   úE/var/www/auris/lib/python3.10/site-packages/pygame/examples/liquid.pyÚmain   s8   
ÿþ

ór!   Ú__main__)Ú__doc__Zpygamer	   r   Úmathr   r   r   ÚsplitÚabspathÚ__file__r   r!   Ú__name__Úquitr   r   r   r    Ú<module>   s   (