Browse Source

Same as before

Panagiotis Christopoulos Charitos 13 years ago
parent
commit
47d7c8c154

+ 22 - 10
CMakeLists.txt

@@ -91,8 +91,10 @@ ENDIF()
 #
 # Freetype
 #
-SET(FREETYPE_INCLUDE_DIR "/usr/include/freetype2" CACHE PATH "The directory that contains the Freetype headers")
-SET(FREETYPE_LIBRARY_DIR "/usr/lib" CACHE PATH "The directory that contains the libfreetype.so")
+SET(FREETYPE_INCLUDE_DIR "/usr/include/freetype2" 
+	CACHE PATH "The directory that contains the Freetype headers")
+SET(FREETYPE_LIBRARY_DIR "/usr/lib" 
+	CACHE PATH "The directory that contains the libfreetype.so")
 
 ANKI_ADD_LIB(${FREETYPE_INCLUDE_DIR} ${FREETYPE_LIBRARY_DIR} ${FREETYPE_INCLUDE_DIR}/freetype/freetype.h)
 
@@ -108,27 +110,37 @@ ANKI_ADD_LIB(${PYTHON_INCLUDE_DIR} ${PYTHON_LIBRARY_DIR} ${PYTHON_INCLUDE_DIR}/P
 #
 # Bullet (Because FIND_PACKAGE(Bullet) sucks)
 #
-SET(BULLET_INCLUDE_DIR "${ANKI_PROJ_SOURCE_DIR}/extern/include/" CACHE PATH "The directory that contains the bullet directory with the header files")
-SET(BULLET_LIBRARY_DIR "${ANKI_PROJ_SOURCE_DIR}/extern/lib${ARCH}" CACHE PATH "The directory that contains the Bullet (static) libraries")
+SET(BULLET_INCLUDE_DIR "${ANKI_PROJ_SOURCE_DIR}/extern/include/" CACHE PATH 
+	"The directory that contains the bullet directory with the header files")
+SET(BULLET_LIBRARY_DIR "${ANKI_PROJ_SOURCE_DIR}/extern/lib${ARCH}" CACHE PATH 
+	"The directory that contains the Bullet (static) libraries")
 
-ANKI_ADD_LIB(${BULLET_INCLUDE_DIR}/bullet ${BULLET_LIBRARY_DIR} ${BULLET_INCLUDE_DIR}/bullet/btBulletCollisionCommon.h)
+ANKI_ADD_LIB(${BULLET_INCLUDE_DIR}/bullet ${BULLET_LIBRARY_DIR} 
+	${BULLET_INCLUDE_DIR}/bullet/btBulletCollisionCommon.h)
 
 #
 # GLEW
 #
-SET(GLEW_INCLUDE_DIR "${ANKI_PROJ_SOURCE_DIR}/extern/include" CACHE PATH "The directory that contains the GL directory with the header files")
-SET(GLEW_LIBRARY_DIR "${ANKI_PROJ_SOURCE_DIR}/extern/lib${ARCH}" CACHE PATH "The directory that contains the GLEW (static) libraries")
+SET(GLEW_INCLUDE_DIR "${ANKI_PROJ_SOURCE_DIR}/extern/include" CACHE PATH 
+	"The directory that contains the GL directory with the header files")
+SET(GLEW_LIBRARY_DIR "${ANKI_PROJ_SOURCE_DIR}/extern/lib${ARCH}" CACHE PATH 
+	"The directory that contains the GLEW (static) libraries")
 
-ANKI_ADD_LIB(${GLEW_INCLUDE_DIR} ${GLEW_LIBRARY_DIR} ${GLEW_INCLUDE_DIR}/GL/glew.h)
+ANKI_ADD_LIB(${GLEW_INCLUDE_DIR} ${GLEW_LIBRARY_DIR} 
+	${GLEW_INCLUDE_DIR}/GL/glew.h)
 
 #
 # Defines & flags
 #
-ADD_DEFINITIONS("-DANKI_MATH_INTEL_SIMD -DGLEW_MX -Dthread_local=__thread -pedantic-errors -pedantic -ansi -Wall -Winline -W -Wwrite-strings -Wno-unused -Wfatal-errors -Werror -Wno-long-long -msse4 -std=c++0x")
+ADD_DEFINITIONS(-DANKI_MATH_INTEL_SIMD -DGLEW_MX 
+	-Dthread_local=__thread -pedantic-errors -pedantic -ansi -Wall -Winline 
+	-W -Wwrite-strings -Wno-unused -Wfatal-errors -Werror -Wno-long-long 
+	-msse4 -std=c++0x)
 
 # Add a few compiler specific stuff 
 IF(${CMAKE_CXX_COMPILER} MATCHES ".*clang\\+\\+$")	
-	# Do nothing
+	INCLUDE_DIRECTORIES("/opt/libcxx/include/c++/v1")
+	LINK_DIRECTORIES("/opt/libcxx/lib")
 ELSE()
 	# Dont use it. It produces warnings with -std=c++0x
 	#ADD_DEFINITIONS("-fsingle-precision-constant")

+ 4 - 7
include/anki/core/App.h

@@ -5,16 +5,13 @@
 #include <boost/filesystem.hpp>
 #include "anki/core/Logger.h"
 
-
 namespace anki {
 
-
 class StdinListener;
 class Scene;
 class Camera;
 class Input;
 
-
 /// The core class of the engine.
 ///
 /// - It initializes the window
@@ -23,6 +20,8 @@ class Input;
 class App
 {
 public:
+	ANKI_HAS_SLOTS(App)
+
 	App()
 	{}
 	~App()
@@ -115,16 +114,14 @@ private:
 	void parseCommandLineArgs(int argc, char* argv[]);
 
 	/// A slot to handle the messageHandler's signal
-	void handleMessageHanlderMsgs(const char* file, int line,
-		const char* func, Logger::MessageType, const char* msg);
+	void handleLoggerMessages(const Logger::Info& info);
+	ANKI_SLOT(handleLoggerMessages, const Logger::Info&)
 
 	void initWindow();
 	void initDirs();
 	void initRenderer();
 };
 
-
 } // end namespace
 
-
 #endif

+ 4 - 4
include/anki/core/Logger.h

@@ -58,13 +58,13 @@ typedef Singleton<Logger> LoggerSingleton;
 		std::stringstream ss; \
 		ss << msg; \
 		LoggerSingleton::get().write(__FILE__, __LINE__, __func__, \
-			t, msg.str().c_str()); \
+			t, ss.str().c_str()); \
 	} while(false);
 
-#define ANKI_INFO(x) ANKI_LOGGER_MESSAGE(Logger::FMT_NORMAL, x)
+#define ANKI_LOGI(x) ANKI_LOGGER_MESSAGE(Logger::LMT_NORMAL, x)
 
-#define ANKI_WARNING(x) ANKI_LOGGER_MESSAGE(Logger::FMT_WARNING, x)
+#define ANKI_LOGW(x) ANKI_LOGGER_MESSAGE(Logger::LMT_WARNING, x)
 
-#define ANKI_ERROR(x) ANKI_LOGGER_MESSAGE(Logger::FMT_ERROR, x)
+#define ANKI_LOGE(x) ANKI_LOGGER_MESSAGE(Logger::LMT_ERROR, x)
 
 #endif

+ 8 - 16
include/anki/gl/GlStateMachine.h → include/anki/gl/GlState.h

@@ -1,20 +1,18 @@
-#ifndef ANKI_GL_GL_STATE_MACHINE_H
-#define ANKI_GL_GL_STATE_MACHINE_H
+#ifndef ANKI_GL_GL_STATE_H
+#define ANKI_GL_GL_STATE_H
 
+#include "anki/util/Singleton.h"
 #include <GL/glew.h>
-#include <boost/unordered_map.hpp>
-#include "anki/util/Assert.h"
-
+#include <unordered_map>
 
 namespace anki {
 
-
 /// Access the GL state machine.
 /// This class saves us from calling the GL functions
-class GlStateMachine
+class GlState
 {
 public:
-	GlStateMachine()
+	GlState()
 	{
 		sync();
 	}
@@ -32,19 +30,13 @@ public:
 	}
 	bool isEnabled(GLenum flag);
 
-	void useShaderProg(GLuint id);
-
 	void setViewport(uint x, uint y, uint w, uint h);
-
-	static GLuint getCurrentProgramGlId();
 	/// @}
 
 private:
 	/// @name The GL state
 	/// @{
-	GLuint sProgGlId; ///< Last used SProg ID
-
-	boost::unordered_map<GLenum, bool> flags;
+	std::unordered_map<GLenum, bool> flags;
 	static GLenum flagEnums[];
 
 	GLint viewportX;
@@ -54,8 +46,8 @@ private:
 	/// @}
 };
 
+typedef SingletonThreadSafe<GlState> GlStateSingleton;
 
 } // end namespace
 
-
 #endif

+ 1 - 0
include/anki/gl/ShaderProgram.h

@@ -9,6 +9,7 @@
 #include <boost/ptr_container/ptr_vector.hpp>
 #include <GL/glew.h>
 #include <vector>
+#include <string>
 
 namespace anki {
 

+ 3 - 3
include/anki/util/Observer.h

@@ -73,16 +73,16 @@ private:
 /// If a class has slots it should include this
 /// @code
 /// class Foo {
-/// 	ANKI_OBSERVING(Foo)
+/// 	ANKI_HAS_SLOTS(Foo)
 /// };
 /// @endcode
-#define ANKI_OBSERVING(_class) \
+#define ANKI_HAS_SLOTS(_class) \
 	typedef _class ObservingType;
 
 /// Define a slot. This should follow the method declaration
 /// @code
 /// class Foo {
-/// 	ANKI_OBSERVING(Foo)
+/// 	ANKI_HAS_SLOTS(Foo)
 ///
 /// 	void slot(const float&)
 /// 	{...}

+ 22 - 57
src/core/App.cpp

@@ -11,44 +11,36 @@
 #include <boost/filesystem.hpp>
 #include <boost/algorithm/string.hpp>
 
-
 namespace anki {
 
-
-//==============================================================================
-// handleMessageHanlderMsgs                                                    =
 //==============================================================================
-void App::handleMessageHanlderMsgs(const char* file, int line,
-	const char* func, Logger::MessageType type, const char* msg)
+void App::handleLoggerMessages(const Logger::Info& info)
 {
 	std::ostream* out = NULL;
 	const char* x = NULL;
 
-	switch(type)
+	switch(info.type)
 	{
-		case Logger::MT_NORMAL:
+		case Logger::LMT_NORMAL:
 			out = &std::cout;
 			x = "Info";
 			break;
 
-		case Logger::MT_ERROR:
+		case Logger::LMT_ERROR:
 			out = &std::cerr;
 			x = "Error";
 			break;
 
-		case Logger::MT_WARNING:
+		case Logger::LMT_WARNING:
 			out = &std::cerr;
 			x = "Warn";
 			break;
 	}
 
-	(*out) << "(" << file << ":" << line << " "<< func <<
-		") " << x << ": " << msg << std::flush;
+	(*out) << "(" << info.file << ":" << info.line << " "<< info.func 
+		<< ") " << x << ": " << info.msg << std::flush;
 }
 
-
-//==============================================================================
-// parseCommandLineArgs                                                        =
 //==============================================================================
 void App::parseCommandLineArgs(int argc, char* argv[])
 {
@@ -65,16 +57,13 @@ void App::parseCommandLineArgs(int argc, char* argv[])
 		}
 		else
 		{
-			std::cerr << "Incorrect command line argument \"" << arg <<
-				"\"" << std::endl;
+			std::cerr << "Incorrect command line argument \"" << arg 
+				<< "\"" << std::endl;
 			abort();
 		}
 	}
 }
 
-
-//==============================================================================
-// init                                                                        =
 //==============================================================================
 void App::init(int argc, char* argv[])
 {
@@ -84,7 +73,8 @@ void App::init(int argc, char* argv[])
 	fullScreenFlag = false;
 
 	// send output to handleMessageHanlderMsgs
-	LoggerSingleton::get().connect(&App::handleMessageHanlderMsgs, this);
+	ANKI_CONNECT(&LoggerSingleton::get(), messageRecieved, 
+		this, handleLoggerMessages);
 
 	parseCommandLineArgs(argc, argv);
 	printAppInfo();
@@ -96,13 +86,10 @@ void App::init(int argc, char* argv[])
 	timerTick = 1.0 / 60.0; // in sec. 1.0 / period
 }
 
-
-//==============================================================================
-// initWindow                                                                  =
 //==============================================================================
 void App::initWindow()
 {
-	ANKI_INFO("SDL window initializing...");
+	ANKI_LOGI("SDL window initializing...");
 
 	if(SDL_Init(SDL_INIT_VIDEO) < 0)
 	{
@@ -113,7 +100,7 @@ void App::initWindow()
 	const char* driverName = SDL_GetCurrentVideoDriver();
 	if(driverName != NULL)
 	{
-		ANKI_INFO("Video driver name: " << driverName);
+		ANKI_LOGI("Video driver name: " << driverName);
 	}
 
 	// set GL attribs
@@ -140,7 +127,7 @@ void App::initWindow()
 	iconImage = SDL_LoadBMP("gfx/icon.bmp");
 	if(iconImage == NULL)
 	{
-		ANKI_WARNING("Cannot load window icon");
+		ANKI_LOGW("Cannot load window icon");
 	}
 	else
 	{
@@ -150,36 +137,30 @@ void App::initWindow()
 		SDL_SetWindowIcon(windowId, iconImage);
 	}
 
-	ANKI_INFO("SDL window initialization ends");
+	ANKI_LOGI("SDL window initialization ends");
 }
 
-
-//==============================================================================
-// initDirs                                                                    =
 //==============================================================================
 void App::initDirs()
 {
 	settingsPath = boost::filesystem::path(getenv("HOME")) / ".anki";
 	if(!boost::filesystem::exists(settingsPath))
 	{
-		ANKI_INFO("Creating settings dir \"" << settingsPath.string() << "\"");
+		ANKI_LOGI("Creating settings dir \"" << settingsPath.string() << "\"");
 		boost::filesystem::create_directory(settingsPath);
 	}
 
 	cachePath = settingsPath / "cache";
 	if(boost::filesystem::exists(cachePath))
 	{
-		ANKI_INFO("Deleting dir \"" << cachePath.string() << "\"");
+		ANKI_LOGI("Deleting dir \"" << cachePath.string() << "\"");
 		boost::filesystem::remove_all(cachePath);
 	}
 
-	ANKI_INFO("Creating cache dir \"" << cachePath.string() << "\"");
+	ANKI_LOGI("Creating cache dir \"" << cachePath.string() << "\"");
 	boost::filesystem::create_directory(cachePath);
 }
 
-
-//==============================================================================
-// togleFullScreen                                                             =
 //==============================================================================
 void App::togleFullScreen()
 {
@@ -188,9 +169,6 @@ void App::togleFullScreen()
 	fullScreenFlag = !fullScreenFlag;
 }
 
-
-//==============================================================================
-// swapBuffers                                                                 =
 //==============================================================================
 void App::swapBuffers()
 {
@@ -198,9 +176,6 @@ void App::swapBuffers()
 	SDL_GL_SwapWindow(windowId);
 }
 
-
-//==============================================================================
-// quit                                                                        =
 //==============================================================================
 void App::quit(int code)
 {
@@ -211,9 +186,6 @@ void App::quit(int code)
 	exit(code);
 }
 
-
-//==============================================================================
-// printAppInfo                                                                =
 //==============================================================================
 #if !defined(ANKI_REVISION)
 #	define ANKI_REVISION "unknown"
@@ -233,16 +205,13 @@ void App::printAppInfo()
 	msg << "compiler ID " << ANKI_COMPILER << ", ";
 	msg << "GLEW " << glewGetString(GLEW_VERSION) << ", ";
 	const SDL_version* v = SDL_Linked_Version();
-	msg << "SDL " << int(v->major) << '.' << int(v->minor) << '.' <<
-		int(v->patch) << ", " << "build date " __DATE__ << ", " <<
-		"rev " << ANKI_REVISION;
+	msg << "SDL " << int(v->major) << '.' << int(v->minor) << '.' 
+		<< int(v->patch) << ", " << "build date " __DATE__ << ", " 
+		<< "rev " << ANKI_REVISION;
 
-	ANKI_INFO(msg.str());
+	ANKI_LOGI(msg.str());
 }
 
-
-//==============================================================================
-// getDesktopWidth                                                             =
 //==============================================================================
 uint App::getDesktopWidth() const
 {
@@ -252,9 +221,6 @@ uint App::getDesktopWidth() const
 	return mode.w;
 }
 
-
-//==============================================================================
-// getDesktopHeight                                                            =
 //==============================================================================
 uint App::getDesktopHeight() const
 {
@@ -264,5 +230,4 @@ uint App::getDesktopHeight() const
 	return mode.h;
 }
 
-
 } // end namespace

+ 5 - 5
src/core/AsyncLoader.cpp

@@ -12,7 +12,7 @@ namespace anki {
 //==============================================================================
 void AsyncLoader::start()
 {
-	ANKI_INFO("Starting async loader thread...");
+	ANKI_LOGI("Starting async loader thread...");
 	thread = boost::thread(&AsyncLoader::workingFunc, this);
 }
 
@@ -23,7 +23,7 @@ void AsyncLoader::start()
 void AsyncLoader::load(const char* filename, LoadCallback loadCallback,
 	void* storage)
 {
-	ANKI_INFO("New load request for \"" << filename << "\"");
+	ANKI_LOGI("New load request for \"" << filename << "\"");
 	boost::mutex::scoped_lock lock(mutexReq);
 	Request f = {filename, loadCallback, storage};
 	requests.push_back(f);
@@ -47,7 +47,7 @@ void AsyncLoader::workingFunc()
 			boost::mutex::scoped_lock lock(mutexReq);
 			while(requests.empty())
 			{
-				ANKI_INFO("Waiting...");
+				ANKI_LOGI("Waiting...");
 				condVar.wait(lock);
 			}
 
@@ -60,11 +60,11 @@ void AsyncLoader::workingFunc()
 		try
 		{
 			req.loadCallback(req.filename.c_str(), req.storage);
-			ANKI_INFO("File \"" << req.filename << "\" loaded");
+			ANKI_LOGI("File \"" << req.filename << "\" loaded");
 		}
 		catch(std::exception& e)
 		{
-			ANKI_ERROR("Loading \"" << req.filename <<
+			ANKI_LOGE("Loading \"" << req.filename <<
 				"\" failed: " << e.what());
 			ok = false;
 		}

+ 7 - 39
src/gl/GlStateMachine.cpp → src/gl/GlState.cpp

@@ -1,14 +1,11 @@
-#include "anki/gl/GlStateMachine.h"
-
+#include "anki/gl/GlState.h"
+#include "anki/util/Assert.h"
 
 namespace anki {
 
-
-//==============================================================================
-// Statics                                                                     =
 //==============================================================================
 
-GLenum GlStateMachine::flagEnums[] = {
+GLenum GlState::flagEnums[] = {
 	GL_DEPTH_TEST,
 	GL_BLEND,
 	GL_STENCIL_TEST,
@@ -18,9 +15,8 @@ GLenum GlStateMachine::flagEnums[] = {
 	0
 };
 
-
 //==============================================================================
-void GlStateMachine::enable(GLenum glFlag, bool enable)
+void GlState::enable(GLenum glFlag, bool enable)
 {
 	ANKI_ASSERT(flags.find(glFlag) != flags.end());
 	bool state = flags[glFlag];
@@ -40,9 +36,8 @@ void GlStateMachine::enable(GLenum glFlag, bool enable)
 	}
 }
 
-
 //==============================================================================
-bool GlStateMachine::isEnabled(GLenum glFlag)
+bool GlState::isEnabled(GLenum glFlag)
 {
 	ANKI_ASSERT(flags.find(glFlag) != flags.end());
 	bool state = flags[glFlag];
@@ -50,12 +45,9 @@ bool GlStateMachine::isEnabled(GLenum glFlag)
 	return state;
 }
 
-
 //==============================================================================
-void GlStateMachine::sync()
+void GlState::sync()
 {
-	sProgGlId = getCurrentProgramGlId();
-
 	// Set flags
 	GLenum* flagEnum = &flagEnums[0];
 	while(*flagEnum != 0)
@@ -73,9 +65,8 @@ void GlStateMachine::sync()
 	viewportH = viewport[3];
 }
 
-
 //==============================================================================
-void GlStateMachine::setViewport(uint x, uint y, uint w, uint h)
+void GlState::setViewport(uint x, uint y, uint w, uint h)
 {
 	if(x != (uint)viewportX || y != (uint)viewportY 
 		|| w != (uint)viewportW || h != (uint)viewportH)
@@ -88,27 +79,4 @@ void GlStateMachine::setViewport(uint x, uint y, uint w, uint h)
 	}
 }
 
-
-//==============================================================================
-void GlStateMachine::useShaderProg(GLuint id)
-{
-	ANKI_ASSERT(getCurrentProgramGlId() == sProgGlId);
-
-	if(sProgGlId != id)
-	{
-		glUseProgram(id);
-		sProgGlId = id;
-	}
-}
-
-
-//==============================================================================
-GLuint GlStateMachine::getCurrentProgramGlId()
-{
-	int i;
-	glGetIntegerv(GL_CURRENT_PROGRAM, &i);
-	return i;
-}
-
-
 } // end namespace

+ 1 - 1
src/gl/ShaderProgram.cpp

@@ -11,7 +11,7 @@ namespace anki {
 //==============================================================================
 
 //==============================================================================
-ShaderProgramVariable(
+ShaderProgramVariable::ShaderProgramVariable(
 	GLint loc_, 
 	const char* name_,
 	GLenum glDataType_, 

+ 2 - 2
src/input/Input.cpp

@@ -11,11 +11,11 @@ namespace anki {
 //==============================================================================
 void Input::init()
 {
-	ANKI_INFO("Initializing input...");
+	ANKI_LOGI("Initializing input...");
 	warpMouseFlag = false;
 	hideCursor = true;
 	reset();
-	ANKI_INFO("Input initialized");
+	ANKI_LOGI("Input initialized");
 }
 
 

+ 2 - 2
src/renderer/Drawer.cpp

@@ -390,7 +390,7 @@ void PhysicsDebugDrawer::drawContactPoint(const btVector3& /*pointOnB*/,
 	const btVector3& /*normalOnB*/,
 	btScalar /*distance*/, int /*lifeTime*/, const btVector3& /*color*/)
 {
-	//ANKI_WARNING("Unimplemented");
+	//ANKI_LOGW("Unimplemented");
 }
 
 //==============================================================================
@@ -403,7 +403,7 @@ void PhysicsDebugDrawer::reportErrorWarning(const char* warningString)
 void PhysicsDebugDrawer::draw3dText(const btVector3& /*location*/,
 	const char* /*textString*/)
 {
-	//ANKI_WARNING("Unimplemented");
+	//ANKI_LOGW("Unimplemented");
 }
 
 //==============================================================================

+ 4 - 4
src/renderer/MainRenderer.cpp

@@ -38,7 +38,7 @@ MainRenderer::~MainRenderer()
 //==============================================================================
 void MainRenderer::init(const RendererInitializer& initializer_)
 {
-	ANKI_INFO("Initializing main renderer...");
+	ANKI_LOGI("Initializing main renderer...");
 	initGl();
 
 	sProg.load("shaders/Final.glsl");
@@ -57,7 +57,7 @@ void MainRenderer::init(const RendererInitializer& initializer_)
 	Renderer::init(initializer);
 	dbg.init(initializer);
 	deformer.reset(new Deformer(*this));
-	ANKI_INFO("Main renderer initialized");
+	ANKI_LOGI("Main renderer initialized");
 }
 
 
@@ -77,7 +77,7 @@ void MainRenderer::initGl()
 	glGetError();
 
 	// print GL info
-	ANKI_INFO("OpenGL info: OGL " <<
+	ANKI_LOGI("OpenGL info: OGL " <<
 		reinterpret_cast<const char*>(glGetString(GL_VERSION)) <<
 		", GLSL " << reinterpret_cast<const char*>(
 			glGetString(GL_SHADING_LANGUAGE_VERSION)));
@@ -266,7 +266,7 @@ void MainRenderer::takeScreenshot(const char* filename)
 		throw ANKI_EXCEPTION("File \"" + filename +
 			"\": Unsupported extension");
 	}
-	//ANKI_INFO("Screenshot \"" << filename << "\" saved");
+	//ANKI_LOGI("Screenshot \"" << filename << "\" saved");
 }
 
 

+ 5 - 5
src/resource/AsyncOperator.cpp

@@ -10,7 +10,7 @@ namespace anki {
 //==============================================================================
 void AsyncOperator::start()
 {
-	ANKI_INFO("Starting async operator thread...");
+	ANKI_LOGI("Starting async operator thread...");
 	thread = boost::thread(&AsyncOperator::workingFunc, this);
 }
 
@@ -18,7 +18,7 @@ void AsyncOperator::start()
 //==============================================================================
 void AsyncOperator::putBack(Request* newReq)
 {
-	ANKI_INFO("New request (" << newReq->getInfo() << ")");
+	ANKI_LOGI("New request (" << newReq->getInfo() << ")");
 	boost::mutex::scoped_lock lock(mutexReq);
 	requests.push_back(newReq);
 	lock.unlock();
@@ -39,7 +39,7 @@ void AsyncOperator::workingFunc()
 			boost::mutex::scoped_lock lock(mutexReq);
 			while(requests.empty())
 			{
-				ANKI_INFO("Waiting...");
+				ANKI_LOGI("Waiting...");
 				condVar.wait(lock);
 			}
 
@@ -57,11 +57,11 @@ void AsyncOperator::workingFunc()
 		try
 		{
 			req->exec();
-			ANKI_INFO("Request served (" << req->getInfo() << ")");
+			ANKI_LOGI("Request served (" << req->getInfo() << ")");
 		}
 		catch(const std::exception& e)
 		{
-			ANKI_ERROR("Request failed (" << req->getInfo() << "): " <<
+			ANKI_LOGE("Request failed (" << req->getInfo() << "): " <<
 				e.what());
 			ok = false;
 		}

+ 7 - 7
src/resource/LightRsrc.cpp

@@ -96,7 +96,7 @@ void LightRsrc::load(const char* filename)
 
 			if(type == LT_SPOT)
 			{
-				ANKI_WARNING("File \"" << filename <<
+				ANKI_LOGW("File \"" << filename <<
 					"\": No radius for spot lights");
 			}
 		}
@@ -111,7 +111,7 @@ void LightRsrc::load(const char* filename)
 
 			if(type == LT_POINT)
 			{
-				ANKI_WARNING("File \"" << filename <<
+				ANKI_LOGW("File \"" << filename <<
 					"\": No distance for point lights");
 			}
 		}
@@ -126,7 +126,7 @@ void LightRsrc::load(const char* filename)
 
 			if(type == LT_POINT)
 			{
-				ANKI_WARNING("File \"" << filename <<
+				ANKI_LOGW("File \"" << filename <<
 					"\": No fovX for point lights");
 			}
 		}
@@ -141,7 +141,7 @@ void LightRsrc::load(const char* filename)
 
 			if(type == LT_POINT)
 			{
-				ANKI_WARNING("File \"" << filename <<
+				ANKI_LOGW("File \"" << filename <<
 					"\": No fovY for point lights");
 			}
 		}
@@ -156,7 +156,7 @@ void LightRsrc::load(const char* filename)
 
 			if(type == LT_POINT)
 			{
-				ANKI_WARNING("File \"" << filename <<
+				ANKI_LOGW("File \"" << filename <<
 					"\": No width for point lights");
 			}
 		}
@@ -171,7 +171,7 @@ void LightRsrc::load(const char* filename)
 
 			if(type == LT_POINT)
 			{
-				ANKI_WARNING("File \"" << filename <<
+				ANKI_LOGW("File \"" << filename <<
 					"\": No height for point lights");
 			}
 		}
@@ -187,7 +187,7 @@ void LightRsrc::load(const char* filename)
 
 			if(type == LT_POINT)
 			{
-				ANKI_WARNING("File \"" << filename <<
+				ANKI_LOGW("File \"" << filename <<
 					"\": No texture for point lights");
 			}
 		}

+ 2 - 2
src/resource/Material.cpp

@@ -376,7 +376,7 @@ void Material::populateVariables(const boost::property_tree::ptree& pt)
 
 			if(iit == allVarNames.end())
 			{
-				ANKI_WARNING("Input variable \"" <<
+				ANKI_LOGW("Input variable \"" <<
 					name << "\" not used in material \"" << fname << "\"");
 			}
 		}
@@ -446,7 +446,7 @@ void Material::populateVariables(const boost::property_tree::ptree& pt)
 		{
 			std::string value = it1->second;
 
-			ANKI_INFO("With value " << name << " " << value);
+			ANKI_LOGI("With value " << name << " " << value);
 
 			// Get the value
 			switch(dataType)

+ 1 - 1
src/resource/MeshLoader.cpp

@@ -236,7 +236,7 @@ void MeshLoader::createVertTangents()
 			(uvedge01.x() * uvedge02.y());
 		if(Math::isZero(det))
 		{
-			//ANKI_WARNING(getRsrcName() << ": det == " << fixed << det);
+			//ANKI_LOGW(getRsrcName() << ": det == " << fixed << det);
 			det = 0.0001;
 		}
 		else

+ 2 - 2
src/script/ScriptManager.cpp

@@ -56,7 +56,7 @@ namespace anki {
 //==============================================================================
 void ScriptManager::init()
 {
-	ANKI_INFO("Initializing scripting engine...");
+	ANKI_LOGI("Initializing scripting engine...");
 
 	PyImport_AppendInittab((char*)("anki"), &initanki);
 	Py_Initialize();
@@ -64,7 +64,7 @@ void ScriptManager::init()
 	mainNamespace = mainModule.attr("__dict__");
 	ankiModule = object(handle<>(PyImport_ImportModule("anki")));
 
-	ANKI_INFO("Scripting engine initialized");
+	ANKI_LOGI("Scripting engine initialized");
 }
 
 

+ 1 - 1
src/ui/UiPainter.cpp

@@ -107,7 +107,7 @@ void UiPainter::drawText(const char* text)
 		}
 		else if(cc < ' ' || cc > '~') // out of range
 		{
-			ANKI_ERROR("Char out of range (" << cc << "). Ignoring");
+			ANKI_LOGE("Char out of range (" << cc << "). Ignoring");
 		}
 		else
 		{

+ 12 - 12
testapp/Main.cpp

@@ -127,7 +127,7 @@ void initPhysics()
 //==============================================================================
 void init()
 {
-	ANKI_INFO("Other init...");
+	ANKI_LOGI("Other init...");
 
 	Scene& scene = SceneSingleton::get();
 
@@ -143,13 +143,13 @@ void init()
 	// camera
 	PerspectiveCamera* cam = new PerspectiveCamera(scene, SceneNode::SNF_NONE, NULL);
 	//cam->setAll(toRad(100.0), toRad(100.0) / r::MainRendererSingleton::get().getAspectRatio(), 0.5, 200.0);
-	ANKI_INFO(MainRendererSingleton::get().getAspectRatio());
+	ANKI_LOGI(MainRendererSingleton::get().getAspectRatio());
 	cam->setAll(MainRendererSingleton::get().getAspectRatio()*Math::toRad(70.0), Math::toRad(70.0), 0.5, 200.0);
 	cam->moveLocalY(3.0);
 	cam->moveLocalZ(5.7);
 	cam->moveLocalX(-0.3);
 	AppSingleton::get().setActiveCam(cam);
-	ANKI_INFO(cam->getSceneNodeName());
+	ANKI_LOGI(cam->getSceneNodeName());
 
 	OrthographicCamera* ocam = new OrthographicCamera(scene, SceneNode::SNF_NONE, NULL);
 	ocam->setAll(-1, 1, 1.0, -1.0, 0.1, 10.0);
@@ -264,7 +264,7 @@ void init()
 
 	initPhysics();
 
-	//ANKI_INFO("Engine initialization ends (" << (App::getTicks() - ticks) << ")");
+	//ANKI_LOGI("Engine initialization ends (" << (App::getTicks() - ticks) << ")");
 }
 
 
@@ -340,21 +340,21 @@ void mainLoopExtra()
 
 	if(InputSingleton::get().getKey(SDL_SCANCODE_Y) == 1)
 	{
-		ANKI_INFO("Exec script");
+		ANKI_LOGI("Exec script");
 		ScriptManagerSingleton::get().execScript(Util::readFile("test.py").c_str());
 	}
 
 	mover->getLocalTransform().getRotation().reorthogonalize();
 
-	//ANKI_INFO(mover->getSceneNodeName())
+	//ANKI_LOGI(mover->getSceneNodeName())
 
 	/*if(spot_lights[0]->getCamera().insideFrustum(spot_lights[1]->getCamera()))
 	{
-		ANKI_INFO("in");
+		ANKI_LOGI("in");
 	}
 	else
 	{
-		ANKI_INFO("out");
+		ANKI_LOGI("out");
 	}*/
 }
 
@@ -364,7 +364,7 @@ void mainLoopExtra()
 //==============================================================================
 void mainLoop()
 {
-	ANKI_INFO("Entering main loop");
+	ANKI_LOGI("Entering main loop");
 
 	HighRezTimer mainLoopTimer;
 	mainLoopTimer.start();
@@ -458,7 +458,7 @@ void mainLoop()
 		}*/
 	}
 
-	ANKI_INFO("Exiting main loop (" << mainLoopTimer.getElapsedTime() << " sec)");
+	ANKI_LOGI("Exiting main loop (" << mainLoopTimer.getElapsedTime() << " sec)");
 }
 
 
@@ -556,7 +556,7 @@ void execStdinScpripts()
 		}
 		catch(Exception& e)
 		{
-			ANKI_ERROR(e.what());
+			ANKI_LOGE(e.what());
 		}
 	}
 }
@@ -582,7 +582,7 @@ int main(int argc, char* argv[])
 
 		mainLoop();
 
-		ANKI_INFO("Exiting...");
+		ANKI_LOGI("Exiting...");
 		AppSingleton::get().quit(EXIT_SUCCESS);
 		exitCode = 0;
 	}