Commits

Anonymous committed 86649d3

cleanups, especially for win32

Comments (0)

Files changed (40)

 MIXER = -lSDL_mixer
 SMPEG = -lsmpeg
 NUMERIC = -I/usr/include/python2.0/Numeric
+EXTRABASE = 
 #--EndConfig
 
 
+
 #the following modules are optional. you will want to compile
 #everything you can, but you can ignore ones you don't have
 #dependencies for, just comment them out
 
 
 
-#the following modules are also optional, but only require
-#python dependencies. the setup script can determine if these
-#are available at runtime, no need to change these
-
-
-
-
 #these modules are required for pygame to run. they only require
 #SDL as a dependency. these should not be altered
 
 # BREAK = change breaks existing code
 # BUG	= fixed a bug that was (or could have been) crashing
 
+March 27, 2002
+	fixes for windows music.get_pos() and windows config
+
 March 23, 2002
 	big config.py update
 	music.get_pos()  (thx Michael Urman)
         line = origsetup.readline()
 
     if string.find(sys.platform, 'darwin') != -1:
-	newsetup.write('EXTRABASE = src/SDLmain.m\n')
+        newsetup.write('EXTRABASE = src/SDLmain.m\n')
     else:
         newsetup.write('EXTRABASE = \n')
     if basepath:
         for d in deps:
             prepdep(d, basepath)
         writesetupfile(deps, basepath)
-
-
-    if os.path.isfile('Setup'):
         print """\nIf you get compiler errors during install, doublecheck
 the compiler flags in the "Setup" file.\n"""
     else:
         print """\nThere was an error creating the Setup file, check for errors
 or make a copy of "Setup.in" and edit by hand."""
-        raise SystemExit
+
 
 
 if __name__ == '__main__': main()
 
 import os, sys, shutil, string
 from glob import glob
+from distutils.sysconfig import get_python_inc
 
 configcommand = os.environ.get('SDL_CONFIG', 'sdl-config')
 configcommand = configcommand + ' --version --cflags --libs'
 
 import os, sys, shutil
 from glob import glob
+from distutils.sysconfig import get_python_inc
 
 huntpaths = ['..', '..\\..', '..\\*', '..\\..\\*']
 
         self.module = module
         self.header = header
  
-    def configure(self, incdirs, libdirs):
+    def configure(self):
         self.found = 1
         if self.module:
             try:
     Dependency('FONT', 'SDL_ttf-[0-9].*', 'SDL_ttf'),
     Dependency('IMAGE', 'SDL_image-[0-9].*', 'SDL_image'),
     Dependency('MIXER', 'SDL_mixer-[0-9].*', 'SDL_mixer'),
-    Dependency('SMPEG', 'smpeg-[0-9].*', 'smpeg')
-    DependencyPython('NUMERIC', 'Numeric', 'Numeric/arrayobject.h')
+    Dependency('SMPEG', 'smpeg-[0-9].*', 'smpeg'),
+    DependencyPython('NUMERIC', 'Numeric', 'Numeric/arrayobject.h'),
 ]
 
 
         reply = raw_input('\nUse the SDL libraries in "prebuilt"? [Y/n]')
         if not reply or reply[0].lower() != 'n':
             return setup_prebuilt()
+            raise SystemExit
 
     global DEPS
     for d in DEPS:
 <a href=ref/Sound.html>Sound</a> || 
 <a href=ref/Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=ref/pygame_cursors.html>cursors</a> || 
-<a href=ref/pygame_sprite.html>sprite</a> || 
-<a href=ref/pygame_version.html>version</a> ||<br>
+<a href=ref/pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>
 <a href=ref/pygame_transform.html#rotate>pygame.transform.rotate</a> - rotate a Surface<br>
 <a href=ref/pygame_transform.html#rotozoom>pygame.transform.rotozoom</a> - smoothly scale and/or rotate an image<br>
 <a href=ref/pygame_transform.html#scale>pygame.transform.scale</a> - scale a Surface to an arbitrary size<br>
-<a href=ref/pygame_version.html#ver>pygame.version.ver</a> - The current pygame version info<br>
 <!--ENDINDEX-->
 </ul>
 
 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/Channel.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>
 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>
 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/Joystick.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>
 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>
 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>
 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/Surface.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>
 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_cdrom.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_constants.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_cursors.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_display.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_draw.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_event.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_font.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_image.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_joystick.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_key.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_mixer.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_mixer_music.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_mouse.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_movie.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_sprite.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_surfarray.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_time.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_transform.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_version.html

-<html>
-<title>pygame.version</title>
-<body bgcolor=#aaeebb text=#000000 link=#331111 vlink=#331111>
-
-
-<table cellspacing=3 width=100%><tr><td bgcolor=#00000>
-<table width=100%><tr><td bgcolor=c2fc20 align=center>
-    <a href=http://www.pygame.org>
-    <img src=../pygame_tiny.gif border=0 width=200 height=60></a><br>
-    <b>pygame&nbsp;&nbsp;&nbsp;documentation</b>
-</td><td bgcolor=6aee28 align=center valign=top width=100%>
-
-	||&nbsp;
-	<a href=http://www.pygame.org>Home</a> &nbsp;||&nbsp;
-	<a href=../index.html>Help Contents</a> &nbsp;||
-	<br>&nbsp;<br>
-
-|| <a href=pygame.html>pygame</a> || 
-<a href=pygame_cdrom.html>cdrom</a> || 
-<a href=pygame_constants.html>constants</a> || 
-<a href=pygame_display.html>display</a> || 
-<a href=pygame_draw.html>draw</a> || 
-<a href=pygame_event.html>event</a> ||<br>
-|| <a href=pygame_font.html>font</a> || 
-<a href=pygame_image.html>image</a> || 
-<a href=pygame_joystick.html>joystick</a> || 
-<a href=pygame_key.html>key</a> || 
-<a href=pygame_mixer.html>mixer</a> || 
-<a href=pygame_mixer_music.html>mixer_music</a> ||<br>
-|| <a href=pygame_mouse.html>mouse</a> || 
-<a href=pygame_movie.html>movie</a> || 
-<a href=pygame_surfarray.html>surfarray</a> || 
-<a href=pygame_time.html>time</a> || 
-<a href=pygame_transform.html>transform</a> ||<br>
-&nbsp;<br>|| <a href=CD.html>CD</a> || 
-<a href=Channel.html>Channel</a> || 
-<a href=Clock.html>Clock</a> || 
-<a href=Font.html>Font</a> || 
-<a href=Joystick.html>Joystick</a> || 
-<a href=Movie.html>Movie</a> ||<br>
-|| <a href=Rect.html>Rect</a> || 
-<a href=Sound.html>Sound</a> || 
-<a href=Surface.html>Surface</a> ||<br>
-&nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
-
-
-</td></tr></table></td></tr></table>
-<br>
-<h2 align=center>pygame.version</h2>
-Simply the current installed pygame version. The version information is
-stored in the regular pygame module as 'pygame.ver'. Keeping the version
-information also available in a separate module allows you to test the
-pygame version without importing the main pygame module.
-<br>&nbsp;<br>
-The python version information should always compare greater than any previous
-releases. (hmm, until we get to versions > 10)
-<br>&nbsp;<br>
-
-<hr>
-
-<table>
-<tr><td><a href=#ver>ver</a></td><td> -
-The current pygame version info</td></tr>
-
-
-</table>
-
-<hr>
-
-<a name=ver><font size=+2><b>ver
-</b></font><br><font size=+1><tt>
-pygame.version.ver 
-</tt></font><ul>
-The ver variable is simply a string containing the version information
-for pygame. An example is "0.5" or "1.0"
-<br>&nbsp;<br>
-</ul><br>&nbsp;<br>
-
-
-<hr>
-</body></html>
 from pygame.rect import Rect
 import pygame.rwobject
 import pygame.surflock
+__version__ = ver
 
 #next, the "standard" modules
 #we still allow them to be missing for stripped down pygame distributions
 
 ver = '1.4.1'
 
-def __hiddendummyfunc():
-    """pygame.version.ver 
-The current pygame version info
-
-The ver variable is simply a string containing the version information
-for pygame. An example is "0.5" or "1.0"
-"""
-    
 #!/usr/bin/env python
 #
 # This is the distutils setup script for pygame.
-# Full instructions are in "docs/fullinstall.txt"
+# Full instructions are in "install.txt" or "install.html"
 #
 # To configure, compile, install, just run this script.
 
 
 
 #get compile info for all extensions
-try:
-    extensions = read_setup_file('Setup')
-except:
-    raise SystemExit, """Error with the "Setup" file,
+try: extensions = read_setup_file('Setup')
+except: raise SystemExit, """Error with the "Setup" file,
 perhaps make a clean copy from "Setup.in"."""
 
 
 #try to find DLLs and copy them too  (only on windows)
 if sys.platform == 'win32':
     tempcompiler = new_compiler()
+    ext = tempcompiler.shared_lib_extension
     for e in extensions:
         paths = []
-        ext = tempcompiler.shared_lib_extension
         for d in e.library_dirs:
              for l in e.libraries:
                     name = tempcompiler.shared_lib_format%(l, ext)
 #of willy-nilly
 class smart_install_data(install_data):   
     def run(self):
-        #need to change self.install_dir to the library dir
-
+        #need to change self.install_dir to the actual library dir
         install_cmd = self.get_finalized_command('install')
         self.install_dir = getattr(install_cmd, 'install_lib')
         return install_data.run(self)
 
 static Mix_Music* current_music = NULL;
 static int endmusic_event = SDL_NOEVENT;
-static long long int music_pos = 0;
-static long int music_pos_time = -1;
+static Uint64 music_pos = 0;
+static long music_pos_time = -1;
 static int music_frequency = 0;
 static Uint16 music_format = 0;
 static int music_channels = 0;
 
 static PyObject* get_pos(PyObject* self, PyObject* args)
 {
-	long int ticks;
+	long ticks;
 
 	if(!PyArg_ParseTuple(args, ""))
 		return NULL;
 	if (music_pos_time < 0)
 		return PyLong_FromLong(-1);
 
-	ticks = 1000 * music_pos /
-		(music_channels * music_frequency * ((music_format & 0xff) >> 3));
+	ticks = (long)(1000 * music_pos /
+		(music_channels * music_frequency * ((music_format & 0xff) >> 3)));
 	ticks += SDL_GetTicks() - music_pos_time;
 
 	return PyInt_FromLong((long)ticks);
 */
 
 #include"pygame.h"
-#include<arrayobject.h>
+#include<Numeric/arrayobject.h>
 #include<SDL_byteorder.h>