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.86 by root, Tue Oct 5 22:33:10 2010 UTC vs.
Revision 1.91 by root, Tue Oct 5 23:52:52 2010 UTC

154 "--exclude", "CVS", "--exclude", "/world-precomposed", 154 "--exclude", "CVS", "--exclude", "/world-precomposed",
155 "--delete", "--delete-excluded" 155 "--delete", "--delete-excluded"
156 and die "map installation failed.\n"; 156 and die "map installation failed.\n";
157 157
158 print "maps installed successfully.\n"; 158 print "maps installed successfully.\n";
159}
160
161our %WALL_SUFFIX = (
162 "0" => "⬤",
163 "1_3" => "╸",
164 "1_4" => "╺",
165 "2_1_2" => "━",
166
167 "1_2" => "╹",
168 "2_2_4" => "┛",
169 "2_2_1" => "┗",
170 "3_1" => "┻",
171
172 "1_1" => "╻",
173 "2_2_3" => "┓",
174 "2_2_2" => "┏",
175 "3_3" => "┳",
176
177 "2_1_1" => "┃",
178 "3_4" => "┫",
179 "3_2" => "┣",
180 "4" => "╋",
181);
182
183sub autoglyph {
184 my ($stem, $face) = @_;
185
186 if ($stem =~ /^wall\/|Nimwall/) {
187 while (my ($k, $v) = each %WALL_SUFFIX) {
188 return $v if $stem =~ /_$k.x11/;
189 }
190
191 "+"
192
193 } elsif ($stem =~ /^floor\/|^ground\/|Nimfloor/) {
194 "."
195
196 } elsif ($stem =~ /^player\//) {
197 "\@"
198
199 } else {
200 substr $stem, 0, 1
201 }
159} 202}
160 203
161{ 204{
162 our %ANIMINFO; 205 our %ANIMINFO;
163 our %FACEINFO; 206 our %FACEINFO;
800 make_hash $k, $v->{data64}, $v->{hash64}; 843 make_hash $k, $v->{data64}, $v->{hash64};
801 844
802 #length $v->{data32} <= 10000 or warn "$k: face32 larger than 10000 bytes, will not work with crossfire client.\n"; 845 #length $v->{data32} <= 10000 or warn "$k: face32 larger than 10000 bytes, will not work with crossfire client.\n";
803 #length $v->{data64} <= 10000 or warn "$k: face64 larger than 10000 bytes.\n"; 846 #length $v->{data64} <= 10000 or warn "$k: face64 larger than 10000 bytes.\n";
804 847
805 my $stem = delete $v->{stem};
806 $v->{glyph} //= substr $stem, 0, 1;
807
808 if (my $magicmap = $v->{magicmap}) { 848 if (my $magicmap = $v->{magicmap}) {
809 $magicmap =~ y/A-Z_\-/a-z/d; 849 $magicmap =~ y/A-Z_\-/a-z/d;
810 $v->{magicmap} = $COLOR{$magicmap}; 850 $v->{magicmap} = $COLOR{$magicmap};
811 } 851 }
852
853 my $stem = delete $v->{stem};
854 $v->{glyph} //= autoglyph $stem, $v;
855 $v->{glyph} = (chr $v->{magicmap}) . $v->{glyph};
812 856
813 delete $v->{arc}; 857 delete $v->{arc};
814 } 858 }
815 859
816 print "processing resources...\n" if $VERBOSE; 860 print "processing resources...\n" if $VERBOSE;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines