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.43 by root, Mon Jul 23 23:38:18 2007 UTC vs.
Revision 1.44 by root, Tue Jul 24 04:55:35 2007 UTC

390 } 390 }
391 } 391 }
392 392
393 sub process_res { 393 sub process_res {
394 while (@res) { 394 while (@res) {
395 my ($dir, $file) = @{pop @res}; 395 my ($dir, $file, $type) = @{pop @res};
396 396
397 my $data; 397 my $data;
398 aio_load "$dir/$file", $data; 398 aio_load "$dir/$file", $data;
399 399
400 my $copyright; 400 my $copyright;
402 402
403 $file =~ s/\.res$//; 403 $file =~ s/\.res$//;
404 $file =~ /\.([^.]+)$/ 404 $file =~ /\.([^.]+)$/
405 or next; 405 or next;
406 406
407 my $type = $1;
408
409 substr $dir, 0, 1 + length $PATH, ""; 407 substr $dir, 0, 1 + length $PATH, "";
410 408
411 $RESOURCE{"$dir/$file"} = { 409 $RESOURCE{"$dir/$file"} = {
412 type => $1, 410 type => $type,
413 copyright => $copyright, 411 copyright => $copyright,
414 data => $data, 412 data => $data,
415 chksum => Digest::MD5::md5 $data, 413 chksum => Digest::MD5::md5 $data,
416 }; 414 };
417 } 415 }
430 428
431 my $dir = $path; 429 my $dir = $path;
432 substr $dir, 0, 1 + length $PATH, ""; 430 substr $dir, 0, 1 + length $PATH, "";
433 431
434 for my $file (@$nondirs) { 432 for my $file (@$nondirs) {
435 if ($file =~ /\.(ogg|jpg|res)$/ || $dir =~ /^res(?:\/|$)/) { 433 if ($dir =~ /^music(?:\/|$)/) {
434 push @res, [$path, $file, 3] # FT_MUSIC
435 if $file =~ /\.(ogg)$/;
436
437 } elsif ($dir =~ /^sounds(?:\/|$)/) {
438 push @res, [$path, $file, 5] # FT_SOUND
439 if $file =~ /\.(wav|ogg)$/;
440
441 } elsif ($dir =~ /^res(?:\/|$)/) {
436 push @res, [$path, $file]; 442 push @res, [$path, $file, 0] # FT_FACE
443 if $file =~ /\.(jpg|png)$/;
444 push @res, [$path, $file, 7] # FT_RSRC
445 if $file =~ /\.(res)$/;
446
437 } elsif ($file =~ /\.png$/) { 447 } elsif ($file =~ /\.png$/) {
438 push @png, ["$path/$file", 0]; 448 push @png, ["$path/$file", 0];
449
439 } elsif ($file =~ /\.trs$/) { 450 } elsif ($file =~ /\.trs$/) {
440 push @trs, [$path, $file]; 451 push @trs, [$path, $file];
452
441 } elsif ($file =~ /\.arc$/) { 453 } elsif ($file =~ /\.arc$/) {
442 push @arc, [$path, $file]; 454 push @arc, [$path, $file];
455
443 } else { 456 } else {
444 warn "ignoring $path/$file\n" if $VERBOSE >= 3; 457 warn "ignoring $path/$file\n" if $VERBOSE >= 3;
445 } 458 }
446 } 459 }
447 }; 460 };

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines