# HG changeset patch # User Axel Jacobs # Date 1385853938 0 # Node ID 3e70c0b64ec790fda30d1e4c7b02568f077aa40e # Parent eaa48934a5bd19e5a7008668830d2a503e4b714d objview: Working and tested under LINUX and Vista. diff -r eaa48934a5bd -r 3e70c0b64ec7 bin/objview.pl --- a/bin/objview.pl Sat Nov 30 23:25:26 2013 +0000 +++ b/bin/objview.pl Sat Nov 30 23:25:38 2013 +0000 @@ -7,7 +7,7 @@ # The only extra functionality is that we accept a scene on STDIN # if no file name is given. # -# Axel, Oct 2010 +# Axel, Nov 2013 use strict; use warnings; @@ -31,6 +31,9 @@ while (@ARGV) { $_ = $ARGV[0]; if (m/-g/) { # OpenGL output + if ( $^O =~ /MSWin32/ ) { + die("OpenGL view is not available under Windows.\n"); + } $usegl = 1; } elsif (m/-u/) { # up direction $up = $ARGV[1]; @@ -80,12 +83,10 @@ # Make sure we don't confuse glrad and rad options. if ($usegl) { if ($radopt) { - #system "glrad"; # Why are we launching glrad anyhow? die("objview: glrad output requested, but rad option passed.\n"); } } else { if ($glradopt) { - #system "rad"; die("objview: rad output requested, but glrad option passed.\n"); } } @@ -102,11 +103,25 @@ EndOfLights close(FH); -my $scenes = join(' ', @ARGV) . " $lights"; +my @scenes = @ARGV; +push (@scenes, $lights); + +# Make this work under Windoze +if ( $^O =~ /MSWin32/ ) { + for my $i (0 .. $#scenes) { + # rad doesn't like Windows-style backslashes. + $scenes[$i] =~ s{\\}{/}g; + } + $octree =~ s{\\}{/}g; + $ambf =~ s{\\}{/}g; + $raddev = "qt"; +} + +my $scene = join(' ', @scenes); open(FH, ">$rif") or die("objview: Can't write to temporary file $rif\n"); print FH <