Skip to content

Commit 02a6dc0

Browse files
committed
no need widthpix as list nor keep other intermediates
1 parent b242dd6 commit 02a6dc0

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

  • lib/PDL/Graphics/TriD

lib/PDL/Graphics/TriD/GL.pm

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ fs_out_light => <<'EOF',
110110
light(lightind, vPosition, gl_FrontFacing ? vNormal : -vNormal, in_diffuse, diffuse, spec);
111111
gl_FragColor = gl_FrontLightProduct[lightind].ambient + diffuse + spec;
112112
EOF
113-
fs_lightind_decl => " uniform int lightind;\n",
113+
fs_lightind_decl => "uniform int lightind;\n",
114114
);
115115

116116
{ package # hide from PAUSE
@@ -371,21 +371,20 @@ sub _font_setup {
371371
my ($texture, $rightbound, $orig) = gl_font_texture();
372372
$fref->{texture} = PDL::float(1,1,1,1) * $texture->dummy(0,1);
373373
my $widthpix = $rightbound->numdiff; $widthpix->slice('0') += 1;
374-
@{ $fref->{widthpix} } = $widthpix->list;
375374
$fref->{widthflt} = $widthpix->float;
376375
$fref->{widthflt11} = $fref->{widthflt}->t->append([1,1])->dummy(1);
377376
$fref->{heightpix} = $texture->dim(1);
378377
$fref->{numchars} = my $numchars = $rightbound->nelem;
379-
$fref->{texwidthm1} = my $texwidthm1 = $texture->dim(0) - 1;
380-
$fref->{leftbound} = my $leftbound = $rightbound->rotate(1) + 1;
378+
my $texwidthm1 = $texture->dim(0) - 1;
379+
my $leftbound = $rightbound->rotate(1) + 1;
381380
$leftbound->slice('0') .= 0; $leftbound->set_datatype(PDL::float->enum);
382-
$fref->{rightbound} = $rightbound = $rightbound->float;
381+
$rightbound = $rightbound->float;
383382
$_ /= $texwidthm1 for $leftbound, $rightbound;
384383
@$fref{qw(xorig yorig)} = $orig->list;
385384
$fref->{texture} = PDL::float(1,1,1,1) * $texture->dummy(0,1);
386385
# 4 = top-left, bot-left, top-right, bot-right, triangle idx=012,213
387386
$fref->{idx} = PDL->new(PDL::ulong, [0,1,2], [2,1,3]);
388-
$fref->{texcoords} = my $texcoords = PDL->zeroes(PDL::float,2,4,$numchars);
387+
my $texcoords = $fref->{texcoords} = PDL->zeroes(PDL::float,2,4,$numchars);
389388
$texcoords->slice('(0),0:1') .= $leftbound->dummy(0,1); # u of left
390389
$texcoords->slice('(0),2:3') .= $rightbound->dummy(0,1); # u of right
391390
$texcoords->slice('(1),0::2') .= 1; # v of top, v bot=already 0

0 commit comments

Comments
 (0)