// 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 }
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(); }
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); }
void FatalError(const char* string, const fmt::ArgList& formatList) { GlobalErrorHandler(ERR_FATAL, fmt::sprintf(string, formatList).c_str()); }
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()); }