26 _preferred_extension =
".x";
28 set_program_brief(
"reads and writes DirectX .x files");
29 set_program_description
30 (
"This program reads a DirectX retained-mode file (.x) and writes an " 31 "essentially equivalent .x file. It is primarily useful for " 32 "debugging the X file parser that is part of the Pandatool library.");
35 add_runline(
"[opts] input.x output.x");
36 add_runline(
"[opts] -o output.x input.x");
40 "Specify the filename to which the resulting .x file will be written. " 41 "If this option is omitted, the last parameter name is taken to be the " 42 "name of the output file.",
43 &XFileTrans::dispatch_filename, &_got_output_filename, &_output_filename);
52 nout <<
"Reading " << _input_filename <<
"\n";
55 if (!file.
read(_input_filename)) {
56 nout <<
"Unable to read.\n";
61 nout <<
"Unable to write.\n";
72 if (!check_last_arg(args, 1)) {
77 nout <<
"You must specify the .x file to read on the command line.\n";
80 }
else if (args.size() != 1) {
81 nout <<
"You must specify only one .x file to read on the command line.\n";
85 _input_filename = args[0];
91 int main(
int argc,
char *argv[]) {
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual void parse_command_line(int argc, char **argv)
Dispatches on each of the options on the command line, and passes the remaining parameters to handle_...
A program to read a X file and output an essentially similar X file.
bool write(Filename filename) const
Opens the indicated filename for output and writes a parseable description of all the known distribut...
bool read(Filename filename)
Opens and reads the indicated .x file by name.
This is the bare functionality (intended to be inherited from along with ProgramBase or some derivati...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This represents the complete contents of an X file (file.x) in memory.
std::ostream & get_output()
Returns an output stream that corresponds to the user's intended egg file output–either stdout,...