Commits

Anonymous committed 4cfdaab

the 1.1 release candidate

Comments (0)

Files changed (9)

-Pygame Version 1.0.2
-April 4th, 2001
+Pygame Version 1.0.9
+June 11th, 2001
 
 Python Game Development
 by Pete Shinners
 Pygame is a cross-platfrom library designed to make it easy to write
 multimedia software, such as games, in Python.
 
-Pygame depends on SDL >= 1.1.7 and Python ?= 2.0. It also is optionally
+Pygame depends on SDL >= 1.1.7 and Python >= 2.0. It also is optionally
 dependent on SDL_ttf, SDL_image, SDL_mixer, and Numeric.
 
 
  - MPEG video playback with smpeg
  - more drawing primitives in the draw module: circle, poly
  - more collision detection stuff: pixel2pixel, point2poly, etc
+ - smarten the config.py and setup.py stuff
+
 
 
 
 
 
 
+LIBRARIES
+
+Pygame is obviously strongly dependent on SDL and Python. It also
+links to and embeds several other smaller libraries. The font module
+relies on SDL_tff, which is dependent on freetype. The mixer (and
+mixer.music) modules depend on SDL_mixer. The image module depends
+on SDL_image, which also can use libjpeg and libpng. The transform
+module has an embedded version of SDL_rotozoom for its own rotozoom
+function. The surfarray module requires the python Numeric package
+for its multidimensional numeric arrays.
+
+
+
+
 LINKS
 
 Pygame Website : http://www.pygame.org
 
 This basically means you can use pygame in any project you want, but
 if you make any changes or additions to pygame itself, those must be
-released with a compatible license.
-( hopefully submitted back to the pygame project :] )
+released with a compatible license. (preferably submitted back to the
+pygame project)
 
 The programs in the "examples" subdirectory are in the public domain.
 
 
 <hr>
 
-<font size=+1><b>Text File Documentation</b></font><br><li><a href=../README.TXT>README</a> - Pygame version 1.0.2</li>
+<font size=+1><b>Text File Documentation</b></font><br><li><a href=../README.TXT>README</a> - Pygame version 1.0.9</li>
 <li><a href=LGPL>LGPL</a> - Gnu lesser general public license</li>
 <li><a href=fullinstall.txt>fullinstall</a> - Build instructions for building and installing pygame</li>
 <li><a href=init.txt>init</a> - Information about importing and initializing pygame</li><br>&nbsp;<br><font size=+1><b>Tutorials</b></font><br><li><a href=tut/ChimpLineByLine.html>tut/ChimpLineByLine</a> - Line by Line Descriptions of the Chimp Example
 <a href=ref/Rect.html#colliderect>Rect.colliderect</a> - check overlapping rectangles<br>
 <a href=ref/Rect.html#contains>Rect.contains</a> - check if rectangle fully inside another<br>
 <a href=ref/Rect.html#inflate>Rect.inflate</a> - new rectangle with size changed<br>
+<a href=ref/Rect.html#inflate_ip>Rect.inflate_ip</a> - changes the Rect size<br>
 <a href=ref/Rect.html#move>Rect.move</a> - new rectangle with position changed<br>
+<a href=ref/Rect.html#move_ip>Rect.move_ip</a> - move the Rect by the given offset<br>
 <a href=ref/Rect.html#normalize>Rect.normalize</a> - corrects negative sizes<br>
-<a href=ref/Rect.html#union>Rect.union</a> - rectangle covering both input<br>
+<a href=ref/Rect.html#union>Rect.union</a> - makes new rectangle covering both inputs<br>
+<a href=ref/Rect.html#union_ip>Rect.union_ip</a> - rectangle covering both input<br>
 <a href=ref/Rect.html#unionall>Rect.unionall</a> - rectangle covering all inputs<br>
+<a href=ref/Rect.html#unionall_ip>Rect.unionall_ip</a> - rectangle covering all inputs<br>
 <a href=ref/Sound.html#fadeout>Sound.fadeout</a> - fadeout all channels playing this sound<br>
 <a href=ref/Sound.html#get_num_channels>Sound.get_num_channels</a> - number of channels with sound<br>
 <a href=ref/Sound.html#get_volume>Sound.get_volume</a> - query volume for sound<br>

docs/ref/Rect.html

 new rectangle with size changed</td></tr>
 
 
+<tr><td><a href=#inflate_ip>inflate_ip</a></td><td> -
+changes the Rect size</td></tr>
+
+
 <tr><td><a href=#move>move</a></td><td> -
 new rectangle with position changed</td></tr>
 
 
+<tr><td><a href=#move_ip>move_ip</a></td><td> -
+move the Rect by the given offset</td></tr>
+
+
 <tr><td><a href=#normalize>normalize</a></td><td> -
 corrects negative sizes</td></tr>
 
 
 <tr><td><a href=#union>union</a></td><td> -
+makes new rectangle covering both inputs</td></tr>
+
+
+<tr><td><a href=#union_ip>union_ip</a></td><td> -
 rectangle covering both input</td></tr>
 
 
 rectangle covering all inputs</td></tr>
 
 
+<tr><td><a href=#unionall_ip>unionall_ip</a></td><td> -
+rectangle covering all inputs</td></tr>
+
+
 </table>
 
 <hr>
 Negative values will shrink the rectangle.
 </ul><br>&nbsp;<br>
 
+<a name=inflate_ip><font size=+2><b>inflate_ip
+</b></font><br><font size=+1><tt>
+Rect.inflate_ip(x, y) -> None
+</tt></font><ul>
+Changes the Rect by the given amounts. The rectangle
+shrinks and expands around the rectangle's center.
+Negative values will shrink the rectangle.
+</ul><br>&nbsp;<br>
+
 <a name=move><font size=+2><b>move
 </b></font><br><font size=+1><tt>
 Rect.move(x, y) -> Rect
 rectangle moved by the given amount.
 </ul><br>&nbsp;<br>
 
+<a name=move_ip><font size=+2><b>move_ip
+</b></font><br><font size=+1><tt>
+Rect.move_ip(x, y) -> Rect
+</tt></font><ul>
+Moves the rectangle which by the given amount.
+</ul><br>&nbsp;<br>
+
 <a name=normalize><font size=+2><b>normalize
 </b></font><br><font size=+1><tt>
 Rect.normalize() -> None
 </b></font><br><font size=+1><tt>
 Rect.union(rectstyle) -> Rect
 </tt></font><ul>
-Returns a new rectangle that completely covers the
-given inputs. There may be area inside the new
-rectangle that is not covered by the inputs.
+Creates a new Rect to completely cover the
+given input. There may be area inside the new
+Rect that is not covered by either input.
+</ul><br>&nbsp;<br>
+
+<a name=union_ip><font size=+2><b>union_ip
+</b></font><br><font size=+1><tt>
+Rect.union_ip(rectstyle) -> None
+</tt></font><ul>
+Resizes the Rect to completely cover the
+given input. There may be area inside the new
+dimensions that is not covered by either input.
 </ul><br>&nbsp;<br>
 
 <a name=unionall><font size=+2><b>unionall
 rectangle that is not covered by the inputs.
 </ul><br>&nbsp;<br>
 
+<a name=unionall_ip><font size=+2><b>unionall_ip
+</b></font><br><font size=+1><tt>
+Rect.unionall_ip(sequence_of_rectstyles) -> None
+</tt></font><ul>
+Returns a new rectangle that completely covers all the
+given inputs. There may be area inside the new
+rectangle that is not covered by the inputs.
+</ul><br>&nbsp;<br>
+
 
 <hr>
 </body></html>

docs/ref/pygame.html

 representing rectangle data. This is usually a
 sequence of x and y position for the topleft
 corner, and the width and height.
+<br>&nbsp;<br>
+For some of the Rect methods there are two version.
+For example, there is <a href=Rect.html#move>move()</a> and <a href=Rect.html#move_ip>move_ip()</a>. The methods
+witht the '_ip' suffix on the name are the 'in-place'
+version of those functions. They effect the actual
+source object, instead of returning a new Rect object.
 </ul><br>&nbsp;<br>
 
 <a name=Surface><font size=+2><b>Surface

docs/ref/pygame_image.html

 <br>
 <h2 align=center>pygame.image</h2>
 This module contains functions to transfer images in and out
-of Surfaces. At the minimum the included <a href=#load>load()</a> function will
+of Surfaces. At the minimum the included <a href=pygame_mixer_music.html#load>load()</a> function will
 support BMP files. If SDL_image is properly installed when
 pygame is installed, it will support all the formats included
 with SDL_image. You can call the <a href=#get_extended>get_extended()</a> function to test
 if the SDL_image support is available.
 <br>&nbsp;<br>
 Some functions that communicate with other libraries will require
-that those libraries are properly installed. For example, the <a href=#save>save()</a>
+that those libraries are properly installed. For example, the <a href=Surface.html#save>save()</a>
 function can only save OPENGL surfaces if pyopengl is available.
 
 <hr>

docs/ref/pygame_mixer_music.html

 <br>&nbsp;<br>
 The music module has many of the same types of functions as the
 Sound objects. The main difference is only one music object can
-be loaded at a time, with the <a href=pygame_image.html#load>load()</a> function. Music
+be loaded at a time, with the <a href=#load>load()</a> function. Music
 must be stored in an individual file on the system, it cannot be
 loaded from special file-like objects through python.
 
 releases. (hmm, until we get to versions > 10)
 """
 
-ver = '1.0.2'
+ver = '1.0.9'
 
 def __hiddendummyfunc():
     """pygame.version.ver 
 
 METADATA = {
     "name":             "pygame",
-    "version":          "1.0.1",
+    "version":          "1.0.9",
     "license":          "LGPL",
     "url":              "http://www.pygame.org",
     "author":           "Pete Shinners",
 	return PyRect_New4((short)(self->r.x+x), (short)(self->r.y+y), self->r.w, self->r.h);
 }
 
+    /*DOC*/ static char doc_move_ip[] =
+    /*DOC*/    "Rect.move_ip(x, y) -> Rect\n"
+    /*DOC*/    "move the Rect by the given offset\n"
+    /*DOC*/    "\n"
+    /*DOC*/    "Moves the rectangle which by the given amount.\n"
+    /*DOC*/ ;
+
+static PyObject* rect_move_ip(PyObject* oself, PyObject* args)
+{
+	PyRectObject* self = (PyRectObject*)oself;
+	short x, y;
+
+	if(!TwoShortsFromObj(args, &x, &y))
+		return RAISE(PyExc_TypeError, "argument must contain two numbers");
+
+	self->r.x += x;
+	self->r.y += y;
+	RETURN_NONE
+}
+
+
 
     /*DOC*/ static char doc_inflate[] =
     /*DOC*/    "Rect.inflate(x, y) -> Rect\n"
 }
 
 
+    /*DOC*/ static char doc_inflate_ip[] =
+    /*DOC*/    "Rect.inflate_ip(x, y) -> None\n"
+    /*DOC*/    "changes the Rect size\n"
+    /*DOC*/    "\n"
+    /*DOC*/    "Changes the Rect by the given amounts. The rectangle\n"
+    /*DOC*/    "shrinks and expands around the rectangle's center.\n"
+    /*DOC*/    "Negative values will shrink the rectangle.\n"
+    /*DOC*/ ;
+
+static PyObject* rect_inflate_ip(PyObject* oself, PyObject* args)
+{
+	PyRectObject* self = (PyRectObject*)oself;
+	short x, y;
+
+	if(!TwoShortsFromObj(args, &x, &y))
+		return RAISE(PyExc_TypeError, "argument must contain two numbers");
+
+	self->r.x -= x/2;
+	self->r.y -= y/2;
+	self->r.w += x;
+	self->r.h += y;
+	RETURN_NONE
+}
+
+
 
     /*DOC*/ static char doc_union[] =
     /*DOC*/    "Rect.union(rectstyle) -> Rect\n"
-    /*DOC*/    "rectangle covering both input\n"
+    /*DOC*/    "makes new rectangle covering both inputs\n"
     /*DOC*/    "\n"
-    /*DOC*/    "Returns a new rectangle that completely covers the\n"
-    /*DOC*/    "given inputs. There may be area inside the new\n"
-    /*DOC*/    "rectangle that is not covered by the inputs.\n"
+    /*DOC*/    "Creates a new Rect to completely cover the\n"
+    /*DOC*/    "given input. There may be area inside the new\n"
+    /*DOC*/    "Rect that is not covered by either input.\n"
     /*DOC*/ ;
 
 static PyObject* rect_union(PyObject* oself, PyObject* args)
 	short x, y, w, h;
 	if(!(argrect = GameRect_FromObject(args, &temp)))
 		return RAISE(PyExc_TypeError, "Argument must be rect style object");
-
+	
 	x = min(self->r.x, argrect->x);
 	y = min(self->r.y, argrect->y);
 	w = max(self->r.x+self->r.w, argrect->x+argrect->w) - x;
 }
 
 
+
+
+    /*DOC*/ static char doc_union_ip[] =
+    /*DOC*/    "Rect.union_ip(rectstyle) -> None\n"
+    /*DOC*/    "rectangle covering both input\n"
+    /*DOC*/    "\n"
+    /*DOC*/    "Resizes the Rect to completely cover the\n"
+    /*DOC*/    "given input. There may be area inside the new\n"
+    /*DOC*/    "dimensions that is not covered by either input.\n"
+    /*DOC*/ ;
+
+static PyObject* rect_union_ip(PyObject* oself, PyObject* args)
+{
+	PyRectObject* self = (PyRectObject*)oself;
+	GAME_Rect *argrect, temp;
+	short x, y, w, h;
+	if(!(argrect = GameRect_FromObject(args, &temp)))
+		return RAISE(PyExc_TypeError, "Argument must be rect style object");
+	
+	x = min(self->r.x, argrect->x);
+	y = min(self->r.y, argrect->y);
+	w = max(self->r.x+self->r.w, argrect->x+argrect->w) - x;
+	h = max(self->r.y+self->r.h, argrect->y+argrect->h) - y;
+	self->r.x = x;
+	self->r.y = y;
+	self->r.w = w;
+	self->r.h = h;
+	RETURN_NONE
+}
+
+
     /*DOC*/ static char doc_unionall[] =
     /*DOC*/    "Rect.unionall(sequence_of_rectstyles) -> Rect\n"
     /*DOC*/    "rectangle covering all inputs\n"
 }
 
 
+    /*DOC*/ static char doc_unionall_ip[] =
+    /*DOC*/    "Rect.unionall_ip(sequence_of_rectstyles) -> None\n"
+    /*DOC*/    "rectangle covering all inputs\n"
+    /*DOC*/    "\n"
+    /*DOC*/    "Returns a new rectangle that completely covers all the\n"
+    /*DOC*/    "given inputs. There may be area inside the new\n"
+    /*DOC*/    "rectangle that is not covered by the inputs.\n"
+    /*DOC*/ ;
+
+static PyObject* rect_unionall_ip(PyObject* oself, PyObject* args)
+{
+	PyRectObject* self = (PyRectObject*)oself;
+	GAME_Rect *argrect, temp;
+	int loop, size;
+	PyObject* list, *obj;
+	int t, l, b, r;
+
+	if(!PyArg_ParseTuple(args, "O", &list))
+		return NULL;
+	if(!PySequence_Check(list))
+		return RAISE(PyExc_TypeError, "Argument must be a sequence of rectstyle objects.");
+
+	l = self->r.x;
+	t = self->r.y;
+	r = self->r.x + self->r.w;
+	b = self->r.y + self->r.h;
+
+	size = PySequence_Length(list); /*warning, size could be -1 on error?*/
+	if(size < 1)
+		return PyRect_New4((short)l, (short)t, (short)(r-l), (short)(b-t));
+
+	for(loop = 0; loop < size; ++loop)
+	{
+		obj = PySequence_GetItem(list, loop);
+		if(!obj || !(argrect = GameRect_FromObject(obj, &temp)))
+		{
+			RAISE(PyExc_TypeError, "Argument must be a sequence of rectstyle objects.");
+			Py_XDECREF(obj);
+			break;
+		}
+		t = min(t, argrect->x);
+		l = min(l, argrect->y);
+		r = max(b, argrect->x+argrect->w);
+		b = max(b, argrect->y+argrect->h);
+		Py_DECREF(obj);
+	}
+
+	self->r.x = l;
+	self->r.y = t;
+	self->r.w = r-l;
+	self->r.h = b-t;
+	RETURN_NONE
+}
+
+
     /*DOC*/ static char doc_collidepoint[] =
     /*DOC*/    "Rect.collidepoint(x, y) -> bool\n"
     /*DOC*/    "point inside rectangle\n"
 static struct PyMethodDef rect_methods[] =
 {
 	{"normalize",		(PyCFunction)rect_normalize,	1, doc_normalize},
+	{"clip",			(PyCFunction)rect_clip,			1, doc_clip},
+	{"clamp",			(PyCFunction)rect_clamp,		1, doc_clamp},
+
 	{"move",			(PyCFunction)rect_move,			1, doc_move},
 	{"inflate",			(PyCFunction)rect_inflate,		1, doc_inflate},		
-	{"clip",			(PyCFunction)rect_clip,			1, doc_clip},
 	{"union",			(PyCFunction)rect_union,		1, doc_union},
 	{"unionall",		(PyCFunction)rect_unionall,		1, doc_unionall},
+
+	{"move_ip",			(PyCFunction)rect_move_ip,		1, doc_move_ip},
+	{"inflate_ip",		(PyCFunction)rect_inflate_ip,	1, doc_inflate_ip},		
+	{"union_ip",		(PyCFunction)rect_union_ip,		1, doc_union_ip},
+	{"unionall_ip",		(PyCFunction)rect_unionall_ip,	1, doc_unionall_ip},
+
 	{"collidepoint",	(PyCFunction)rect_collidepoint,	1, doc_collidepoint},
 	{"colliderect",		(PyCFunction)rect_colliderect,	1, doc_colliderect},
 	{"collidelist",		(PyCFunction)rect_collidelist,	1, doc_collidelist},
 	{"collidelistall",	(PyCFunction)rect_collidelistall,1,doc_collidelistall},
 	{"contains",		(PyCFunction)rect_contains,		1, doc_contains},
-	{"clamp",			(PyCFunction)rect_clamp,		1, doc_clamp},
 /* these are totally unwritten. volunteers? */
 /*	{"cleanup",			(PyCFunction)rect_cleanup,		1, doc_cleanup}, */
 /*	{"remove",			(PyCFunction)rect_remove,		1, doc_remove}, */
     /*DOC*/    "representing rectangle data. This is usually a\n"
     /*DOC*/    "sequence of x and y position for the topleft\n"
     /*DOC*/    "corner, and the width and height.\n"
+    /*DOC*/    "\n"
+    /*DOC*/    "For some of the Rect methods there are two version.\n"
+    /*DOC*/    "For example, there is move() and move_ip(). The methods\n"
+    /*DOC*/    "witht the '_ip' suffix on the name are the 'in-place'\n"
+    /*DOC*/    "version of those functions. They effect the actual\n"
+    /*DOC*/    "source object, instead of returning a new Rect object.\n"
     /*DOC*/ ;
 
 static PyObject* RectInit(PyObject* self, PyObject* args)