# HG changeset patch # User Shinji KONO # Date 1280755008 -32400 # Node ID 8b073ba2384fb7e6ed76694543dbde5546ff23e0 # Parent aca8766c219daabedbf1f30aaf16da8d310298b8 remove unused file diff -r aca8766c219d -r 8b073ba2384f Renderer/Engine/spe/viewer_types.cc diff -r aca8766c219d -r 8b073ba2384f Renderer/Engine/tools/create_sglist.pl --- a/Renderer/Engine/tools/create_sglist.pl Mon Aug 02 22:12:49 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,115 +0,0 @@ -#!/usr/bin/perl - -# TODO -# 同じ名前の SceneGraph が来た時の処理 -# まあ Blender の時点でそうならないように書くべきなんだが - -#################################### -# -# Create SceneGraph List -# -# SceneGraph が記載された xml ファイルを読み込み、 -# 名前に対応するID列が記述された SGList.h を生成する。 -# また、名前から ID を取得するために sglist_table を生成しておく。 -# sglist_table は SGList.cpp に記述する -# -# xml に ID を入れれば table は要らないんだが、 -# xml の読み込む順番、その時々に応じて使うものと使わないもので -# ID にズレが出てくるので、Blender からの出力時点では決定できない。 -# このスクリプトで xml に上書きするって手もあるけど、微妙じゃない? -# -# xml ファイルは複数指定可能。 -# 実際に使うやつ全て指定する感じでおk -# -# (例) -# -# % cat ../xml_file/universe.xml -# -# -# -# -# (省略) -# -# -# -# (省略) -# -# -# -# % ./create_sglist.pl ../xml_file/universe.xml -# % cat SGList.h -# -# /* ../xml_file/universe.xml */ -# #define Earth 0 -# #define Moon 1 -# -# /* Number of Scene */ -# #define SGLIST_LENGTH 2 -# -# /* Scene Table */ -# const char *sglist_table[SGLIST_LENGTH] = { -# "Earth", "Moon" -# }; -# -#################################### - -use strict; -# -# to install this, -# cpan -i XML::LibXML::SAX::Generator -# -use XML::LibXML; - -my $outfile_h = "SGList.h"; -my $outfile_c = "SGList.cc"; -my $id = 0; -my @table; - -################### -# cretae SGList.h # -################### -open(FH, ">$outfile_h") || die "Error: Can't open file : $outfile_h\n"; - -print FH "#ifndef INCLUDED_SGLIST\n"; -print FH "#define INCLUDED_SGLIST\n\n"; - -foreach (@ARGV) { - my $parser = XML::LibXML->new(); - my $doc = $parser->parse_file($_); - my @nodes = $doc->findnodes('//surface'); - - print FH "/* $_ */\n"; - - foreach my $surface (@nodes) { - my $name = $surface->findvalue('@name'); - - $table[$id] = $name; - - print FH "#define $name\t $id\n"; - $id++; - } - - print FH "\n"; -} - -print FH "/* Number of Scene */\n"; -print FH "#define SGLIST_LENGTH $id\n\n"; - -print FH "/* Scene Table */\n"; -print FH "extern const char *sglist_table[SGLIST_LENGTH];\n\n"; -print FH "#endif\n"; - -close(FH); - -##################### -# cretae SGList.cpp # -##################### -open(FH, ">$outfile_c") || die "Error: Can't open file : $outfile_c\n"; - -print FH "#include \"SGList.h\"\n\n"; -print FH "const char *sglist_table[SGLIST_LENGTH] = {\n"; -print FH " \""; -print FH join("\", \"", @table); -print FH "\"\n};\n"; - -close(FH);