~ubuntu-branches/ubuntu/warty/aqsis/warty

« back to all changes in this revision

Viewing changes to aqsis/aqsis.cpp

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-08-24 07:25:04 UTC
  • Revision ID: james.westby@ubuntu.com-20040824072504-zf993vnevvisdsvb
Tags: upstream-0.9.1
ImportĀ upstreamĀ versionĀ 0.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Aqsis main executable
 
2
 
 
3
// Includes
 
4
#include <time.h>
 
5
 
 
6
#include "ri.h"
 
7
#include "librib.h"
 
8
#include "librib2ri.h"
 
9
#include "aqsis.h"
 
10
#include "file.h"
 
11
#include "logging.h"
 
12
#include "logging_streambufs.h"
 
13
 
 
14
#ifdef  _DEBUG
 
15
#ifdef  AQSIS_SYSTEM_WIN32
 
16
extern "C" __declspec(dllimport) void report_refcounts();
 
17
#else
 
18
extern "C" void report_refcounts();
 
19
#endif // AQSIS_SYSTEM_WIN32
 
20
#endif // _DEBUG
 
21
 
 
22
#if defined(AQSIS_SYSTEM_WIN32)
 
23
#include <windows.h>
 
24
#endif
 
25
 
 
26
#if defined(AQSIS_SYSTEM_WIN32) || defined(AQSIS_SYSTEM_MACOSX)
 
27
#include "version.h"
 
28
#endif
 
29
 
 
30
#if defined(AQSIS_SYSTEM_WIN32) && defined(_DEBUG)
 
31
#include <crtdbg.h>
 
32
#endif
 
33
 
 
34
// Include libargparse
 
35
#include <argparse.h>
 
36
 
 
37
#include <iostream>
 
38
#include <iomanip>
 
39
#include <fstream>
 
40
#include <string>
 
41
#include <vector>
 
42
#include <strstream>
 
43
 
 
44
#include <stdio.h>
 
45
 
 
46
 
 
47
void RenderFile( FILE* file, std::string& name );
 
48
void GetOptions();
 
49
void ReleaseOptions();
 
50
 
 
51
bool g_pause;
 
52
// Set verbose stats if in debug mode
 
53
#ifdef  _DEBUG
 
54
int g_endofframe = 3;
 
55
#else
 
56
int g_endofframe = -1;
 
57
#endif
 
58
 
 
59
// Declare vars used by argparse
 
60
bool g_nostandard = 0;
 
61
bool g_help = 0;
 
62
bool g_version = 0;
 
63
bool g_verbose = 0;
 
64
bool g_environment = 0;
 
65
bool g_fb = 0;
 
66
bool g_progress = 0;
 
67
bool g_Progress = 0;
 
68
bool g_rinfo = 0;
 
69
TqInt verbose = 1;
 
70
 
 
71
// Define strings used by argparse
 
72
ArgParse::apstring g_config = "";
 
73
ArgParse::apstring g_shaders = "";
 
74
ArgParse::apstring g_archives = "";
 
75
ArgParse::apstring g_textures = "";
 
76
ArgParse::apstring g_displays = "";
 
77
ArgParse::apstring g_base_path = "";
 
78
ArgParse::apstring g_dso_libs = "";
 
79
ArgParse::apstring g_procedurals = "";
 
80
ArgParse::apstring g_type = "";
 
81
ArgParse::apstring g_addtype = "";
 
82
ArgParse::apstring g_mode = "rgba";
 
83
ArgParse::apstring g_strprogress = "Frame (%f) %p%% complete [ %s secs / %S left ]";
 
84
 
 
85
#ifdef  AQSIS_SYSTEM_POSIX
 
86
bool g_syslog = 0;
 
87
#endif  // AQSIS_SYSTEM_POSIX
 
88
 
 
89
/** Function to print out the version to a std::ostream
 
90
 */
 
91
void version( std::ostream& Stream )
 
92
{
 
93
#if defined(AQSIS_SYSTEM_WIN32) || defined(AQSIS_SYSTEM_MACOSX)
 
94
    Stream << "aqsis version " << VERSION_STR << std::endl;
 
95
#else
 
96
    Stream << "aqsis version " << VERSION << std::endl;
 
97
#endif
 
98
}
 
99
 
 
100
 
 
101
/** Function to print the progress of the render.
 
102
        Used as the callback function to a RiProgressHandler call.
 
103
 */
 
104
RtVoid PrintProgress( RtFloat percent, RtInt FrameNo )
 
105
{
 
106
    if ( ( g_progress == 0 ) && ( g_Progress == 0 ) )
 
107
        return ;
 
108
 
 
109
    // If g_Progress is set, 100% have to be reported. In all other cases the 100% are not displayed
 
110
    if ( percent >= 100 && !g_Progress )
 
111
    {
 
112
        std::cout << "                                                                              \r" << std::flush;
 
113
        return ;
 
114
    }
 
115
 
 
116
    static long tick = 0;
 
117
    long now;
 
118
 
 
119
    if ( tick == 0 )
 
120
        time( &tick );
 
121
 
 
122
    time( &now );
 
123
 
 
124
    // Calculate the various values for putting in the string.
 
125
#ifdef AQSIS_SYSTEM_MACOSX
 
126
    TqFloat total_secs = ( RtFloat ) 100.0f * ( ( RtFloat ) ( now - tick ) / ( float ) CLOCKS_PER_SEC );
 
127
#elif   AQSIS_SYSTEM_POSIX
 
128
    TqFloat total_secs = ( RtFloat ) 1000000.0f * ( ( RtFloat ) ( now - tick ) / ( float ) CLOCKS_PER_SEC );
 
129
#else
 
130
    TqFloat total_secs = ( RtFloat ) 1000.0f * ( ( RtFloat ) ( now - tick ) / ( float ) CLOCKS_PER_SEC );
 
131
#endif
 
132
    TqFloat total_mins = total_secs / 60.0f;
 
133
    TqFloat total_hrs = total_mins / 60.0f;
 
134
    TqFloat sub_secs = total_secs - ( ( TqInt ) total_mins * 60.0f );
 
135
    TqFloat sub_mins = total_mins - ( ( TqInt ) total_hrs * 60.0f );
 
136
 
 
137
    TqFloat total_secsleft = ( ( ( RtFloat ) 100 / percent ) * total_secs ) - total_secs;
 
138
    TqFloat total_minsleft = total_secsleft / 60.0f;
 
139
    TqFloat total_hrsleft = total_minsleft / 60.0f;
 
140
    TqFloat sub_secsleft = total_secsleft - ( ( TqInt ) total_minsleft * 60.0f );
 
141
    TqFloat sub_minsleft = total_minsleft - ( ( TqInt ) total_hrsleft * 60.0f );
 
142
 
 
143
    // Now print the line with substitution.
 
144
    TqInt ipos = 0;
 
145
 
 
146
    std::string strProgress;
 
147
 
 
148
    if ( g_Progress )  // Override the outputformat
 
149
    {
 
150
        strProgress = "R90000%p%%";
 
151
        percent = static_cast<int>( percent );
 
152
    }
 
153
    else                        // Use the default style
 
154
    {
 
155
        strProgress = g_strprogress;
 
156
    }
 
157
 
 
158
    std::ostrstream strOutput;
 
159
    strOutput.setf( std::ios::fixed );
 
160
    while ( 1 )
 
161
    {
 
162
        TqUint itag;
 
163
        itag = strProgress.find( '%', ipos );
 
164
        if ( itag == std::string::npos )
 
165
        {
 
166
            strOutput << strProgress.substr( ipos ).c_str();
 
167
            break;
 
168
        }
 
169
        else
 
170
        {
 
171
            if ( ipos != itag )
 
172
                strOutput << strProgress.substr( ipos, itag - ipos ).c_str();
 
173
 
 
174
            switch ( strProgress[ itag + 1 ] )
 
175
            {
 
176
            case 'p':
 
177
                strOutput << std::setw( 6 ) << std::setfill( ' ' ) << std::setprecision( 2 ) << percent;
 
178
                break;
 
179
 
 
180
            case 's':
 
181
                strOutput << std::setprecision( 0 ) << ( TqInt ) total_secs;
 
182
                break;
 
183
 
 
184
            case 'S':
 
185
                strOutput << std::setprecision( 0 ) << ( TqInt ) total_secsleft;
 
186
                break;
 
187
 
 
188
            case 'm':
 
189
                strOutput << std::setprecision( 0 ) << ( TqInt ) total_mins;
 
190
                break;
 
191
 
 
192
            case 'M':
 
193
                strOutput << std::setprecision( 0 ) << ( TqInt ) total_minsleft;
 
194
                break;
 
195
 
 
196
            case 'h':
 
197
                strOutput << std::setprecision( 0 ) << ( TqInt ) total_hrs;
 
198
                break;
 
199
 
 
200
            case 'H':
 
201
                strOutput << std::setprecision( 0 ) << ( TqInt ) total_hrsleft;
 
202
                break;
 
203
 
 
204
            case 't':
 
205
                strOutput << std::setprecision( 0 ) << ( TqInt ) total_hrs << ":" << ( TqInt ) sub_mins << ":" << ( TqInt ) sub_secs;
 
206
                break;
 
207
 
 
208
            case 'T':
 
209
                strOutput << std::setprecision( 0 ) << ( TqInt ) total_hrsleft << ":" << ( TqInt ) sub_minsleft << ":" << ( TqInt ) sub_secsleft;
 
210
                break;
 
211
 
 
212
            case 'f':
 
213
                strOutput << std::setprecision( 0 ) << ( TqInt ) FrameNo;
 
214
                break;
 
215
 
 
216
            case '%':
 
217
                strOutput << '%';
 
218
                break;
 
219
            }
 
220
            ipos = itag + 2;
 
221
        }
 
222
 
 
223
        if ( ipos >= strProgress.size() )
 
224
            break;
 
225
    }
 
226
    // Pad to the end of the line.
 
227
    while ( strOutput.pcount() < 79 )
 
228
        strOutput << " ";
 
229
 
 
230
    std::cout << std::string( strOutput.str(), strOutput.pcount() ).c_str();
 
231
 
 
232
    if ( g_Progress )
 
233
        std::cout << "\n";
 
234
    else
 
235
        std::cout << "\r";
 
236
 
 
237
    strOutput.freeze( false );
 
238
    std:: cout << std::flush;
 
239
}
 
240
 
 
241
 
 
242
/** Function to setup specific options needed after world loading but before rendering.
 
243
        Used as the callback function to a RiPreWorldFunction call.
 
244
 */
 
245
#ifdef  AQSIS_SYSTEM_BEOS
 
246
RtVoid PreWorld( ... )
 
247
#else
 
248
RtVoid PreWorld()
 
249
#endif
 
250
{
 
251
    if ( g_fb )
 
252
    {
 
253
        char * type = "framebuffer", *mode = "rgb";
 
254
        RiDisplay( "aqsis", type, mode, NULL );
 
255
    }
 
256
    else if ( g_type.compare( "" ) != 0 )
 
257
    {
 
258
        char type[ 256 ], mode[ 256 ];
 
259
        strcpy( type, g_type.c_str() );
 
260
        strcpy( mode, g_mode.c_str() );
 
261
        RiDisplay( "aqsis", type, mode, NULL );
 
262
    }
 
263
    else if ( g_addtype.compare( "" ) != 0 )
 
264
    {
 
265
        char type[ 256 ], mode[ 256 ];
 
266
        strcpy( type, g_addtype.c_str() );
 
267
        strcpy( mode, g_mode.c_str() );
 
268
        RiDisplay( "+aqsis", type, mode, NULL );
 
269
    }
 
270
    else if ( g_endofframe >= 0 )
 
271
    {
 
272
        RiOption( "statistics", "endofframe", &g_endofframe, RI_NULL );
 
273
    }
 
274
    return ;
 
275
}
 
276
 
 
277
 
 
278
int main( int argc, const char** argv )
 
279
{
 
280
#if defined(AQSIS_SYSTEM_WIN32) && defined(_DEBUG)
 
281
        std::ostringstream __buffer;
 
282
    __buffer << 0;
 
283
        _CrtMemState __initialState;
 
284
        _CrtMemCheckpoint(&__initialState);
 
285
#endif
 
286
        {
 
287
 
 
288
    ArgParse ap;
 
289
    ap.usageHeader( ArgParse::apstring( "Usage: " ) + argv[ 0 ] + " [options] files(s) to render" );
 
290
    ap.argFlag( "help", "\aprint this help and exit", &g_help );
 
291
    ap.argFlag( "version", "\aprint version information and exit", &g_version );
 
292
    ap.argFlag( "pause", "\await for a keypress on completion", &g_pause );
 
293
    ap.argFlag( "progress", "\aprint progress information", &g_progress );
 
294
    ap.argFlag( "Progress", "\aprogress message matching prman \n\a(not influenced by progressformat)", &g_Progress );
 
295
    ap.argString( "progressformat", "\astring representing the format of the progress message", &g_strprogress );
 
296
    ap.argInt( "endofframe", "=integer\aequivalent to \"endofframe\" option", &g_endofframe );
 
297
    ap.argFlag( "nostandard", "\adisable declaration of standard RenderMan parameters", &g_nostandard );
 
298
    ap.argFlag( "verbose", "\aoutput more information during rendering", &g_verbose );
 
299
    ap.alias( "verbose", "v" );
 
300
    ap.argFlag( "renderinfo", "\aPrint out infos about base rendering settings", &g_rinfo );
 
301
    ap.argFlag( "environment", "\aoutput environment information", &g_environment );
 
302
    ap.argString( "type", "=string\aspecify a display device type to use", &g_type );
 
303
    ap.argString( "addtype", "=string\aspecify a display device type to add", &g_addtype );
 
304
    ap.argString( "mode", "=string\aspecify a display device mode to use", &g_mode );
 
305
    ap.argFlag( "fb", "\aequivalent to --type=\"framebuffer\" --mode=\"rgb\"", &g_fb );
 
306
    ap.alias( "fb", "d" );
 
307
    ap.argString( "config", "=string\aspecify a configuration file to load", &g_config );
 
308
    ap.argString( "base", "=string\aspecify a default base path", &g_base_path );
 
309
    ap.argString( "shaders", "=string\aspecify a default shaders searchpath", &g_shaders );
 
310
    ap.argString( "archives", "=string\aspecify a default archives searchpath", &g_archives );
 
311
    ap.argString( "textures", "=string\aspecify a default textures searchpath", &g_textures );
 
312
    ap.argString( "displays", "=string\aspecify a default displays searchpath", &g_displays );
 
313
    ap.argString( "dsolibs", "=string\aspecify default DSO libraries", &g_dso_libs );
 
314
    ap.argString( "procedurals", "=string\aspecify default searchpath for procedurals", &g_procedurals );
 
315
#ifdef  AQSIS_SYSTEM_POSIX
 
316
    ap.argFlag( "syslog", "\alog messages to syslog", &g_syslog );
 
317
#endif  // AQSIS_SYSTEM_POSIX
 
318
    ap.allowUnrecognizedOptions();
 
319
 
 
320
    //_crtBreakAlloc = 1305;
 
321
 
 
322
    if ( argc > 1 && !ap.parse( argc - 1, argv + 1 ) )
 
323
    {
 
324
        std::cerr << ap.errmsg() << std::endl << ap.usagemsg();
 
325
        exit( 1 );
 
326
    }
 
327
 
 
328
    if ( g_help )
 
329
    {
 
330
        std::cout << ap.usagemsg();
 
331
        exit( 0 );
 
332
    }
 
333
 
 
334
    if ( g_version )
 
335
    {
 
336
        version( std::cout );
 
337
        std::cout << "compiled " << __DATE__ << " " << __TIME__ << std::endl;
 
338
        exit( 0 );
 
339
    }
 
340
 
 
341
    GetOptions();
 
342
 
 
343
    if ( g_environment )
 
344
    {
 
345
        std::cout << "config:   " << g_config.c_str() << std::endl;
 
346
        std::cout << "base:     " << g_base_path.c_str() << std::endl;
 
347
        std::cout << "shaders:  " << g_shaders.c_str() << std::endl;
 
348
        std::cout << "archives: " << g_archives.c_str() << std::endl;
 
349
        std::cout << "textures: " << g_textures.c_str() << std::endl;
 
350
        std::cout << "displays: " << g_displays.c_str() << std::endl;
 
351
        std::cout << "dsolibs: " << g_dso_libs.c_str() << std::endl;
 
352
        std::cout << "procedurals: " << g_procedurals.c_str() << std::endl;
 
353
    }
 
354
 
 
355
    std::auto_ptr<std::streambuf> reset_level( new Aqsis::reset_level_buf(std::cerr) );
 
356
    std::auto_ptr<std::streambuf> show_timestamps( new Aqsis::timestamp_buf(std::cerr) );
 
357
    std::auto_ptr<std::streambuf> fold_duplicates( new Aqsis::fold_duplicates_buf(std::cerr) );
 
358
    std::auto_ptr<std::streambuf> show_level( new Aqsis::show_level_buf(std::cerr) );
 
359
    std::auto_ptr<std::streambuf> filter_level( new Aqsis::filter_by_level_buf(Aqsis::WARNING, std::cerr) );
 
360
#ifdef  AQSIS_SYSTEM_POSIX
 
361
    if( g_syslog )
 
362
        std::auto_ptr<std::streambuf> use_syslog( new Aqsis::syslog_buf(std::cerr) );
 
363
#endif  // AQSIS_SYSTEM_POSIX
 
364
 
 
365
    if ( ap.leftovers().size() == 0 )     // If no files specified, take input from stdin.
 
366
    {
 
367
        std::string name("stdin");
 
368
                RenderFile( stdin, name );
 
369
    }
 
370
    else
 
371
    {
 
372
        for ( ArgParse::apstringvec::const_iterator e = ap.leftovers().begin(); e != ap.leftovers().end(); e++ )
 
373
        {
 
374
            FILE *file = fopen( e->c_str(), "rb" );
 
375
            if ( file != NULL )
 
376
            {
 
377
                std::string name(*e);
 
378
                                RenderFile( file, name );
 
379
                fclose( file );
 
380
            }
 
381
            else
 
382
            {
 
383
                std::cout << "Warning: Cannot open file \"" << *e << "\"" << std::endl;
 
384
            }
 
385
        }
 
386
    }
 
387
 
 
388
        ReleaseOptions();
 
389
 
 
390
        }
 
391
#if defined(AQSIS_SYSTEM_WIN32) && defined(_DEBUG)
 
392
    //_CrtDumpMemoryLeaks();
 
393
        _CrtMemDumpAllObjectsSince(&__initialState);
 
394
#endif
 
395
 
 
396
#if defined(AQSIS_SYSTEM_WIN32)
 
397
 
 
398
    {
 
399
        MEMORY_BASIC_INFORMATION mbi;
 
400
        DWORD dwMemUsed = 0;
 
401
        PVOID pvAddress = 0;
 
402
        SYSTEM_INFO SystemInfo;
 
403
 
 
404
        memset( &SystemInfo, 0, sizeof( SYSTEM_INFO ) );
 
405
        GetSystemInfo(
 
406
            &SystemInfo  // system information
 
407
        );
 
408
        memset( &mbi, 0, sizeof( MEMORY_BASIC_INFORMATION ) );
 
409
        while ( VirtualQuery( pvAddress, &mbi, sizeof( MEMORY_BASIC_INFORMATION ) ) == sizeof( MEMORY_BASIC_INFORMATION ) )
 
410
        {
 
411
            if ( mbi.State == MEM_COMMIT && mbi.Type == MEM_PRIVATE )
 
412
                dwMemUsed += mbi.RegionSize;
 
413
            pvAddress = ( ( BYTE* ) mbi.BaseAddress ) + mbi.RegionSize;
 
414
        }
 
415
        std::cout << "Peak Memory Used " << dwMemUsed << std::endl;
 
416
 
 
417
    }
 
418
#endif
 
419
 
 
420
#ifdef _DEBUG
 
421
    report_refcounts();
 
422
#endif
 
423
 
 
424
    return ( 0 );
 
425
}
 
426
 
 
427
 
 
428
void GetOptions()
 
429
{
 
430
    // If --base not specified, check for env.
 
431
    if ( g_base_path.compare( "" ) == 0 )
 
432
        g_base_path = Aqsis::CqFile::GetSystemSetting( "base" );
 
433
 
 
434
    // If --config not specified try to locate the config file.
 
435
    if ( g_config.compare( "" ) == 0 )
 
436
        g_config = Aqsis::CqFile::GetSystemSetting( "config" );
 
437
 
 
438
    // if --shaders is not specified, try and get a default shaders searchpath.
 
439
    if ( g_shaders.compare( "" ) == 0 )
 
440
        g_shaders = Aqsis::CqFile::GetSystemSetting( "shaders" );
 
441
 
 
442
    // if --archives is not specified, try and get a default archives searchpath.
 
443
    if ( g_archives.compare( "" ) == 0 )
 
444
        g_archives = Aqsis::CqFile::GetSystemSetting( "archives" );
 
445
 
 
446
    // if --textures is not specified, try and get a default textures searchpath.
 
447
    if ( g_textures.compare( "" ) == 0 )
 
448
        g_textures = Aqsis::CqFile::GetSystemSetting( "textures" );
 
449
 
 
450
    // if --displays is not specified, try and get a default displays searchpath.
 
451
    if ( g_displays.compare( "" ) == 0 )
 
452
        g_displays = Aqsis::CqFile::GetSystemSetting( "displays" );
 
453
 
 
454
    // if --displays is not specified, try and get a default dso libraries.
 
455
    if ( g_dso_libs.compare( "" ) == 0 )
 
456
        g_dso_libs = Aqsis::CqFile::GetSystemSetting( "dsolibs" );
 
457
 
 
458
    // if --displays is not specified, try and get a default procedurals searchpath.
 
459
    if ( g_procedurals.compare( "" ) == 0 )
 
460
        g_procedurals = Aqsis::CqFile::GetSystemSetting( "procedurals" );
 
461
}
 
462
 
 
463
 
 
464
void ReleaseOptions()
 
465
{
 
466
        g_base_path = "";
 
467
        g_config = "";
 
468
        g_shaders = "";
 
469
        g_archives = "";
 
470
        g_textures = "";
 
471
        g_displays = "";
 
472
        g_dso_libs = "";
 
473
        g_procedurals = "";
 
474
}
 
475
 
 
476
 
 
477
void RenderFile( FILE* file, std::string&  name )
 
478
{
 
479
    librib::RendermanInterface * renderengine = librib2ri::CreateRIBEngine();
 
480
 
 
481
    RiBegin( "CRIBBER" );
 
482
 
 
483
    if ( !g_nostandard )
 
484
        librib::StandardDeclarations( *renderengine );
 
485
 
 
486
    if ( g_rinfo )
 
487
    {
 
488
        RiOption( "statistics", "renderinfo", &g_rinfo, RI_NULL );
 
489
    }
 
490
 
 
491
    if( g_verbose )
 
492
    {
 
493
        RiOption( "statistics", "verbose", &g_rinfo, RI_NULL );
 
494
    }
 
495
 
 
496
    const char* popt[ 1 ];
 
497
    popt[ 0 ] = g_shaders.c_str();
 
498
    RiOption( "searchpath", "shader", &popt, RI_NULL );
 
499
    popt[ 0 ] = g_archives.c_str();
 
500
    RiOption( "searchpath", "archive", &popt, RI_NULL );
 
501
    popt[ 0 ] = g_textures.c_str();
 
502
    RiOption( "searchpath", "texture", &popt, RI_NULL );
 
503
    popt[ 0 ] = g_displays.c_str();
 
504
    RiOption( "searchpath", "display", &popt, RI_NULL );
 
505
    popt[ 0 ] = g_dso_libs.c_str();
 
506
    RiOption( "searchpath", "dsolibs", &popt, RI_NULL );
 
507
    popt[ 0 ] = g_procedurals.c_str();
 
508
    RiOption( "searchpath", "procedural", &popt, RI_NULL );
 
509
 
 
510
    RiProgressHandler( &PrintProgress );
 
511
    RiPreWorldFunction( &PreWorld );
 
512
 
 
513
    if ( g_config.compare( "" ) )
 
514
    {
 
515
        FILE * cfgfile = fopen( g_config.c_str(), "rb" );
 
516
        if ( cfgfile != NULL )
 
517
        {
 
518
            librib::Parse( cfgfile, "config", *renderengine, std::cerr, NULL );
 
519
            fclose( cfgfile );
 
520
        }
 
521
        else if ( g_environment )
 
522
        {
 
523
#ifdef  AQSIS_SYSTEM_WIN32
 
524
            std::cout << "Warning: Config file not found in" << std::endl <<
 
525
            "%AQSIS_CONFIG%" << std::endl <<
 
526
            "%AQSIS_BASE_PATH%/.aqsisrc" << std::endl <<
 
527
            "%HOME%/.aqsisrc" << std::endl <<
 
528
            ".aqsisrc" << std::endl;
 
529
#else
 
530
            std::cout << "Warning: Config file not found in" << std::endl <<
 
531
            "$AQSIS_CONFIG" << std::endl <<
 
532
            "$AQSIS_BASE_PATH/.aqsisrc" << std::endl <<
 
533
            "$HOME/.aqsisrc" << std::endl <<
 
534
            "/etc/.aqsisrc" << std::endl;
 
535
#endif
 
536
 
 
537
        }
 
538
    }
 
539
    librib::Parse( file, name, *renderengine, std::cerr, NULL );
 
540
 
 
541
    RiEnd();
 
542
 
 
543
    if ( !g_nostandard )
 
544
        librib::CleanupDeclarations( *renderengine );
 
545
 
 
546
    librib2ri::DestroyRIBEngine( renderengine );
 
547
}