Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cleaned up TTF

  • Loading branch information...
commit 5bb5838af8643245dc4a9c2490391895b492959a 1 parent c25576f
@kthakore kthakore authored
Showing with 3 additions and 49 deletions.
  1. +3 −0  CHANGELOG
  2. +0 −44 lib/SDLx/Surface.pm
  3. +0 −5 t/sdlx_surface.t
View
3  CHANGELOG
@@ -1,5 +1,8 @@
Revision history for Perl extension SDL_perl.
+* 2.515
+ - Added SDLx::Sound [rflipo]
+
* 2.514
- Made SDLx::Controller::Interface [kthakore]
- Fixed unsigned int bug for get_pixels from surface [kthakore]
View
44 lib/SDLx/Surface.pm
@@ -15,8 +15,6 @@ use SDL::Surface;
use SDL::PixelFormat;
use SDL::GFX::Primitives;
-use SDL::TTF;
-use SDL::TTF::Font;
use Tie::Simple;
use SDLx::Validate;
@@ -39,9 +37,6 @@ bootstrap SDLx::Surface;
# Inside out object
my %_tied_array;
-# Keep track of if TTF was inited or not
-my %_ttf;
-
sub new {
my ( $class, %options ) = @_;
my $self;
@@ -384,48 +379,9 @@ sub draw_gfx_text {
return $self;
}
-sub draw_ttf_text {
- my ( $self, $position, $font, $size, $color, $text, $style ) = @_;
-
- unless ( SDL::Config->has('SDL_ttf') ) {
- Carp::cluck("SDL_ttf support has not been compiled");
- }
- unless ( SDL::TTF::was_init() )
- {
- Carp::cluck ("Cannot init TTF: " . SDL::get_error() ) unless SDL::TTF::init() == 0;
- $_ttf{ $$self } = {};
- $_ttf{ $$self }->{inited} = 1;
- $_ttf{ $$self }->{style} = {
- normal => TTF_STYLE_NORMAL,
- bold => TTF_STYLE_BOLD,
- italic => TTF_STYLE_ITALIC,
- underline => TTF_STYLE_UNDERLINE,
- strikethrough => TTF_STYLE_STRIKETHROUGH
- };
- }
-
- my $ttf_font;
- unless (my $ttf_font = SDL::TTF::open_font($font, $size ))
- {
-
- Carp::cluck ("Cannot make a TTF font from location ($font) or size($size), due to: ". SDL::get_error );
-
- }
-
- if ( $style && ( my $t_style = $_ttf{ $$self }->{style}->{$style} ) )
- {
- SDL::TTF::set_font_style($ttf_font, $t_style);
- }
-
-}
-
-
-
sub DESTROY {
my $self = shift;
delete $_tied_array{$$self};
- SDL::TTF::quit if $_ttf{$$self}->{inited};
- delete $_ttf{$$self};
}
1;
View
5 t/sdlx_surface.t
@@ -180,11 +180,6 @@ is( $surf_dup->format->BitsPerPixel,
'Duplicate surf has same bpp'
);
-
-#TTF test
-
-$surf_dup->draw_ttf_text( [10,10], 'test/data/aircut3.ttf', 24, 0xFF00FFFF, 'Foo');
-
if ($videodriver) {
$ENV{SDL_VIDEODRIVER} = $videodriver;
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.