ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/utils/cfutil.in
(Generate patch)

Comparing deliantra/server/utils/cfutil.in (file contents):
Revision 1.116 by root, Sun May 15 20:14:30 2011 UTC vs.
Revision 1.120 by root, Wed Jan 4 03:22:28 2012 UTC

1#!@PERL@ 1#!@PERL@
2 2
3# 3#
4# This file is part of Deliantra, the Roguelike Realtime MMORPG. 4# This file is part of Deliantra, the Roguelike Realtime MMORPG.
5# 5#
6# Copyright (©) 2007,2008,2009,2010,2011 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 6# Copyright (©) 2007,2008,2009,2010,2011,2012 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
7# 7#
8# Deliantra is free software: you can redistribute it and/or modify it under 8# Deliantra is free software: you can redistribute it and/or modify it under
9# the terms of the Affero GNU General Public License as published by the 9# the terms of the Affero GNU General Public License as published by the
10# Free Software Foundation, either version 3 of the License, or (at your 10# Free Software Foundation, either version 3 of the License, or (at your
11# option) any later version. 11# option) any later version.
761 $meta = { 761 $meta = {
762 %{ $meta->{"" } || {} }, 762 %{ $meta->{"" } || {} },
763 %{ $meta->{$file} || {} }, 763 %{ $meta->{$file} || {} },
764 }; 764 };
765 765
766 if ($meta->{license} =~ s/^#//) { 766 if (exists $meta->{license} && $meta->{license} =~ s/^#//) { # exists == avoid autovivification
767 $meta->{license} = ({ 767 $meta->{license} = ({
768 "pd" => "Public Domain", 768 "pd" => "Public Domain",
769 "gpl" => "GNU General Public License, version 3.0 or any later", 769 "gpl" => "GNU General Public License, version 3.0 or any later",
770 "cc/by/2.0" => "Licensed under Creative Commons Attribution 2.0 http://creativecommons.org/licenses/by/2.0/", 770 "cc/by/2.0" => "Licensed under Creative Commons Attribution 2.0 http://creativecommons.org/licenses/by/2.0/",
771 "cc/by/2.1" => "Licensed under Creative Commons Attribution 2.1 http://creativecommons.org/licenses/by/2.1/", 771 "cc/by/2.1" => "Licensed under Creative Commons Attribution 2.1 http://creativecommons.org/licenses/by/2.1/",
782 $file =~ s/\.res$//; 782 $file =~ s/\.res$//;
783 $file =~ s/\.(ogg|wav|jpg|png)$//; 783 $file =~ s/\.(ogg|wav|jpg|png)$//;
784 784
785 if ($file =~ s/\.plt$//) { 785 if ($file =~ s/\.plt$//) {
786 $data = process_plt "$dir/$file", $data; 786 $data = process_plt "$dir/$file", $data;
787 } elsif (my $filter = $meta->{cfutil_filter}) { 787 } elsif (my $filter = delete $meta->{cfutil_filter}) {
788 if ($filter eq "yaml2json") { 788 if ($filter eq "yaml2json") {
789 $data = JSON::XS::encode_json YAML::XS::Load $data; 789 $data = JSON::XS::encode_json YAML::XS::Load $data;
790 } elsif ($filter eq "json2json") { 790 } elsif ($filter eq "json2json") {
791 $data = JSON::XS::encode_json JSON::XS->relaxed->utf8->decode ($data); 791 $data = JSON::XS::encode_json JSON::XS->relaxed->utf8->decode ($data);
792 } elsif ($filter eq "perl2json") { 792 } elsif ($filter eq "perl2json") {
844 if ($file =~ /\.(jpg|png)$/) { 844 if ($file =~ /\.(jpg|png)$/) {
845 $c_any->put ([\&process_res, $path, $file, 0]) # FT_FACE 845 $c_any->put ([\&process_res, $path, $file, 0]) # FT_FACE
846 } elsif ($file =~ /\.(res)$/) { 846 } elsif ($file =~ /\.(res)$/) {
847 $c_any->put ([\&process_res, $path, $file, 6]) # FT_RSRC 847 $c_any->put ([\&process_res, $path, $file, 6]) # FT_RSRC
848 } else { 848 } else {
849 $c_any->put ([\&process_res, $path, $file, undef]); 849 $c_any->put ([\&process_res, $path, $file, 6]); # was type undef, but now meta files are mandatory, so any mentioned file surely has a purpose
850 } 850 }
851 851
852 } elsif ($file =~ /\.png$/) { 852 } elsif ($file =~ /\.png$/) {
853 $PNG{$file} = $path; 853 $PNG{$file} = $path;
854 854
926 926
927 $c_arc->shutdown; 927 $c_arc->shutdown;
928 $c_any->shutdown; 928 $c_any->shutdown;
929 929
930 $_->join for @a_arc; # need to parse all archetypes before png processing 930 $_->join for @a_arc; # need to parse all archetypes before png processing
931 print "ended arc processing...\n" if $VERBOSE; 931 print "finished arc processing...\n" if $VERBOSE;
932 932
933 # fill png queue 933 # fill png queue
934 for (keys %FACEINFO) { 934 for (keys %FACEINFO) {
935 # we only expect source pngs to exist for non-derived 935 # we only expect source pngs to exist for non-derived
936 # faces, i.e. no split tiles (+x+x) and no face derivates 936 # faces, i.e. no split tiles (+x+x) and no face derivates
957 957
958 # eight png crunchers work fine for my 4x smp machine 958 # eight png crunchers work fine for my 4x smp machine
959 my @a_png = map +(async \&process_png), 1..8; 959 my @a_png = map +(async \&process_png), 1..8;
960 960
961 $_->join for @a_any; 961 $_->join for @a_any;
962 print "ended any processing...\n" if $VERBOSE; 962 print "finished any processing...\n" if $VERBOSE;
963 963
964 $_->join for @a_png; 964 $_->join for @a_png;
965 print "ended png processing...\n" if $VERBOSE; 965 print "finished png processing...\n" if $VERBOSE;
966 966
967 print "scanning done, processing results...\n" if $VERBOSE; 967 print "scanning done, processing results...\n" if $VERBOSE;
968 { 968 {
969 # remove path prefix from editor_folder 969 # remove path prefix from editor_folder
970 $_->{editor_folder} =~ /^\x00/ 970 $_->{editor_folder} =~ /^\x00/

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines