Esempio n. 1
0
// DarkRadiant module entry point
extern "C" void DARKRADIANT_DLLEXPORT RegisterModule(IModuleRegistry& registry) {

	pico_initialise();

	const picoModule_t** modules = PicoModuleList( 0 );

	while (*modules != 0) {
		const picoModule_t* module = *modules++;

		if (module->canload && module->load)	{
			for (char*const* ext = module->defaultExts; *ext != 0; ++ext) {
				// greebo: File extension is expected to be UPPERCASE
				std::string extension(*ext);
				boost::algorithm::to_upper(extension);

				registry.registerModule(
					model::PicoModelLoaderPtr(new model::PicoModelLoader(module, extension))
				);
			}
		}
	}

	// Initialise the streams using the given application context
	module::initialiseStreams(registry.getApplicationContext());

	// Remember the reference to the ModuleRegistry
	module::RegistryReference::Instance().setRegistry(registry);

	// Set up the assertion handler
	GlobalErrorHandler() = registry.getApplicationContext().getErrorHandlingFunction();
}
void ApplicationContextImpl::initErrorHandler()
{
#ifdef _DEBUG
	// Use the PopupErrorHandler, which displays a GTK popup box
	_errorHandler = radiant::PopupErrorHandler::HandleError;

	// Initialise the function pointer in our binary's scope
	GlobalErrorHandler() = _errorHandler;
#endif
}
Esempio n. 3
0
extern "C" void DARKRADIANT_DLLEXPORT RegisterModule(IModuleRegistry& registry) {
	registry.registerModule(sound::SoundManagerPtr(new sound::SoundManager));

	// Initialise the streams using the given application context
	module::initialiseStreams(registry.getApplicationContext());

	// Remember the reference to the ModuleRegistry
	module::RegistryReference::Instance().setRegistry(registry);

	// Set up the assertion handler
	GlobalErrorHandler() = registry.getApplicationContext().getErrorHandlingFunction();
}
Esempio n. 4
0
void GlobalError(const char* string, ...)
{
	static char buffer[BUFFER_LENGTH];

	va_list ap;
	va_start(ap, string);
	int length = vsnprintf(buffer, BUFFER_LENGTH, string, ap);
	va_end(ap);

	if (length >= BUFFER_LENGTH)
	{
		SysError("Attempted to overrun string in call to GlobalError()!");
	}

	GlobalErrorHandler(ERR_NORMAL, buffer);
}
Esempio n. 5
0
void FatalError(const char* string, const fmt::ArgList& formatList)
{
	GlobalErrorHandler(ERR_FATAL, fmt::sprintf(string, formatList).c_str());
}
Esempio n. 6
0
int FatalErrorReal(const char* file, int line, uint32_t stringHash, const char* string, const fmt::ArgList& formatList)
{
	ScopedError error(file, line, stringHash);
	return GlobalErrorHandler(ERR_FATAL, fmt::sprintf(string, formatList).c_str());
}