Daniele Bartolini hace 9 años
padre
commit
3608fbf8ed

+ 2 - 2
src/core/error/callstack_linux.cpp

@@ -64,7 +64,7 @@ namespace error
 				char line[256];
 				memset(line, 0, sizeof(line));
 
-				CE_LOGE("\t[%2d] %s: (%s)+%s in %s"
+				loge("\t[%2d] %s: (%s)+%s in %s"
 					, i
 					, msg
 					, (demangle_ok == 0 ? real_name : mangled_name)
@@ -77,7 +77,7 @@ namespace error
 			// otherwise, print the whole line
 			else
 			{
-				CE_LOGE("\t[%2d] %s", i, msg);
+				loge("\t[%2d] %s", i, msg);
 			}
 		}
 		free(messages);

+ 2 - 2
src/core/error/callstack_windows.cpp

@@ -80,9 +80,9 @@ namespace error
 			res = res && SymFromAddr(GetCurrentProcess(), stack.AddrPC.Offset, 0, sym);
 
 			if (res == TRUE)
-				CE_LOGE("\t[%2i] %s in %s:%d", num, sym->Name, line.FileName, line.LineNumber);
+				loge("\t[%2i] %s in %s:%d", num, sym->Name, line.FileName, line.LineNumber);
 			else
-				CE_LOGE("\t[%2i] 0x%p", num, stack.AddrPC.Offset);
+				loge("\t[%2i] 0x%p", num, stack.AddrPC.Offset);
 		}
 
 		SymCleanup(GetCurrentProcess());

+ 2 - 2
src/core/error/error.cpp

@@ -14,8 +14,8 @@ namespace error
 {
 	static void abort(const char* file, int line, const char* format, va_list args)
 	{
-		CE_LOGEV(format, args);
-		CE_LOGE("\tIn: %s:%d\n\nStacktrace:", file, line);
+		logev(format, args);
+		loge("\tIn: %s:%d\n\nStacktrace:", file, line);
 		print_callstack();
 		exit(EXIT_FAILURE);
 	}

+ 9 - 9
src/device/device.cpp

@@ -76,7 +76,7 @@ struct BgfxCallback : public bgfx::CallbackI
 		char buf[2048];
 		strncpy(buf, _format, sizeof(buf));
 		buf[strlen32(buf)-1] = '\0'; // Remove trailing newline
-		CE_LOGDV(buf, _argList);
+		logdv(buf, _argList);
 	}
 
 	virtual u32 cacheReadSize(u64 /*_id*/)
@@ -159,9 +159,9 @@ static void console_command_reload(void* data, ConsoleServer& /*cs*/, TCPSocket
 	DynamicString name(ta);
 	sjson::parse_string(obj["resource_type"], type);
 	sjson::parse_string(obj["resource_name"], name);
-	CE_LOGI("Reloading resource '%s.%s'", name.c_str(), type.c_str());
+	logi("Reloading resource '%s.%s'", name.c_str(), type.c_str());
 	((Device*)data)->reload(ResourceId(type.c_str()), ResourceId(name.c_str()));
-	CE_LOGI("Reloaded resource '%s.%s'", name.c_str(), type.c_str());
+	logi("Reloaded resource '%s.%s'", name.c_str(), type.c_str());
 }
 
 static void console_command_pause(void* /*data*/, ConsoleServer& /*cs*/, TCPSocket /*client*/, const char* /*json*/)
@@ -194,9 +194,9 @@ static void console_command_compile(void* data, ConsoleServer& cs, TCPSocket cli
 		cs.send(client, string_stream::c_str(ss));
 	}
 
-	CE_LOGI("Compiling '%s'", id.c_str());
+	logi("Compiling '%s'", id.c_str());
 	bool succ = ((BundleCompiler*)data)->compile(bundle_dir.c_str(), platform.c_str());
-	CE_LOGI("Compiled '%s'", id.c_str());
+	logi("Compiled '%s'", id.c_str());
 
 	{
 		TempAllocator512 ta;
@@ -443,7 +443,7 @@ void Device::run()
 		_console_server->register_command(StringId32("unpause"), console_command_unpause, NULL);
 		_console_server->listen(_device_options._console_port, _device_options._wait_console);
 
-		CE_LOGI("Initializing Crown Engine %s...", version());
+		logi("Initializing Crown Engine %s...", version());
 
 		profiler_globals::init();
 
@@ -551,7 +551,7 @@ void Device::run()
 		_lua_environment->execute((LuaResource*)_resource_manager->get(RESOURCE_TYPE_SCRIPT, boot_script_name));
 		_lua_environment->call_global("init", 0);
 
-		CE_LOGD("Engine initialized");
+		logd("Engine initialized");
 
 		s16 mouse_x = 0;
 		s16 mouse_y = 0;
@@ -653,13 +653,13 @@ void Device::quit()
 void Device::pause()
 {
 	_paused = true;
-	CE_LOGI("Engine paused.");
+	logi("Engine paused.");
 }
 
 void Device::unpause()
 {
 	_paused = false;
-	CE_LOGI("Engine unpaused.");
+	logi("Engine unpaused.");
 }
 
 void Device::resolution(u16& width, u16& height)

+ 3 - 3
src/device/device_options.cpp

@@ -13,7 +13,7 @@ namespace crown
 {
 static void help(const char* msg = NULL)
 {
-	CE_LOGI(
+	logi(
 		"The Flexible Game Engine\n"
 		"Copyright (c) 2012-2016 Daniele Bartolini and individual contributors.\n"
 		"License: https://github.com/taylor001/crown/blob/master/LICENSE\n"
@@ -42,7 +42,7 @@ static void help(const char* msg = NULL)
 	);
 
 	if (msg)
-		CE_LOGE("Error: %s", msg);
+		loge("Error: %s", msg);
 }
 
 DeviceOptions::DeviceOptions(int argc, const char** argv)
@@ -77,7 +77,7 @@ int DeviceOptions::parse()
 
 	if (cl.has_argument("version", 'v'))
 	{
-		CE_LOGI(CROWN_VERSION);
+		logi(CROWN_VERSION);
 		return EXIT_FAILURE;
 	}
 

+ 8 - 8
src/device/log.h

@@ -32,11 +32,11 @@ namespace log_internal
 } // namespace log_internal
 } // namespace crown
 
-#define CE_LOGIV(msg, va_list) crown::log_internal::logx(crown::LogSeverity::INFO, msg, va_list)
-#define CE_LOGDV(msg, va_list) crown::log_internal::logx(crown::LogSeverity::DEBUG, msg, va_list)
-#define CE_LOGEV(msg, va_list) crown::log_internal::logx(crown::LogSeverity::ERROR, msg, va_list)
-#define CE_LOGWV(msg, va_list) crown::log_internal::logx(crown::LogSeverity::WARN, msg, va_list)
-#define CE_LOGI(msg, ...) crown::log_internal::logx(crown::LogSeverity::INFO, msg, ##__VA_ARGS__)
-#define CE_LOGD(msg, ...) crown::log_internal::logx(crown::LogSeverity::DEBUG, msg, ##__VA_ARGS__)
-#define CE_LOGE(msg, ...) crown::log_internal::logx(crown::LogSeverity::ERROR, msg, ##__VA_ARGS__)
-#define CE_LOGW(msg, ...) crown::log_internal::logx(crown::LogSeverity::WARN, msg, ##__VA_ARGS__)
+#define logiv(msg, va_list) crown::log_internal::logx(crown::LogSeverity::INFO, msg, va_list)
+#define logdv(msg, va_list) crown::log_internal::logx(crown::LogSeverity::DEBUG, msg, va_list)
+#define logev(msg, va_list) crown::log_internal::logx(crown::LogSeverity::ERROR, msg, va_list)
+#define logwv(msg, va_list) crown::log_internal::logx(crown::LogSeverity::WARN, msg, va_list)
+#define logi(msg, ...) crown::log_internal::logx(crown::LogSeverity::INFO, msg, ##__VA_ARGS__)
+#define logd(msg, ...) crown::log_internal::logx(crown::LogSeverity::DEBUG, msg, ##__VA_ARGS__)
+#define loge(msg, ...) crown::log_internal::logx(crown::LogSeverity::ERROR, msg, ##__VA_ARGS__)
+#define logw(msg, ...) crown::log_internal::logx(crown::LogSeverity::WARN, msg, ##__VA_ARGS__)

+ 1 - 1
src/lua/lua_environment.cpp

@@ -38,7 +38,7 @@ static int error_handler(lua_State* L)
 	lua_pushinteger(L, 2);
 	lua_call(L, 2, 1); // Call debug.traceback
 
-	CE_LOGE(lua_tostring(L, -1)); // Print error message
+	loge(lua_tostring(L, -1)); // Print error message
 	lua_pop(L, 1); // Remove error message from stack
 	lua_pop(L, 1); // Remove debug.traceback from stack
 

+ 1 - 1
src/resource/bundle_compiler.cpp

@@ -164,7 +164,7 @@ bool BundleCompiler::compile(FilesystemDisk& bundle_fs, const char* type, const
 
 	path::join(CROWN_DATA_DIRECTORY, dst_path.c_str(), path);
 
-	CE_LOGI("%s <= %s", dst_path.c_str(), src_path.c_str());
+	logi("%s <= %s", dst_path.c_str(), src_path.c_str());
 
 	bool success = true;
 	jmp_buf buf;

+ 1 - 1
src/resource/compile_options.h

@@ -50,7 +50,7 @@ public:
 
 	void error(const char* msg, va_list args)
 	{
-		CE_LOGEV(msg, args);
+		logev(msg, args);
 		longjmp(*_jmpbuf, 1);
 	}
 

+ 1 - 1
src/world/material.cpp

@@ -29,7 +29,7 @@ void Material::bind(ResourceManager& rm, ShaderManager& sm, u8 view) const
 		sampler.idx = th->sampler_handle;
 		texture.idx = teximg->handle.idx;
 
-		bgfx::setTexture(i, sampler, texture);
+		bgfx::setTexture(i, sampler, texture, BGFX_TEXTURE_MIN_POINT | BGFX_TEXTURE_MAG_POINT);
 	}
 
 	// Set uniforms

+ 1 - 1
src/world/physics_world_bullet.cpp

@@ -126,7 +126,7 @@ public:
 
 	void reportErrorWarning(const char* warningString)
 	{
-		CE_LOGW(warningString);
+		logw(warningString);
 	}
 
 	void draw3dText(const btVector3& /*location*/, const char* /*textString*/)

+ 3 - 3
src/world/sound_world_al.cpp

@@ -57,9 +57,9 @@ namespace audio_globals
 
 		AL_CHECK(alcMakeContextCurrent(s_al_context));
 
-		CE_LOGD("OpenAL Vendor   : %s", alGetString(AL_VENDOR));
-		CE_LOGD("OpenAL Version  : %s", alGetString(AL_VERSION));
-		CE_LOGD("OpenAL Renderer : %s", alGetString(AL_RENDERER));
+		logd("OpenAL Vendor   : %s", alGetString(AL_VENDOR));
+		logd("OpenAL Version  : %s", alGetString(AL_VERSION));
+		logd("OpenAL Renderer : %s", alGetString(AL_RENDERER));
 
 		AL_CHECK(alDistanceModel(AL_LINEAR_DISTANCE_CLAMPED));
 		AL_CHECK(alDopplerFactor(1.0f));