projects
/
perl-landing-airplanes.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2bd4d95
)
rename colors
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 19 May 2010 17:29:34 +0000
(19:29 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Wed, 19 May 2010 17:29:34 +0000
(19:29 +0200)
trace-path.pl
patch
|
blob
|
history
diff --git
a/trace-path.pl
b/trace-path.pl
index
258206d
..
05dccdd
100755
(executable)
--- a/
trace-path.pl
+++ b/
trace-path.pl
@@
-38,9
+38,9
@@
our $event = SDL::Event->new;
our $mouse_down = 0;
our $mouse_down = 0;
-our $
white = SDL::Color->new( 0xff, 0xff, 0xff
);
-our $
red
= SDL::Color->new( 0xff, 0x00, 0x00 );
-our $black = SDL::Color->new( 0x00, 0x00, 0x00 );
+our $
mouse_color = SDL::Color->new( 0x00, 0x80, 0x00
);
+our $
path_color
= SDL::Color->new( 0xff, 0x00, 0x00 );
+our $black
= SDL::Color->new( 0x00, 0x00, 0x00 );
my ( $last_x, $last_y ) = ( 0,0 );
my ( $last_x, $last_y ) = ( 0,0 );
@@
-63,7
+63,7
@@
sub curve {
int($curve[$i++]),
int($curve[$i++]),
int($curve[$i++]),
int($curve[$i++]),
int($curve[$i++]),
int($curve[$i++]),
- sub { $app->pixel( @_, $
red
) }
+ sub { $app->pixel( @_, $
path_color
) }
);
}
$app->sync;
);
}
$app->sync;
@@
-111,7
+111,7
@@
sub handle_events {
if ( $#path < $max_path_length ) {
push @path, $x, $y;
my $rect = SDL::Rect->new( -x => $event->motion_x - 1, -y => $event->motion_y -1 , -w => 3, -h => 3 );
if ( $#path < $max_path_length ) {
push @path, $x, $y;
my $rect = SDL::Rect->new( -x => $event->motion_x - 1, -y => $event->motion_y -1 , -w => 3, -h => 3 );
- $app->fill( $rect, $
white
);
+ $app->fill( $rect, $
mouse_color
);
$app->update( $rect );
$last_x = $x;
$last_y = $y;
$app->update( $rect );
$last_x = $x;
$last_y = $y;