1. pygame
  2. Untitled project
  3. pygame

Commits

illume  committed e5f5790

Some fixes from John Popplewell. Thanks!

Makes it compile on windows with msvc.

Typos and other fixes in scrap,
reference counting bug fixes in image saving code.

Better checking for when there is no jpeg compiled in.

  • Participants
  • Parent commits df5170c
  • Branches default

Comments (0)

Files changed (4)

File src/image.c

View file
 		Py_INCREF(extload);
 		Py_INCREF(extsave);
 		Py_INCREF(extload);
+                Py_DECREF(extmodule);
 		is_extended = 1;
 	}
 	else

File src/imageext.c

View file
 SDL_Surface* opengltosdl(void);
 
 
+
 static char* find_extension(char* fullname)
 {
 	char* dot;
                           ) {
 #ifdef JPEGLIB_H
 		    result = SaveJPEG(surf, name);
-#elif
+#else
                     return RAISE(PyExc_SDLError, "No support for jpg compiled in.");
 #endif
 
                 else if(name[namelen-1]=='g' || name[namelen-1]=='G') {
 #ifdef PNG_H
 		    result = SavePNG(surf, name);
-#elif
+#else
                     return RAISE(PyExc_SDLError, "No support for png compiled in.");
 #endif
                 }

File src/overlay.c

View file
 
     if(src_y)
 	{
-		void *dst_y=0, *dst_u=0, *dst_v=0;
+                Uint8 *dst_y=0, *dst_u=0, *dst_v=0;
 		SDL_LockYUVOverlay( self->cOverlay );
 
 		// No clipping at this time( only support for YUV420 )
-		dst_y = (void*)self->cOverlay->pixels[ 0 ];
-		dst_v = (void*)self->cOverlay->pixels[ 1 ];
-		dst_u = (void*)self->cOverlay->pixels[ 2 ];
+
+                dst_y = self->cOverlay->pixels[ 0 ];
+                dst_v = self->cOverlay->pixels[ 1 ];
+                dst_u = self->cOverlay->pixels[ 2 ];
+
 		for (y=0; y< self->cOverlay->h; y++)
 		{
 			memcpy( dst_y, src_y, self->cOverlay->w );

File src/scrap.c

View file
 
 #elif defined(WIN_SCRAP)
         SDL_Window = info.window;
-        retval = 1
+        retval = 1;
 
 #elif defined(QNX_SCRAP)
         InputGroup = PhInputGroup (NULL);
-        retval = 1
+        retval = 1;
 
 #endif /* scrap type */
     }
 {
     scrap_type format;
     int nulledlen = srclen + 1;
+#if defined(WIN_SCRAP)
+    HANDLE hMem;
+#endif
+
+
 
     if (!pygame_scrap_initialized ())
     {
     Unlock_Display ();
 
 #elif defined(WIN_SCRAP)
-    HANDLE hMem;
     
     if (!OpenClipboard (SDL_Window))
         return 0; /* Could not open the clipboard. */