From 6c4f4bb1df1f1f2a7df5b792d789df9e3cd5abb6 Mon Sep 17 00:00:00 2001 From: kervala Date: Thu, 24 Feb 2011 18:55:14 +0100 Subject: [PATCH] Changed: #1251 Code simplification and default values if not using config.h --- code/nel/src/3d/driver_user.cpp | 8 +------- code/nel/src/3d/dru.cpp | 5 +++++ code/nel/src/3d/nelu.cpp | 8 +------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/code/nel/src/3d/driver_user.cpp b/code/nel/src/3d/driver_user.cpp index 5f1b48a1f..220536c4a 100644 --- a/code/nel/src/3d/driver_user.cpp +++ b/code/nel/src/3d/driver_user.cpp @@ -36,10 +36,6 @@ #include "nel/misc/hierarchical_timer.h" #include "nel/misc/event_emitter.h" -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif // HAVE_CONFIG_H - using namespace NLMISC; namespace NL3D @@ -137,15 +133,13 @@ CDriverUser::CDriverUser (uint windowIcon, bool direct3d, emptyProc exitFunc) _Driver = NULL; // Create/Init Driver. -#if defined(NL_OS_WINDOWS) && defined(NL_DIRECT3D_AVAILABLE) +#if defined(NL_OS_WINDOWS) if (direct3d) _Driver= CDRU::createD3DDriver(); #endif -#ifdef NL_OPENGL_AVAILABLE if (!_Driver) _Driver= CDRU::createGlDriver(); -#endif nlassert(_Driver); _Driver->init (windowIcon, exitFunc); diff --git a/code/nel/src/3d/dru.cpp b/code/nel/src/3d/dru.cpp index 6b8f8f6a2..6300dd698 100644 --- a/code/nel/src/3d/dru.cpp +++ b/code/nel/src/3d/dru.cpp @@ -27,6 +27,11 @@ #ifdef HAVE_CONFIG_H # include "config.h" +#else +# define NL_OPENGL_AVAILABLE +# ifdef NL_OS_WINDOWS +# define NL_DIRECT3D_AVAILABLE +# endif #endif // HAVE_CONFIG_H #ifdef NL_OS_WINDOWS diff --git a/code/nel/src/3d/nelu.cpp b/code/nel/src/3d/nelu.cpp index 73ff049ed..80ef89ec4 100644 --- a/code/nel/src/3d/nelu.cpp +++ b/code/nel/src/3d/nelu.cpp @@ -27,10 +27,6 @@ #include "nel/3d/vertex_stream_manager.h" #include "nel/misc/debug.h" -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif // HAVE_CONFIG_H - using namespace std; using namespace NLMISC; @@ -62,19 +58,17 @@ bool CNELU::initDriver (uint w, uint h, uint bpp, bool windowed, nlWindow syst CNELU::Driver = NULL; // Init driver. -#if defined(NL_OS_WINDOWS) && defined(NL_DIRECT3D_AVAILABLE) +#if defined(NL_OS_WINDOWS) if (direct3d) { CNELU::Driver= CDRU::createD3DDriver(); } #endif -#ifdef NL_OPENGL_AVAILABLE if (!CNELU::Driver) { CNELU::Driver= CDRU::createGlDriver(); } -#endif if (!CNELU::Driver) {