/[VRac]/Screen.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /Screen.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 126 by dpavlin, Sat Aug 4 15:43:28 2007 UTC revision 148 by dpavlin, Sun Aug 5 14:08:01 2007 UTC
# Line 45  sub open_screen { Line 45  sub open_screen {
45                  -width  => 256 * $self->scale + ( $self->show_mem ? 256 : 0 ),                  -width  => 256 * $self->scale + ( $self->show_mem ? 256 : 0 ),
46                  -height => 256 * $self->scale,                  -height => 256 * $self->scale,
47                  -depth  => 16,                  -depth  => 16,
48                    -flags=>SDL_DOUBLEBUF | SDL_HWSURFACE | SDL_HWACCEL,
49          );          );
50          #$app->grab_input( SDL_GRAB_QUERY );          #$app->grab_input( SDL_GRAB_QUERY );
51          $app->grab_input( SDL_GRAB_OFF );          $app->grab_input( SDL_GRAB_OFF );
52            $app->title( ref($self) . ' ' . $self::VERSION );
53    
54          $self->app( $app );          $self->app( $app );
55    
# Line 64  my $red                = SDL::Color->new( -r => 0xff, Line 66  my $red                = SDL::Color->new( -r => 0xff,
66  my $green       = SDL::Color->new( -r => 0x00, -g => 0xff, -b => 0x00 );  my $green       = SDL::Color->new( -r => 0x00, -g => 0xff, -b => 0x00 );
67  my $blue        = SDL::Color->new( -r => 0x00, -g => 0x00, -b => 0xff );  my $blue        = SDL::Color->new( -r => 0x00, -g => 0x00, -b => 0xff );
68    
 my $rect_mem = SDL::Rect->new( -x => 256, -y => 0, -width => 256, -height => 256 );  
   
69  =head2 mem_xy  =head2 mem_xy
70    
71  Helper to return x and y coordinates in memory map  Helper to return x and y coordinates in memory map
# Line 154  sub render_frame { Line 154  sub render_frame {
154    
155          my $scale = $self->scale || confess "no scale?";          my $scale = $self->scale || confess "no scale?";
156    
157          my $rect                = SDL::Rect->new( -x => 0, -y => 0, -width => 256 * $scale, -height => 256 * $scale );          my $rect        = SDL::Rect->new( -x => 0, -y => 0, -width => 256 * $scale, -height => 256 * $scale );
158          my $rect_screen = SDL::Rect->new( -x => 0, -y => 0, -width => 256 * $scale, -height => 256 * $scale );          my $rect_screen = SDL::Rect->new( -x => 0, -y => 0, -width => 256 * $scale, -height => 256 * $scale );
159    
160          if ( $scale > 1 ) {          if ( $scale > 1 ) {
# Line 196  sub render_mem { Line 196  sub render_mem {
196    
197          $vram->display_format;          $vram->display_format;
198    
199          my $rect = SDL::Rect->new( -x => 0, -y => 0, -width => 256, -height => 256 );          my $rect     = SDL::Rect->new( -x => 0, -y => 0, -width => 256, -height => 256 );
200            my $rect_mem = SDL::Rect->new( -x => 256 * $self->scale, -y => 0, -width => 256, -height => 256 );
201    
202          $vram->blit( $rect, $app, $rect_mem );          $vram->blit( $rect, $app, $rect_mem );
203    
204          $app->sync;          $app->sync;
# Line 261  sub key_pressed { Line 263  sub key_pressed {
263                  undef $pending_key;                  undef $pending_key;
264          }          }
265    
266          warn "key_pressed = $pending_key\n" if $pending_key;          if ( $pending_key ) {
267                    warn "key_pressed = $pending_key\n";
268                    $self->record_session('key_pressed', $pending_key);
269            }
270    
271          return $pending_key;          return $pending_key;
272  }  }
# Line 307  This program is free software; you can r Line 312  This program is free software; you can r
312  under the same terms as Perl itself.  under the same terms as Perl itself.
313    
314  =cut  =cut
315    
316  1;  1;

Legend:
Removed from v.126  
changed lines
  Added in v.148

  ViewVC Help
Powered by ViewVC 1.1.26