#!/usr/bin/perl use strict; use warnings; my @res = qw/convert interlace merge shadeboost tfx/; my $path = "plugins/GSdx/res"; foreach my $r (@res) { glsl2h($path, $r); } sub glsl2h { my $path = shift; my $glsl = shift; open(my $GLSL, "<$path/${glsl}.glsl"); open(my $H, ">$path/${glsl}.h"); my $header = <)) { chomp $line; $line =~ s/%/\\%/g; $line =~ s/"/\\"/g; print $H "\t\"$line\\n\"\n"; } print $H "\t;\n"; }