19 printf(
" vlxtool -in file1 file file3 ... -out file_out\n");
20 printf(
"\nexamples:\n");
21 printf(
" > vlxtool -in file1.obj file2.3ds file3.vlb -out file_out.vlt\n");
22 printf(
" Merges the contents of file1.obj, file2.3ds and file3.vlb into file_out.vlt:\n\n");
23 printf(
" > vlxtool -in file.vlt -out file.vlb\n");
24 printf(
" Converts a VLT file to its VLB representation:\n\n");
25 printf(
" > vlxtool -in file.vlb -out file.vlt\n");
26 printf(
" Converts a VLB file to its VLT representation:\n\n");
29 int main(
int argc,
const char* argv[])
33 printf(
"vlxtool 1.0 - Visualization Library VLX Utility\n");
34 printf(
"Converts any type of resource to .vlt/.vlb\n\n");
36 std::vector<std::string> in_files;
42 for(
int i=1; i<argc; ++i)
44 if ( strcmp(argv[i],
"-in") == 0)
50 if ( strcmp(argv[i],
"-out") == 0)
58 in_files.push_back(argv[i]);
67 printf(
"too many output files.\n");
73 printf(
"Unknown option:'%s'\n", argv[i]);
79 if (in_files.empty() || out_file.
empty())
82 printf(
"Missing input file list.\n");
85 printf(
"Missing output file.\n");
91 printf(
"Loading...\n");
93 for(
size_t i=0; i<in_files.size(); ++i)
96 printf(
"\t%s ", in_files[i].c_str());
100 printf(
"\t... %.2fs\n", timer.
elapsed());
105 printf(
"\t... FAILED\n");
115 printf(
"Saving VLT...\n");
118 printf(
"\t... %.2fs\n", timer.elapsed());
123 printf(
"Saving VLB...\n");
126 printf(
"\t... %.2fs\n", timer.elapsed());
130 printf(
"FAILED: output file must be either a .vlt or .vlb\n");
VLX_EXPORT bool saveVLT(vl::VirtualFile *file, const vl::ResourceDatabase *)
real elapsed(int index=0) const
The String class implements an advanced UTF16 (Unicode BMP) string manipulation engine.
VLCORE_EXPORT ref< ResourceDatabase > loadResource(const String &path, bool quick=true)
Short version of defLoadWriterManager()->loadResource(path, quick).
Visualization Library main namespace.
VLGRAPHICS_EXPORT void expandResourceDatabase(ResourceDatabase *db)
Extracts and sorts Shaders, Effects, Renderables, RenderStates, Transforms etc. from their parent obj...
static void init(bool log_info=true)
Initializes VLCore and VLGraphics libraries.
Simple class to be used as a timer and to retrieve the current time and date.
const std::vector< ref< Object > > & resources() const
bool empty() const
Returns true if length() == 0.
VLX_EXPORT bool saveVLB(vl::VirtualFile *file, const vl::ResourceDatabase *)
The ref<> class is used to reference-count an Object.
std::string toStdString() const
Returns a UTF8 encoded std::string.
bool endsWith(const String &str) const
Returns true if a String ends with the specified String str.
The ResourceDatabase class contains and manipulates a set of resources.