
to draw those, and hit test with the mouse, and display tool tips when the user hovers with the mouse. Also, underline links only when they're hovered, and not otherwise. And add a separate menu option to align the view to the active workplane, vs. activating the active group's workplane, and remap the bottom two graphics window toolbar icons to that and "nearest iso view" instead of draw in 2d/3d, since people tended to click on those without understanding and cause trouble. And by default, we force a parallel projection; so the factory default camera tangent is now 0.3, not 0. [git-p4: depot-paths = "//depot/solvespace/": change = 2131]
41 lines
973 B
Perl
41 lines
973 B
Perl
#!/usr/bin/perl
|
|
|
|
use GD;
|
|
|
|
my ($out, $proto) = @ARGV;
|
|
open(OUT, ">$out") or die "$out: $!";
|
|
open(PROTO, ">$proto") or die "$proto: $!";
|
|
|
|
for $file (<icons/*.png>) {
|
|
|
|
$file =~ m#.*/(.*)\.png#;
|
|
$base = "Icon_$1";
|
|
$base =~ y/-/_/;
|
|
|
|
open(PNG, $file) or die "$file: $!\n";
|
|
$img = newFromPng GD::Image(\*PNG) or die;
|
|
$img->trueColor(1);
|
|
|
|
close PNG;
|
|
|
|
($width, $height) = $img->getBounds();
|
|
die "$file: $width, $height" if ($width != 24) or ($height != 24);
|
|
|
|
print PROTO "extern unsigned char $base\[24*24*3\];";
|
|
print OUT "unsigned char $base\[24*24*3] = {\n";
|
|
|
|
for($y = 0; $y < 24; $y++) {
|
|
for($x = 0; $x < 24; $x++) {
|
|
$index = $img->getPixel($x, 23-$y);
|
|
($r, $g, $b) = $img->rgb($index);
|
|
if($r + $g + $b < 11) {
|
|
($r, $g, $b) = (30, 30, 30);
|
|
}
|
|
printf OUT " 0x%02x, 0x%02x, 0x%02x,\n", $r, $g, $b;
|
|
}
|
|
}
|
|
|
|
print OUT "};\n\n";
|
|
|
|
}
|