Changed: #1251 Code simplification and default values if not using config.h

This commit is contained in:
kervala 2011-02-24 18:55:14 +01:00
parent a5bb497c71
commit 4614d42fb8
3 changed files with 7 additions and 14 deletions

View file

@ -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);

View file

@ -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

View file

@ -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)
{