PangZero/FpsIndicator.pm untested

filter: Statementstmt 0.0% 0 / 11 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 15 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
Draw
2.0
CRAP 2.0
1 ##########################################################################
2 package Games::PangZero::FpsIndicator;
3 ##########################################################################
4  
5 @ISA = qw(Games::PangZero::GameObject);
6  
7 sub new {
8 my ($class) = @_;
9 my $self = Games::PangZero::GameObject->new();
10 my $width = Games::PangZero::Graphics::TextWidth("999");
11 %{$self} = ( %{$self},
12 'x' => $Games::PangZero::ScreenWidth - $width + $Games::PangZero::ScreenMargin,
13 'y' => -$Games::PangZero::ScreenMargin,
14 'w' => $width,
15 'h' => 32,
16 );
17
18 $self->TransferRect();
19 bless $self, $class;
20 }
21  
22 sub Draw {
23 my $self = shift;
24
25 SDLx::SFont::print_text( $Games::PangZero::App, $self->{rect}->x, $self->{rect}->y, Games::PangZero::GameTimer::GetFramesPerSecond() );
26  
27 }
28  
29 1;