Skip Menu |

This queue is for tickets about the OpenGL-Earth CPAN distribution.

Report information
The Basics
Id: 42875
Status: resolved
Worked: 30 min
Priority: 0/
Queue: OpenGL-Earth

People
Owner: cosimo [...] cpan.org
Requestors: TONYC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.03
Fixed in: (no value)



Subject: documentation refers to bin/build_texture.pl which isn't included.
From the documentation: If you want to use the higher resolution texture, either find it yourself, or write me, or generate one by yourself with the bin/build_texture.pl utility I wrote. You will need the mighty Imager module for that. but no such file is included in the distribution, and I don't see any other indication of where to obtain it.
Yes, a stupid Makefile problem. v0.04 is on its way to CPAN. BTW, thanks for the amazing Imager. And let me know if you manage to run this application... :-)
#!/usr/bin/env perl # # Used to build binary data suitable to feed to OpenGL # texture functions. Supply a bmp/jpeg/whatever your local # Imager can read, and get back a .texture file. # # $Id$ BEGIN { $| = 1 } use strict; use warnings; use Imager; if (! @ARGV) { die "Usage: $0 <file.(jpg|bmp|png)>\n"; } my $scanline; my $tex = q{}; my $pic = Imager->new(); print "Reading bitmap...\n"; $pic->read(file=>$ARGV[0]) or die "Can't read texture bitmap!\n"; print "Reading scanlines... "; my $tex_w = $pic->getwidth(); my $tex_h = $pic->getheight(); my $perc = 0; # Read bitmap image one scanline at a time for (my $y = $tex_h - 1; $y >= 0; $y--) { $scanline = $pic->getscanline( y => $y ); $tex .= $scanline; $perc = int (100 * ($tex_h - 1 - $y) / $tex_h); print "$perc% \r"; } print "\rTexture built.\n"; open my $texf, '>', $ARGV[0] . '.texture'; binmode $texf; print $texf $tex; close $texf;