exult_studio.cc

Go to the documentation of this file.
00001 #ifdef HAVE_CONFIG_H
00002 #  include <config.h>
00003 #endif
00004 
00005 #if defined(WIN32) && !defined(USE_CONSOLE)
00006 #include <cstdio>
00007 #define STDOUT_FILE TEXT("studio_out.txt")
00008 #define STDERR_FILE TEXT("studio_err.txt")
00009 #endif
00010 
00011 #include "studio.h"
00012 
00013 int main(int argc, char **argv)
00014 {
00015 // Code copied from SDL_main
00016 #if defined(WIN32) && !defined(USE_CONSOLE)
00017 
00018   /* Flush the output in case anything is queued */
00019   fclose(stdout);
00020   fclose(stderr);
00021 
00022   /* Redirect standard input and standard output */
00023   FILE *newfp = freopen(STDOUT_FILE, "w", stdout);
00024   if ( newfp == NULL ) {  /* This happens on NT */
00025 #if !defined(stdout)
00026     stdout = fopen(STDOUT_FILE, "w");
00027 #else
00028     newfp = fopen(STDOUT_FILE, "w");
00029     if ( newfp ) {
00030       *stdout = *newfp;
00031     }
00032 #endif
00033   }
00034   newfp = freopen(STDERR_FILE, "w", stderr);
00035   if ( newfp == NULL ) {  /* This happens on NT */
00036 #if !defined(stderr)
00037     stderr = fopen(STDERR_FILE, "w");
00038 #else
00039     newfp = fopen(STDERR_FILE, "w");
00040     if ( newfp ) {
00041       *stderr = *newfp;
00042     }
00043 #endif
00044   }
00045   setvbuf(stdout, NULL, _IOLBF, BUFSIZ);  /* Line buffered */
00046   setbuf(stderr, NULL);     /* No buffering */
00047 
00048 #endif //defined(WIN32) && !defined(USE_CONSOLE)
00049 
00050   ExultStudio studio(argc, argv);
00051   studio.run();
00052 
00053 }

Generated on Mon Jul 9 14:42:47 2007 for ExultEngine by  doxygen 1.5.1