Commits

Anonymous committed a1b0837

Added display.set_mode() resolution enhancement as posted by Lorenz Quack.

  • Participants
  • Parent commits 4a7513c

Comments (0)

Files changed (11)

 #
 #
 
+Mar 9, 2008
+    pygame.display.set_mode() will now respect the screen resolution settings
+      for the width or height set to 0 as supported by SDL >= 1.2.10. Thanks
+      Lorenz Quack!
+
 Mar 5, 2008
     [BUG] Stopped releasing GIL on png, and jpeg saving functions because
         they do not seem to be thread safe.

docs/ref/display.html

 <a name="pygame.display.set_mode">
 <big><b>pygame.display.set_mode</big></b><br><ul>
   <i>initialize a window or screen for display</i><br>
-  <tt>pygame.display.set_mode(resolution, flags=0, depth=0): return Surface</tt><br>
+  <tt>pygame.display.set_mode(resolution=(0,0), flags=0, depth=0): return Surface</tt><br>
 <p>This function will create a display Surface. The arguments passed in are requests for a display type. The actual created display will be the best possible match supported by the system. </p>
 <p>The resolution argument is a pair of numbers representing the width and height. The flags argument is a collection of additional options. The depth argument represents the number of bits to use for color. </p>
 <p>The Surface that gets returned can be drawn to like a regular Surface but changes will eventually be seen on the monitor. </p>
+<p>If no resolution is passed or is set to (0, 0) and pygame uses <tt>SDL</tt> version <tt>1.2.10</tt> or above, the created Surface will have the same size as the current screen resolution. If only the width or height are set to 0, the Surface will have the same width or height as the screen resolution. Using a <tt>SDL</tt> version prior to <tt>1.2.10</tt> will raise an exception. </p>
 <p>It is usually best to not pass the depth argument. It will default to the best and fastest color depth for the system. If your game requires a specific color format you can control the depth with this argument. Pygame will emulate an unavailable color depth which can be slow. </p>
 <p>When requesting fullscreen display modes, sometimes an exact match for the requested resolution cannot be made. In these situations pygame will select the closest compatable match. The returned surface will still always match the requested resolution. </p>
 <p>The flags argument controls which type of display you want. There are several to choose from, and you can even combine multiple types using the bitwise or operator, (the pipe "|" character). If you pass 0 or no flags argument it will default to a software driven window. Here are the display flags you will want to choose from: </p>

docs/ref/index.html

 <li><a href="sndarray.html#pygame.sndarray">pygame.sndarray</a> - <font size=-1>pygame module for accessing sound sample data</font></li>
 <ul>
 <li><a href="sndarray.html#pygame.sndarray.array">pygame.sndarray.array</a> - <font size=-1>copy Sound samples into an array</font></li>
+<li><a href="sndarray.html#pygame.sndarray.get_arraytype">pygame.sndarray.get_arraytype</a> - <font size=-1>Gets the currently active array type.</font></li>
 <li><a href="sndarray.html#pygame.sndarray.get_arraytypes">pygame.sndarray.get_arraytypes</a> - <font size=-1>Gets the array system types currently supported.</font></li>
 <li><a href="sndarray.html#pygame.sndarray.make_sound">pygame.sndarray.make_sound</a> - <font size=-1>convert an array into a Sound object</font></li>
 <li><a href="sndarray.html#pygame.sndarray.samples">pygame.sndarray.samples</a> - <font size=-1>reference Sound samples into an array</font></li>
-<li><a href="sndarray.html#pygame.sndarray.use_array">pygame.sndarray.use_array</a> - <font size=-1>Sets the array system to be used for sound arrays</font></li>
+<li><a href="sndarray.html#pygame.sndarray.use_arraytype">pygame.sndarray.use_arraytype</a> - <font size=-1>Sets the array system to be used for sound arrays</font></li>
 </ul>
 <li><a href="sprite.html#pygame.sprite">pygame.sprite</a> - <font size=-1>pygame module with basic game object classes</font></li>
 <ul>
 <li><a href="surface.html#Surface.get_alpha">Surface.get_alpha</a> - <font size=-1>get the current Surface transparency value</font></li>
 <li><a href="surface.html#Surface.get_at">Surface.get_at</a> - <font size=-1>get the color value at a single pixel</font></li>
 <li><a href="surface.html#Surface.get_bitsize">Surface.get_bitsize</a> - <font size=-1>get the bit depth of the Surface pixel format</font></li>
+<li><a href="surface.html#Surface.get_bounding_rect">Surface.get_bounding_rect</a> - <font size=-1>find the smallest rect containing data</font></li>
 <li><a href="surface.html#Surface.get_buffer">Surface.get_buffer</a> - <font size=-1>acquires a buffer object for the pixels of the Surface.</font></li>
 <li><a href="surface.html#Surface.get_bytesize">Surface.get_bytesize</a> - <font size=-1>get the bytes used per Surface pixel</font></li>
 <li><a href="surface.html#Surface.get_clip">Surface.get_clip</a> - <font size=-1>get the current clipping are of the Surface</font></li>
 <li><a href="surfarray.html#pygame.surfarray.array_alpha">pygame.surfarray.array_alpha</a> - <font size=-1>Copy pixel alphas into a 2d array</font></li>
 <li><a href="surfarray.html#pygame.surfarray.array_colorkey">pygame.surfarray.array_colorkey</a> - <font size=-1>Copy the colorkey values into a 2d array</font></li>
 <li><a href="surfarray.html#pygame.surfarray.blit_array">pygame.surfarray.blit_array</a> - <font size=-1>Blit directly from a array values</font></li>
+<li><a href="surfarray.html#pygame.surfarray.get_arraytype">pygame.surfarray.get_arraytype</a> - <font size=-1>Gets the currently active array type.</font></li>
 <li><a href="surfarray.html#pygame.surfarray.get_arraytypes">pygame.surfarray.get_arraytypes</a> - <font size=-1>Gets the array system types currently supported.</font></li>
 <li><a href="surfarray.html#pygame.surfarray.make_surface">pygame.surfarray.make_surface</a> - <font size=-1>Copy an array to a new surface</font></li>
 <li><a href="surfarray.html#pygame.surfarray.map_array">pygame.surfarray.map_array</a> - <font size=-1>Map a 3d array into a 2d array</font></li>
 <li><a href="surfarray.html#pygame.surfarray.pixels2d">pygame.surfarray.pixels2d</a> - <font size=-1>Reference pixels into a 2d array</font></li>
 <li><a href="surfarray.html#pygame.surfarray.pixels3d">pygame.surfarray.pixels3d</a> - <font size=-1>Reference pixels into a 3d array</font></li>
 <li><a href="surfarray.html#pygame.surfarray.pixels_alpha">pygame.surfarray.pixels_alpha</a> - <font size=-1>Reference pixel alphas into a 2d array</font></li>
-<li><a href="surfarray.html#pygame.surfarray.use_array">pygame.surfarray.use_array</a> - <font size=-1>Sets the array system to be used for surface arrays</font></li>
+<li><a href="surfarray.html#pygame.surfarray.use_arraytype">pygame.surfarray.use_arraytype</a> - <font size=-1>Sets the array system to be used for surface arrays</font></li>
 </ul>
 <li><a href="time.html#pygame.time">pygame.time</a> - <font size=-1>pygame module for monitoring time</font></li>
 <ul>
 <li><a href="transform.html#pygame.transform">pygame.transform</a> - <font size=-1>pygame module to transform surfaces</font></li>
 <ul>
 <li><a href="transform.html#pygame.transform.average_surfaces">pygame.transform.average_surfaces</a> - <font size=-1>find the average surface from many surfaces.</font></li>
-<li><a href="transform.html#pygame.transform.chop">pygame.transform.chop</a> - <font size=-1>remove interior area of an image</font></li>
+<li><a href="transform.html#pygame.transform.chop">pygame.transform.chop</a> - <font size=-1>gets a copy of an image with an interior area removed</font></li>
 <li><a href="transform.html#pygame.transform.flip">pygame.transform.flip</a> - <font size=-1>flip vertically and horizontally</font></li>
 <li><a href="transform.html#pygame.transform.laplacian">pygame.transform.laplacian</a> - <font size=-1>find edges in a surface</font></li>
 <li><a href="transform.html#pygame.transform.rotate">pygame.transform.rotate</a> - <font size=-1>rotate an image</font></li>

docs/ref/mixer.html

 <p>All sound playback is mixed in background threads. When you begin to play a Sound object, it will return immediately while the sound continues to play. <tt>A</tt> single Sound object can also be actively played back multiple times. </p>
 <p>The mixer also has a special streaming channel. This is for music playback and is accessed through the <tt>pygame.mixer.music</tt> module. </p>
 <p>The mixer module must be initialized like other pygame modules, but it has some extra conditions. The <tt><a href="mixer.html#pygame.mixer.init">pygame.mixer.init</a> - <font size=-1>initialize the mixer module</font></tt> function takes several optional arguments to control the playback rate and sample size. Pygame will default to reasonable values, but pygame cannot perform Sound resampling, so the mixer should be initialized to match the values of your audio resources. </p>
-<p><tt>NOTE:</tt> there is currently a bug on some windows machines which makes sound play back 'scratchy'. There is not enough cpu in the sound thread to feed the buffer to the sound api. To get around this you can increase the buffer size. However this means that there is more of a delay between the time you ask to play the sound and when it gets played. Try calling this before the <tt>pygame.init</tt> or <tt>pygame.mixer.init</tt> calls. <tt>pygame.mixer.pre_init(44100,-16,2</tt>, 1024 * 3) </p>
+<p><tt>NOTE:</tt> Not to get less laggy sound, use a smaller buffer size. The default is set to reduce the chance of scratchy sounds on some computers. You can change the default buffer by calling <tt>pygame.mixer.pre_init</tt> before <tt>pygame.mixer.init</tt> or <tt>pygame.init</tt> is called. For example: <tt>pygame.mixer.pre_init(44100,-16,2</tt>, 1024) The default size was changed from 1024 to 3072 in pygame <tt>1.8</tt>. </p>
 <!--COMMENTS:pygame.mixer--> &nbsp;<br> 
 
 
 <a name="pygame.mixer.init">
 <big><b>pygame.mixer.init</big></b><br><ul>
   <i>initialize the mixer module</i><br>
-  <tt>pygame.mixer.init(frequency=22050, size=-16, stereo=2, buffer=1024): return None</tt><br>
+  <tt>pygame.mixer.init(frequency=22050, size=-16, channels=2, buffer=3072): return None</tt><br>
 <p>Initialize the mixer module for Sound loading and playback. The default arguments can be overridden to provide specific audio mixing. The size argument represents how many bits are used for each audio sample. If the value is negative then signed sample values will be used. Positive values mean unsigned audio samples will be used. </p>
-<p>The stereo argument is used to specify the number of channels used. 1 for mono and 2 for stereo. </p>
+<p>The channels argument is used to specify whether to use mono or stereo. 1 for mono and 2 for stereo. No other values are supported. </p>
 <p>The buffer argument controls the number of internal samples used in the sound mixer. The default value should work for most cases. It can be lowered to reduce latency, but sound dropout may occur. It can be raised to larger values to ensure playback never skips, but it will impose latency on sound playback. The buffer size must be a power of two. </p>
 <p>Some platforms require the <tt>pygame.mixer</tt> module to be initialized after the display modules have initialized. The top level <tt><a href="pygame.html#pygame.init">pygame.init</a> - <font size=-1>initialize all imported pygame modules</font></tt> takes care of this automatically, but cannot pass any arguments to the mixer init. To solve this, mixer has a function <tt><a href="mixer.html#pygame.mixer.pre_init">pygame.mixer.pre_init</a> - <font size=-1>preset the mixer init arguments</font></tt> to set the proper defaults before the toplevel init is used. </p>
 <p>It is safe to call this more than once, but after the mixer is initialized you cannot change the playback arguments without first calling <tt><a href="mixer.html#pygame.mixer.quit">pygame.mixer.quit</a> - <font size=-1>uninitialize the mixer</font></tt>. </p>
 <a name="pygame.mixer.pre_init">
 <big><b>pygame.mixer.pre_init</big></b><br><ul>
   <i>preset the mixer init arguments</i><br>
-  <tt>pygame.mixer.pre_init(frequency=0, size=0, stereo=0, buffersize=0): return None</tt><br>
+  <tt>pygame.mixer.pre_init(frequency=0, size=0, channels=0, buffersize=0): return None</tt><br>
 <p>Any nonzero arguments change the default values used when the real <tt><a href="mixer.html#pygame.mixer.init">pygame.mixer.init</a> - <font size=-1>initialize the mixer module</font></tt> is called. The best way to set custom mixer playback values is to call <tt><a href="mixer.html#pygame.mixer.pre_init">pygame.mixer.pre_init</a> - <font size=-1>preset the mixer init arguments</font></tt> before calling the top level <tt><a href="pygame.html#pygame.init">pygame.init</a> - <font size=-1>initialize all imported pygame modules</font></tt>. </p>
 <!--COMMENTS:pygame.mixer.pre_init--> &nbsp;<br> 
 <br></ul>
 <a name="pygame.mixer.get_init">
 <big><b>pygame.mixer.get_init</big></b><br><ul>
   <i>test if the mixer is initialized</i><br>
-  <tt>pygame.mixer.get_init(): return (frequency, format, stereo)</tt><br>
+  <tt>pygame.mixer.get_init(): return (frequency, format, channels)</tt><br>
 <p>If the mixer is initialized, this returns the playback arguments it is using. If the mixer has not been initialized this returns None </p>
 <!--COMMENTS:pygame.mixer.get_init--> &nbsp;<br> 
 <br></ul>

docs/ref/sndarray.html

   <tr><td><a href="sndarray.html#pygame.sndarray.array">pygame.sndarray.array</a> - <font size=-1>copy Sound samples into an array</font></td><td>copy Sound samples into an array</td></tr>
   <tr><td><a href="sndarray.html#pygame.sndarray.samples">pygame.sndarray.samples</a> - <font size=-1>reference Sound samples into an array</font></td><td>reference Sound samples into an array</td></tr>
   <tr><td><a href="sndarray.html#pygame.sndarray.make_sound">pygame.sndarray.make_sound</a> - <font size=-1>convert an array into a Sound object</font></td><td>convert an array into a Sound object</td></tr>
-  <tr><td><a href="sndarray.html#pygame.sndarray.use_array">pygame.sndarray.use_array</a> - <font size=-1>Sets the array system to be used for sound arrays</font></td><td>Sets the array system to be used for sound arrays</td></tr>
+  <tr><td><a href="sndarray.html#pygame.sndarray.use_arraytype">pygame.sndarray.use_arraytype</a> - <font size=-1>Sets the array system to be used for sound arrays</font></td><td>Sets the array system to be used for sound arrays</td></tr>
+  <tr><td><a href="sndarray.html#pygame.sndarray.get_arraytype">pygame.sndarray.get_arraytype</a> - <font size=-1>Gets the currently active array type.</font></td><td>Gets the currently active array type.</td></tr>
   <tr><td><a href="sndarray.html#pygame.sndarray.get_arraytypes">pygame.sndarray.get_arraytypes</a> - <font size=-1>Gets the array system types currently supported.</font></td><td>Gets the array system types currently supported.</td></tr>
 </table></small></ul>
 <p>Functions to convert between Numeric or numpy arrays and Sound objects. This module will only be available when pygame can use the external numpy or Numeric package. </p>
 <pre>  numeric
   numpy
 </pre><p>The default will be Numeric, if installed. Otherwise, numpy will be set as default if installed. If neither Numeric nor numpy are installed, the module will raise an ImportError. </p>
-<p>The array type to use can be changed at runtime using the use_array() method, which requires one of the above types as string. </p>
+<p>The array type to use can be changed at runtime using the use_arraytype() method, which requires one of the above types as string. </p>
 <p>Note: numpy and Numeric are not completely compatible. Certain array manipulations, which work for one type, might behave differently or even completely break for the other. </p>
 <p>Additionally, in contrast to Numeric numpy can use unsigned 16-bit integers. Sounds with 16-bit data will be treated as unsigned integers, if the sound sample type requests this. Numeric instead always uses signed integers for the representation, which is important to keep in mind, if you use the module's functions and wonder about the values. </p>
 <!--COMMENTS:pygame.sndarray--> &nbsp;<br> 
 <br></ul>
 
 
-<a name="pygame.sndarray.use_array">
-<big><b>pygame.sndarray.use_array</big></b><br><ul>
+<a name="pygame.sndarray.use_arraytype">
+<big><b>pygame.sndarray.use_arraytype</big></b><br><ul>
   <i>Sets the array system to be used for sound arrays</i><br>
-  <tt>pygame.sndarray.use_array (arraytype): return None</tt><br>
+  <tt>pygame.sndarray.use_arraytype (arraytype): return None</tt><br>
 <p>Uses the requested array type for the module functions. Currently supported array types are: </p>
 <pre>  numeric
   numpy
 </pre><p>If the requested type is not available, a ValueError will be raised. </p>
 <p>New in pygame <tt>1.8</tt>. </p>
-<!--COMMENTS:pygame.sndarray.use_array--> &nbsp;<br> 
+<!--COMMENTS:pygame.sndarray.use_arraytype--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="pygame.sndarray.get_arraytype">
+<big><b>pygame.sndarray.get_arraytype</big></b><br><ul>
+  <i>Gets the currently active array type.</i><br>
+  <tt>pygame.sndarray.get_arraytype (): return str</tt><br>
+<p>Returns the currently active array type. This will be a value of the get_arraytypes() tuple and indicates which type of array module is used for the array creation. </p>
+<p>New in pygame <tt>1.8</tt> </p>
+<!--COMMENTS:pygame.sndarray.get_arraytype--> &nbsp;<br> 
 <br></ul>
 
 
 <big><b>pygame.sndarray.get_arraytypes</big></b><br><ul>
   <i>Gets the array system types currently supported.</i><br>
   <tt>pygame.sndarray.get_arraytypes (): return tuple</tt><br>
-<p>Checks, which array systems are available and returns them as a tuple of strings. The values of the tuple can be used directly in the <tt><a href="sndarray.html#pygame.sndarray.use_array">pygame.sndarray.use_array</a> - <font size=-1>Sets the array system to be used for sound arrays</font></tt> method. If no supported array system could be found, None will be returned. </p>
+<p>Checks, which array systems are available and returns them as a tuple of strings. The values of the tuple can be used directly in the <tt>pygame.sndarray.use_arraytype</tt> () method. If no supported array system could be found, None will be returned. </p>
 <p>New in pygame <tt>1.8</tt>. </p>
 <!--COMMENTS:pygame.sndarray.get_arraytypes--> &nbsp;<br> 
 <br></ul>

docs/ref/surface.html

   <tr><td><a href="surface.html#Surface.get_masks">Surface.get_masks</a> - <font size=-1>the bitmasks needed to convert between a color and a mapped integer</font></td><td>the bitmasks needed to convert between a color and a mapped integer</td></tr>
   <tr><td><a href="surface.html#Surface.get_shifts">Surface.get_shifts</a> - <font size=-1>the bit shifts needed to convert between a color and a mapped integer</font></td><td>the bit shifts needed to convert between a color and a mapped integer</td></tr>
   <tr><td><a href="surface.html#Surface.get_losses">Surface.get_losses</a> - <font size=-1>the significant bits used to convert between a color and a mapped integer</font></td><td>the significant bits used to convert between a color and a mapped integer</td></tr>
+  <tr><td><a href="surface.html#Surface.get_bounding_rect">Surface.get_bounding_rect</a> - <font size=-1>find the smallest rect containing data</font></td><td>find the smallest rect containing data</td></tr>
   <tr><td><a href="surface.html#Surface.get_buffer">Surface.get_buffer</a> - <font size=-1>acquires a buffer object for the pixels of the Surface.</font></td><td>acquires a buffer object for the pixels of the Surface.</td></tr>
 </table></small></ul>
 <p><tt>A</tt> pygame Surface is used to represent any image. The Surface has a fixed resolution and pixel format. Surfaces with 8bit pixels use a color palette to map to 24bit color. </p>
 <big><b>Surface.get_losses</big></b><br><ul>
   <i>the significant bits used to convert between a color and a mapped integer</i><br>
   <tt>Surface.get_losses(): return (R, G, B, A)</tt><br>
-<p>Return the least significan number of bits stripped from each color in a mapped integer. </p>
+<p>Return the least significant number of bits stripped from each color in a mapped integer. </p>
 <p>This value is not needed for normal Pygame usage. </p>
 <!--COMMENTS:Surface.get_losses--> &nbsp;<br> 
 <br></ul>
 
 
+<a name="Surface.get_bounding_rect">
+<big><b>Surface.get_bounding_rect</big></b><br><ul>
+  <i>find the smallest rect containing data</i><br>
+  <tt>Surface.get_bounding_rect(min_alpha = 1): return Rect</tt><br>
+<p>Returns the smallest rectangular region that contains all the pixels in the surface that have an alpha value greater than or equal to the minimum alpha value. </p>
+<p>This function will temporarily lock and unlock the Surface as needed. </p>
+<p>New in pygame <tt>1.8</tt>. </p>
+<!--COMMENTS:Surface.get_bounding_rect--> &nbsp;<br> 
+<br></ul>
+
+
 <a name="Surface.get_buffer">
 <big><b>Surface.get_buffer</big></b><br><ul>
   <i>acquires a buffer object for the pixels of the Surface.</i><br>

docs/ref/surfarray.html

   <tr><td><a href="surfarray.html#pygame.surfarray.make_surface">pygame.surfarray.make_surface</a> - <font size=-1>Copy an array to a new surface</font></td><td>Copy an array to a new surface</td></tr>
   <tr><td><a href="surfarray.html#pygame.surfarray.blit_array">pygame.surfarray.blit_array</a> - <font size=-1>Blit directly from a array values</font></td><td>Blit directly from a array values</td></tr>
   <tr><td><a href="surfarray.html#pygame.surfarray.map_array">pygame.surfarray.map_array</a> - <font size=-1>Map a 3d array into a 2d array</font></td><td>Map a 3d array into a 2d array</td></tr>
-  <tr><td><a href="surfarray.html#pygame.surfarray.use_array">pygame.surfarray.use_array</a> - <font size=-1>Sets the array system to be used for surface arrays</font></td><td>Sets the array system to be used for surface arrays</td></tr>
+  <tr><td><a href="surfarray.html#pygame.surfarray.use_arraytype">pygame.surfarray.use_arraytype</a> - <font size=-1>Sets the array system to be used for surface arrays</font></td><td>Sets the array system to be used for surface arrays</td></tr>
+  <tr><td><a href="surfarray.html#pygame.surfarray.get_arraytype">pygame.surfarray.get_arraytype</a> - <font size=-1>Gets the currently active array type.</font></td><td>Gets the currently active array type.</td></tr>
   <tr><td><a href="surfarray.html#pygame.surfarray.get_arraytypes">pygame.surfarray.get_arraytypes</a> - <font size=-1>Gets the array system types currently supported.</font></td><td>Gets the array system types currently supported.</td></tr>
 </table></small></ul>
 <p>Functions to convert pixel data between pygame Surfaces and arrays. This module will only be functional when pygame can use the external Numpy or Numeric packages. </p>
 <pre>  numeric
   numpy
 </pre><p>The default will be Numeric, if installed. Otherwise, numpy will be set as default if installed. If neither Numeric nor numpy are installed, the module will raise an ImportError. </p>
-<p>The array type to use can be changed at runtime using the use_array() method, which requires one of the above types as string. </p>
+<p>The array type to use can be changed at runtime using the use_arraytype () method, which requires one of the above types as string. </p>
 <p>Note: numpy and Numeric are not completely compatible. Certain array manipulations, which work for one type, might behave differently or even completely break for the other. </p>
 <p>Additionally, in contrast to Numeric numpy does use unsigned 16-bit integers. Images with 16-bit data will be treated as unsigned integers. Numeric instead uses signed integers for the representation, which is important to keep in mind, if you use the module's functions and wonder about the values. </p>
 <p>The support of numpy is new in pygame <tt>1.8</tt>. </p>
 <br></ul>
 
 
-<a name="pygame.surfarray.use_array">
-<big><b>pygame.surfarray.use_array</big></b><br><ul>
+<a name="pygame.surfarray.use_arraytype">
+<big><b>pygame.surfarray.use_arraytype</big></b><br><ul>
   <i>Sets the array system to be used for surface arrays</i><br>
-  <tt>pygame.surfarray.use_array (arraytype): return None</tt><br>
+  <tt>pygame.surfarray.use_arraytype (arraytype): return None</tt><br>
 <p>Uses the requested array type for the module functions. Currently supported array types are: </p>
 <pre>  numeric
   numpy
 </pre><p>If the requested type is not available, a ValueError will be raised. </p>
 <p>New in pygame <tt>1.8</tt>. </p>
-<!--COMMENTS:pygame.surfarray.use_array--> &nbsp;<br> 
+<!--COMMENTS:pygame.surfarray.use_arraytype--> &nbsp;<br> 
+<br></ul>
+
+
+<a name="pygame.surfarray.get_arraytype">
+<big><b>pygame.surfarray.get_arraytype</big></b><br><ul>
+  <i>Gets the currently active array type.</i><br>
+  <tt>pygame.surfarray.get_arraytype (): return str</tt><br>
+<p>Returns the currently active array type. This will be a value of the get_arraytypes() tuple and indicates which type of array module is used for the array creation. </p>
+<p>New in pygame <tt>1.8</tt> </p>
+<!--COMMENTS:pygame.surfarray.get_arraytype--> &nbsp;<br> 
 <br></ul>
 
 
 <big><b>pygame.surfarray.get_arraytypes</big></b><br><ul>
   <i>Gets the array system types currently supported.</i><br>
   <tt>pygame.surfarray.get_arraytypes (): return tuple</tt><br>
-<p>Checks, which array systems are available and returns them as a tuple of strings. The values of the tuple can be used directly in the <tt><a href="surfarray.html#pygame.surfarray.use_array">pygame.surfarray.use_array</a> - <font size=-1>Sets the array system to be used for surface arrays</font></tt> method. If no supported array system could be found, None will be returned. </p>
+<p>Checks, which array systems are available and returns them as a tuple of strings. The values of the tuple can be used directly in the <tt>pygame.surfarray.use_arraytype</tt> () method. If no supported array system could be found, None will be returned. </p>
 <p>New in pygame <tt>1.8</tt>. </p>
 <!--COMMENTS:pygame.surfarray.get_arraytypes--> &nbsp;<br> 
 <br></ul>

docs/ref/transform.html

   <tr><td><a href="transform.html#pygame.transform.rotozoom">pygame.transform.rotozoom</a> - <font size=-1>filtered scale and rotation</font></td><td>filtered scale and rotation</td></tr>
   <tr><td><a href="transform.html#pygame.transform.scale2x">pygame.transform.scale2x</a> - <font size=-1>specialized image doubler</font></td><td>specialized image doubler</td></tr>
   <tr><td><a href="transform.html#pygame.transform.smoothscale">pygame.transform.smoothscale</a> - <font size=-1>scale a surface to an arbitrary size smoothly</font></td><td>scale a surface to an arbitrary size smoothly</td></tr>
-  <tr><td><a href="transform.html#pygame.transform.chop">pygame.transform.chop</a> - <font size=-1>remove interior area of an image</font></td><td>remove interior area of an image</td></tr>
+  <tr><td><a href="transform.html#pygame.transform.chop">pygame.transform.chop</a> - <font size=-1>gets a copy of an image with an interior area removed</font></td><td>gets a copy of an image with an interior area removed</td></tr>
   <tr><td><a href="transform.html#pygame.transform.laplacian">pygame.transform.laplacian</a> - <font size=-1>find edges in a surface</font></td><td>find edges in a surface</td></tr>
   <tr><td><a href="transform.html#pygame.transform.average_surfaces">pygame.transform.average_surfaces</a> - <font size=-1>find the average surface from many surfaces.</font></td><td>find the average surface from many surfaces.</td></tr>
   <tr><td><a href="transform.html#pygame.transform.threshold">pygame.transform.threshold</a> - <font size=-1>finds which, and how many pixels in a surface are within a threshold of a color.</font></td><td>finds which, and how many pixels in a surface are within a threshold of a color.</td></tr>
 
 <a name="pygame.transform.chop">
 <big><b>pygame.transform.chop</big></b><br><ul>
-  <i>remove interior area of an image</i><br>
+  <i>gets a copy of an image with an interior area removed</i><br>
   <tt>pygame.transform.chop(Surface, rect): return Surface</tt><br>
-<p>Extracts a portion of an image. All vertical and horizontal pixels surrounding the given rectangle area are removed. The resulting image is shrunken by the size of pixels removed. (The original image is not altered by this <tt>operation.)</tt> </p>
+<p>Extracts a portion of an image. All vertical and horizontal pixels surrounding the given rectangle area are removed. The corner areas (diagonal to the rect) are then brought together. (The original image is not altered by this <tt>operation.)</tt> </p>
+<p><tt>NOTE:</tt> If you want a "crop" that returns the part of an image within a rect, you can blit with a rect to a new surface or copy a subsurface. </p>
 <!--COMMENTS:pygame.transform.chop--> &nbsp;<br> 
 <br></ul>
 
   <i>find edges in a surface</i><br>
   <tt>pygame.transform.laplacian(Surface, DestSurface = None): return Surface</tt><br>
 <p>Finds the edges in a surface using the laplacian algorithm. </p>
+<p>New in pygame <tt>1.8</tt> </p>
 <!--COMMENTS:pygame.transform.laplacian--> &nbsp;<br> 
 <br></ul>
 
   <i>find the average surface from many surfaces.</i><br>
   <tt>pygame.transform.average_surfaces(Surfaces, DestSurface = None): return Surface</tt><br>
 <p>Takes a sequence of surfaces and returns a surface with average colors from each of the surfaces. </p>
+<p>New in pygame <tt>1.8</tt> </p>
 <!--COMMENTS:pygame.transform.average_surfaces--> &nbsp;<br> 
 <br></ul>
 
 <p>It can set the destination surface where all of the pixels not within the threshold are changed to diff_color. </p>
 <p>Or it can be used to just count the number of pixels within the threshold if you set change_return to False. </p>
 <p>You can use a threshold of (r,g,b,a) where the r,g,b can have different thresholds. So you could use an r threshold of 40 and a blue threshold of 2 if you like. </p>
+<p>New in pygame <tt>1.8</tt> </p>
 <!--COMMENTS:pygame.transform.threshold--> &nbsp;<br> 
 <br></ul>
 <br></ul>
     SDL_Surface* surf;
     int depth = 0;
     int flags = SDL_SWSURFACE;
-    int w, h, hasbuf;
+    int w = 0;
+    int h = 0;
+    int hasbuf;
     char *title, *icontitle;
 
-    if (!PyArg_ParseTuple (arg, "(ii)|ii", &w, &h, &flags, &depth))
+    if (!PyArg_ParseTuple (arg, "|(ii)ii", &w, &h, &flags, &depth))
         return NULL;
 
-    if (w <= 0 || h <= 0)
-        return RAISE (PyExc_SDLError, "Cannot set 0 sized display mode");
-		
+    if (w < 0 || h < 0)
+        return RAISE (PyExc_SDLError, "Cannot set negative sized display mode");
+
+    if (w == 0 || h == 0)
+    {
+        SDL_version versioninfo;
+        SDL_VERSION (&versioninfo);
+        if (!(versioninfo.major > 1 || 
+             (versioninfo.major == 1 && versioninfo.minor > 2) || 
+             (versioninfo.major == 1 && versioninfo.minor == 2 && versioninfo.patch >= 10 )))
+        {
+            return RAISE (PyExc_SDLError, "Cannot set 0 sized display mode");
+        }
+    }
+
     if (!SDL_WasInit (SDL_INIT_VIDEO))
     {
         /*note SDL works special like this too*/
 
 set_mode
 initialize a window or screen for display
-pygame.display.set_mode(resolution, flags=0, depth=0): return Surface
+pygame.display.set_mode(resolution=(0,0), flags=0, depth=0): return Surface
 
 This function will create a display Surface. The arguments passed in are
 requests for a display type. The actual created display will be the best
 possible match supported by the system.
 
 The resolution argument is a pair of numbers representing the width and
-height. The flags argument is a collection of additional options.
-The depth argument represents the number of bits to use for color.
+height. The flags argument is a collection of additional options.  The
+depth argument represents the number of bits to use for color.
 
 The Surface that gets returned can be drawn to like a regular Surface but
 changes will eventually be seen on the monitor.
 
+If no resolution is passed or is set to (0, 0) and pygame uses SDL
+version 1.2.10 or above, the created Surface will have the same size as
+the current screen resolution. If only the width or height are set to 0,
+the Surface will have the same width or height as the screen resolution.
+Using a SDL version prior to 1.2.10 will raise an exception.
+
 It is usually best to not pass the depth argument. It will default to the best
 and fastest color depth for the system. If your game requires a specific color
 format you can control the depth with this argument. Pygame will emulate an
 
 #define DOC_PYGAMEDISPLAYGETINIT "pygame.display.get_init(): return bool\ntrue if the display module is initialized"
 
-#define DOC_PYGAMEDISPLAYSETMODE "pygame.display.set_mode(resolution, flags=0, depth=0): return Surface\ninitialize a window or screen for display"
+#define DOC_PYGAMEDISPLAYSETMODE "pygame.display.set_mode(resolution=(0,0), flags=0, depth=0): return Surface\ninitialize a window or screen for display"
 
 #define DOC_PYGAMEDISPLAYGETSURFACE "pygame.display.get_surface(): return Surface\nget a reference to the currently set display surface"
 
 
 #define DOC_PYGAMEMIXER "pygame module for loading and playing sounds"
 
-#define DOC_PYGAMEMIXERINIT "pygame.mixer.init(frequency=22050, size=-16, channels=2, buffer=1024): return None\ninitialize the mixer module"
+#define DOC_PYGAMEMIXERINIT "pygame.mixer.init(frequency=22050, size=-16, channels=2, buffer=3072): return None\ninitialize the mixer module"
 
 #define DOC_PYGAMEMIXERPREINIT "pygame.mixer.pre_init(frequency=0, size=0, channels=0, buffersize=0): return None\npreset the mixer init arguments"