Added fix for SDL::Surface->format. Fixed test and typemap if SDL::NULL (0) is passed...
[sdlgit/SDL_perl.git] / src / Core / objects / Surface.xs
index 574731c..d0e96ac 100644 (file)
@@ -48,8 +48,9 @@ surface_new (CLASS, flags, width, height, depth, Rmask, Gmask, Bmask, Amask )
 SDL_PixelFormat *
 surface_format ( surface )
        SDL_Surface *surface
-       CODE:
+       PREINIT:
                char* CLASS = "SDL::PixelFormat";
+       CODE:
                RETVAL = surface->format;
        OUTPUT:
                RETVAL