Fix bug with TTFSizeText, it actually returns 0 on success
Leon Brocard [Sun, 11 Oct 2009 13:55:47 +0000 (14:55 +0100)]
src/SDL.xs

index 01c5171..7f30468 100644 (file)
@@ -2930,15 +2930,14 @@ TTFSizeText ( font, text )
                RETVAL = newAV();
                if(TTF_SizeText(font,text,&w,&h))
                {
-                       av_push(RETVAL,newSViv(w));
-                       av_push(RETVAL,newSViv(h));
-                       sv_2mortal((SV*)RETVAL);
+                       printf("TTF error at TTFSizeText: %s \n", TTF_GetError());
+                       Perl_croak (aTHX_ "TTF error \n");
                }
                else
                {
-                        printf("TTF error at TTFSizeText: %s \n", TTF_GetError()); 
-                        Perl_croak (aTHX_ "TTF error \n");     
-       
+                       av_push(RETVAL,newSViv(w));
+                       av_push(RETVAL,newSViv(h));
+                       sv_2mortal((SV*)RETVAL);
                }