Merge with develop

This commit is contained in:
kaetemi 2015-02-24 17:19:27 +01:00
commit 04cca60cac
11 changed files with 62 additions and 13 deletions

View file

@ -38,7 +38,7 @@ ELSEIF(WIN32)
ENDIF(UNIX)
FIND_LIBRARY(LIBOVR_LIBRARY
NAMES ovr
NAMES ovr libovr
PATHS
$ENV{LIBOVR_DIR}/${LIBOVR_LIBRARY_BUILD_PATH}
/usr/local/lib

View file

@ -88,6 +88,8 @@ namespace NLMISC
virtual void setNoAssert(bool noAssert) =0;
virtual bool getAlreadyCreateSharedAmongThreads() =0;
virtual void setAlreadyCreateSharedAmongThreads(bool b) =0;
virtual bool isWindowedApplication() = 0;
virtual void setWindowedApplication(bool b = true) = 0;
//@}
protected:
/// Called by derived class to finalize initialisation of context
@ -131,6 +133,8 @@ namespace NLMISC
virtual void setNoAssert(bool noAssert);
virtual bool getAlreadyCreateSharedAmongThreads();
virtual void setAlreadyCreateSharedAmongThreads(bool b);
virtual bool isWindowedApplication();
virtual void setWindowedApplication(bool b);
private:
/// Singleton registry
@ -147,6 +151,7 @@ namespace NLMISC
bool DebugNeedAssert;
bool NoAssert;
bool AlreadyCreateSharedAmongThreads;
bool WindowedApplication;
};
/** This class implements the context interface for the a library module.
@ -183,6 +188,8 @@ namespace NLMISC
virtual void setNoAssert(bool noAssert);
virtual bool getAlreadyCreateSharedAmongThreads();
virtual void setAlreadyCreateSharedAmongThreads(bool b);
virtual bool isWindowedApplication();
virtual void setWindowedApplication(bool b);
private:
/// Pointer to the application context.

View file

@ -42,11 +42,7 @@ class CGtkDisplayer : public NLMISC::CWindowDisplayer
{
public:
CGtkDisplayer (const char *displayerName = "") : CWindowDisplayer(displayerName)
{
needSlashR = false;
createLabel ("@Clear|CLEAR");
}
CGtkDisplayer (const char *displayerName = "");
virtual ~CGtkDisplayer ();

View file

@ -53,7 +53,7 @@
# endif
# ifdef _MSC_VER
# define NL_COMP_VC
# if _MSC_VER >= 1700
# if _MSC_VER >= 1800
# define NL_COMP_VC12
# define NL_COMP_VC_VERSION 120
# elif _MSC_VER >= 1700
@ -463,7 +463,11 @@ typedef uint16 ucchar;
// To define a 64bits constant; ie: UINT64_CONSTANT(0x123456781234)
#ifdef NL_COMP_VC
# if (NL_COMP_VC_VERSION >= 80)
# if (NL_COMP_VC_VERSION >= 120)
# define INT64_CONSTANT(c) (c##LL)
# define SINT64_CONSTANT(c) (c##LL)
# define UINT64_CONSTANT(c) (c##ULL)
# elif (NL_COMP_VC_VERSION >= 80)
# define INT64_CONSTANT(c) (c##LL)
# define SINT64_CONSTANT(c) (c##LL)
# define UINT64_CONSTANT(c) (c##LL)

View file

@ -57,11 +57,7 @@ class CWinDisplayer : public NLMISC::CWindowDisplayer
{
public:
CWinDisplayer (const char *displayerName = "") : CWindowDisplayer(displayerName), Exit(false)
{
needSlashR = true;
createLabel ("@Clear|CLEAR");
}
CWinDisplayer(const char *displayerName = "");
virtual ~CWinDisplayer ();

View file

@ -114,6 +114,7 @@ CApplicationContext::CApplicationContext()
DebugNeedAssert = false;
NoAssert = false;
AlreadyCreateSharedAmongThreads = false;
WindowedApplication = false;
contextReady();
}
@ -242,6 +243,16 @@ void CApplicationContext::setAlreadyCreateSharedAmongThreads(bool b)
AlreadyCreateSharedAmongThreads = b;
}
bool CApplicationContext::isWindowedApplication()
{
return WindowedApplication;
}
void CApplicationContext::setWindowedApplication(bool b)
{
WindowedApplication = b;
}
CLibraryContext::CLibraryContext(INelContext &applicationContext)
: _ApplicationContext(&applicationContext)
{
@ -430,6 +441,16 @@ void CLibraryContext::setAlreadyCreateSharedAmongThreads(bool b)
_ApplicationContext->setAlreadyCreateSharedAmongThreads(b);
}
bool CLibraryContext::isWindowedApplication()
{
return _ApplicationContext->isWindowedApplication();
}
void CLibraryContext::setWindowedApplication(bool b)
{
_ApplicationContext->setWindowedApplication(b);
}
void initNelLibrary(NLMISC::CLibrary &lib)
{
nlassert(lib.isLibraryLoaded());

View file

@ -1223,6 +1223,11 @@ void createDebug (const char *logPath, bool logInFile, bool eraseLastLog)
#endif // LOG_IN_FILE
DefaultMemDisplayer = new CMemDisplayer ("DEFAULT_MD");
#ifdef NL_OS_WINDOWS
if (GetConsoleWindow() == NULL)
INelContext::getInstance().setWindowedApplication(true);
#endif
initDebug2(logInFile);
INelContext::getInstance().setAlreadyCreateSharedAmongThreads(true);

View file

@ -32,6 +32,7 @@
#pragma comment(lib, "gthread-1.3.lib")
#endif
#include "nel/misc/app_context.h"
#include "nel/misc/path.h"
#include "nel/misc/command.h"
#include "nel/misc/thread.h"
@ -59,6 +60,14 @@ static GtkWidget *hrootbox = NULL, *scrolled_win2 = NULL;
// Functions
//
CGtkDisplayer (const char *displayerName) : CWindowDisplayer(displayerName)
{
needSlashR = false;
createLabel ("@Clear|CLEAR");
INelContext::getInstance().setWindowedApplication(true);
}
CGtkDisplayer::~CGtkDisplayer ()
{
if (_Init)

View file

@ -26,6 +26,7 @@
#include <commctrl.h>
#include <ctime>
#include "nel/misc/app_context.h"
#include "nel/misc/path.h"
#include "nel/misc/command.h"
#include "nel/misc/thread.h"
@ -41,6 +42,13 @@ namespace NLMISC {
static CHARFORMAT2 CharFormat;
CWinDisplayer::CWinDisplayer(const char *displayerName) : CWindowDisplayer(displayerName), Exit(false)
{
needSlashR = true;
createLabel("@Clear|CLEAR");
INelContext::getInstance().setWindowedApplication(true);
}
CWinDisplayer::~CWinDisplayer ()
{

View file

@ -365,6 +365,8 @@ int main(int argc, char **argv)
createDebug();
INelContext::getInstance().setWindowedApplication(true);
#ifndef NL_DEBUG
INelContext::getInstance().getDebugLog()->removeDisplayer("DEFAULT_SD");
INelContext::getInstance().getInfoLog()->removeDisplayer("DEFAULT_SD");

View file

@ -1264,6 +1264,7 @@ sint main(int argc, char **argv)
{
// use log.log if NEL_LOG_IN_FILE and SBCLIENT_USE_LOG_LOG defined as 1
createDebug(NULL, SBCLIENT_USE_LOG_LOG, false);
INelContext::getInstance().setWindowedApplication(true);
#if SBCLIENT_USE_LOG
// create snowballs_client.log