From e140e613873b3b9e256176bb96bf3dd0fff9f739 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Tue, 21 Jan 2014 12:50:23 +0100 Subject: [PATCH] Fix Qt build on Windows --- .hgignore | 3 +++ code/nel/tools/3d/object_viewer_qt/src/main.cpp | 10 +++++++++- .../tools/leveldesign/georges_editor_qt/src/main.cpp | 11 ++++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.hgignore b/.hgignore index bd8899404..d2b2848bb 100644 --- a/.hgignore +++ b/.hgignore @@ -147,6 +147,9 @@ external_stlport thumbs.db Thumbs.db *.tpl.php +.SyncID +.SyncIgnore +.SyncArchive # build code/nel/build/* diff --git a/code/nel/tools/3d/object_viewer_qt/src/main.cpp b/code/nel/tools/3d/object_viewer_qt/src/main.cpp index d7569bda8..d0407ccfd 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/main.cpp @@ -104,7 +104,11 @@ static inline QString msgCoreLoadFailure(const QString &why) return QCoreApplication::translate("Application", "Failed to load Core plugin: %1").arg(why); } -sint main(int argc, char **argv) +#ifdef NL_OS_WINDOWS +int __stdcall WinMain(void *hInstance, void *hPrevInstance, void *lpCmdLine, int nShowCmd) +#else // NL_OS_WINDOWS +int main(int argc, char **argv) +#endif // NL_OS_WINDOWS { // go nel! new NLMISC::CApplicationContext; @@ -129,7 +133,11 @@ sint main(int argc, char **argv) nlinfo("Welcome to NeL Object Viewer Qt!"); } QApplication::setGraphicsSystem("raster"); +#ifdef NL_OS_WINDOWS + QApplication app(__argc, __argv); +#else // NL_OS_WINDOWS QApplication app(argc, argv); +#endif // NL_OS_WINDOWS QSplashScreen *splash = new QSplashScreen(); splash->setPixmap(QPixmap(":/images/nel_ide_load.png")); splash->show(); diff --git a/code/ryzom/tools/leveldesign/georges_editor_qt/src/main.cpp b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main.cpp index 3b0d606d3..aa82dbb17 100644 --- a/code/ryzom/tools/leveldesign/georges_editor_qt/src/main.cpp +++ b/code/ryzom/tools/leveldesign/georges_editor_qt/src/main.cpp @@ -87,9 +87,18 @@ void messageHandler(QtMsgType p_type, const char* p_msg) # endif #endif -sint main(int argc, char **argv) +#ifdef NL_OS_WINDOWS +int __stdcall WinMain(void *hInstance, void *hPrevInstance, void *lpCmdLine, int nShowCmd) +#else // NL_OS_WINDOWS +int main(int argc, char **argv) +#endif // NL_OS_WINDOWS { +#ifdef NL_OS_WINDOWS + + QApplication app(__argc, __argv); +#else // NL_OS_WINDOWS QApplication app(argc, argv); +#endif // NL_OS_WINDOWS QPixmap pixmap(":/images/georges_logo.png"); NLQT::CGeorgesSplash splash; splash.show();