Commit 1cf1c047 authored by Jan Möbius's avatar Jan Möbius

Make console activation easier

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15817 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 2f23cf72
...@@ -72,13 +72,10 @@ ...@@ -72,13 +72,10 @@
#include <omp.h> #include <omp.h>
#endif #endif
// Includes for windows debugging console // Includes for windows debugging console
#ifdef WIN32 #ifdef WIN32
#ifndef NDEBUG #include <fcntl.h>
#include <fcntl.h> #include <io.h>
#include <io.h>
#endif
#endif #endif
...@@ -229,7 +226,6 @@ void segfaultHandling (int) { ...@@ -229,7 +226,6 @@ void segfaultHandling (int) {
} }
#ifdef WIN32 #ifdef WIN32
#ifndef NDEBUG
void getConsole() { void getConsole() {
//Create a console for this application //Create a console for this application
AllocConsole(); AllocConsole();
...@@ -252,7 +248,6 @@ void segfaultHandling (int) { ...@@ -252,7 +248,6 @@ void segfaultHandling (int) {
*stdin = *CInputHandle; *stdin = *CInputHandle;
setvbuf(stdin, NULL, _IONBF, 0); setvbuf(stdin, NULL, _IONBF, 0);
} }
#endif
#endif #endif
bool openPolyMeshes = false; bool openPolyMeshes = false;
...@@ -319,12 +314,6 @@ bool parseCommandLineOptions(CSimpleOpt& args){ ...@@ -319,12 +314,6 @@ bool parseCommandLineOptions(CSimpleOpt& args){
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
#ifdef WIN32
#ifndef NDEBUG
getConsole();
#endif
#endif
// Remove -psn_0_xxxxx argument which is automatically // Remove -psn_0_xxxxx argument which is automatically
// attached by MacOSX // attached by MacOSX
for (int i = 0; i < argc; i++) { for (int i = 0; i < argc; i++) {
...@@ -333,8 +322,8 @@ int main(int argc, char **argv) ...@@ -333,8 +322,8 @@ int main(int argc, char **argv)
( (argv[i])[1] == 'p' ) && ( (argv[i])[1] == 'p' ) &&
( (argv[i])[2] == 's' ) && ( (argv[i])[2] == 's' ) &&
( (argv[i])[3] == 'n' ) ) { ( (argv[i])[3] == 'n' ) ) {
argc--; argc--;
argv[i] = (char *)""; argv[i] = (char *)"";
} }
} }
} }
...@@ -361,6 +350,12 @@ int main(int argc, char **argv) ...@@ -361,6 +350,12 @@ int main(int argc, char **argv)
OpenFlipper::Options::windowTitle("OpenFlipper v" + OpenFlipper::Options::coreVersion()); OpenFlipper::Options::windowTitle("OpenFlipper v" + OpenFlipper::Options::coreVersion());
#ifdef WIN32
#ifndef NDEBUG
getConsole();
#endif
#endif
if ( !OpenFlipper::Options::nogui() ) { if ( !OpenFlipper::Options::nogui() ) {
// OpenGL check // OpenGL check
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment