本文整理汇总了C++中rMessage函数的典型用法代码示例。如果您正苦于以下问题:C++ rMessage函数的具体用法?C++ rMessage怎么用?C++ rMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: moveSelectedCmd
void moveSelectedCmd(const cmd::ArgumentList& args)
{
if (args.size() != 1)
{
rMessage() << "Usage: moveSelectionVertically [up|down]" << std::endl;
return;
}
UndoableCommand undo("moveSelectionVertically");
std::string arg = boost::algorithm::to_lower_copy(args[0].getString());
if (arg == "up")
{
moveSelectedAlongZ(GlobalGrid().getGridSize());
}
else if (arg == "down")
{
moveSelectedAlongZ(-GlobalGrid().getGridSize());
}
else
{
// Invalid argument
rMessage() << "Usage: moveSelectionVertically [up|down]" << std::endl;
return;
}
}
示例2: rMessage
void OpenGLModule::sharedContextCreated()
{
// report OpenGL information
rMessage() << "GL_VENDOR: "
<< reinterpret_cast<const char*>(glGetString(GL_VENDOR)) << std::endl;
rMessage() << "GL_RENDERER: "
<< reinterpret_cast<const char*>(glGetString(GL_RENDERER)) << std::endl;
rMessage() << "GL_VERSION: "
<< reinterpret_cast<const char*>(glGetString(GL_VERSION)) << std::endl;
rMessage() << "GL_EXTENSIONS: "
<< reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)) << std::endl;
GLenum err = glewInit();
if (err != GLEW_OK)
{
// glewInit failed
rError() << "GLEW error: " <<
reinterpret_cast<const char*>(glewGetErrorString(err));
}
GlobalRenderSystem().extensionsInitialised();
GlobalRenderSystem().realise();
_font.reset(new wxutil::GLFont(wxutil::GLFont::FONT_SANS, 12));
}
示例3: mergeSelectedBrushes
void mergeSelectedBrushes(const cmd::ArgumentList& args)
{
// Get the current selection
BrushPtrVector brushes = selection::algorithm::getSelectedBrushes();
if (brushes.empty()) {
rMessage() << _("CSG Merge: No brushes selected.") << std::endl;
wxutil::Messagebox::ShowError(_("CSG Merge: No brushes selected."));
return;
}
if (brushes.size() < 2) {
rMessage() << "CSG Merge: At least two brushes have to be selected.\n";
wxutil::Messagebox::ShowError("CSG Merge: At least two brushes have to be selected.");
return;
}
rMessage() << "CSG Merge: Merging " << brushes.size() << " brushes." << std::endl;
UndoableCommand undo("mergeSelectedBrushes");
// Take the last selected node as reference for layers and parent
scene::INodePtr merged = GlobalSelectionSystem().ultimateSelected();
scene::INodePtr parent = merged->getParent();
assert(parent != NULL);
// Create a new BrushNode
scene::INodePtr node = GlobalBrushCreator().createBrush();
// Insert the newly created brush into the (same) parent entity
parent->addChildNode(node);
// Move the new brush to the same layers as the merged one
node->assignToLayers(merged->getLayers());
// Get the contained brush
Brush* brush = Node_getBrush(node);
// Attempt to merge the selected brushes into the new one
if (!Brush_merge(*brush, brushes, true))
{
rWarning() << "CSG Merge: Failed - result would not be convex." << std::endl;
return;
}
ASSERT_MESSAGE(!brush->empty(), "brush left with no faces after merge");
// Remove the original brushes
for (BrushPtrVector::iterator i = brushes.begin(); i != brushes.end(); ++i)
{
scene::removeNodeFromParent(*i);
}
// Select the new brush
Node_setSelected(node, true);
rMessage() << "CSG Merge: Succeeded." << std::endl;
SceneChangeNotify();
}
示例4: redo
void redo() {
if (_redoStack.empty()) {
rMessage() << "Redo: no redo available" << std::endl;
}
else {
Operation* operation = _redoStack.back();
rMessage() << "Redo: " << operation->_command << std::endl;
startUndo();
trackersRedo();
operation->_snapshot.restore();
finishUndo(operation->_command);
_redoStack.pop_back();
for (Observers::iterator i = _observers.begin(); i != _observers.end(); /* in-loop */) {
Observer* observer = *(i++);
observer->postRedo();
}
// Trigger the onPostUndo event on all scene nodes
PostRedoWalker walker;
GlobalSceneGraph().root()->traverse(walker);
GlobalSceneGraph().sceneChanged();
}
}
示例5: fileExt
void Doom3FileSystem::initPakFile(ArchiveLoader& archiveModule, const std::string& filename)
{
std::string fileExt(os::getExtension(filename));
boost::to_lower(fileExt);
if (_allowedExtensions.find(fileExt) != _allowedExtensions.end())
{
// Matched extension for archive (e.g. "pk3", "pk4")
ArchiveDescriptor entry;
entry.name = filename;
entry.archive = archiveModule.openArchive(filename);
entry.is_pakfile = true;
_archives.push_back(entry);
rMessage() << "[vfs] pak file: " << filename << std::endl;
}
else if (_allowedExtensionsDir.find(fileExt) != _allowedExtensionsDir.end())
{
// Matched extension for archive dir (e.g. "pk3dir", "pk4dir")
ArchiveDescriptor entry;
std::string path = os::standardPathWithSlash(filename);
entry.name = path;
entry.archive = DirectoryArchivePtr(new DirectoryArchive(path));
entry.is_pakfile = false;
_archives.push_back(entry);
rMessage() << "[vfs] pak dir: " << path << std::endl;
}
}
示例6: nudgeSelectedCmd
void nudgeSelectedCmd(const cmd::ArgumentList& args)
{
if (args.size() != 1)
{
rMessage() << "Usage: nudgeSelected [up|down|left|right]" << std::endl;
return;
}
UndoableCommand undo("nudgeSelected");
std::string arg = boost::algorithm::to_lower_copy(args[0].getString());
if (arg == "up") {
nudgeSelected(eNudgeUp);
}
else if (arg == "down") {
nudgeSelected(eNudgeDown);
}
else if (arg == "left") {
nudgeSelected(eNudgeLeft);
}
else if (arg == "right") {
nudgeSelected(eNudgeRight);
}
else {
// Invalid argument
rMessage() << "Usage: nudgeSelected [up|down|left|right]" << std::endl;
return;
}
}
示例7: GlobalRegistry
void MouseEventManager::loadXYViewEventDefinitions() {
xml::NodeList xyviews = GlobalRegistry().findXPath("user/ui/input//xyview");
if (!xyviews.empty())
{
// Find all the xy view definitions
xml::NodeList eventList = xyviews[0].getNamedChildren("event");
if (!eventList.empty())
{
rMessage() << "MouseEventManager: XYView Definitions found: "
<< eventList.size() << std::endl;
for (std::size_t i = 0; i < eventList.size(); i++)
{
// Get the event name
const std::string eventName = eventList[i].getAttributeValue("name");
// Check if any recognised event names are found and construct the according condition.
if (eventName == "MoveView") {
_xyConditions[ui::xyMoveView] = getCondition(eventList[i]);
}
else if (eventName == "Select") {
_xyConditions[ui::xySelect] = getCondition(eventList[i]);
}
else if (eventName == "Zoom") {
_xyConditions[ui::xyZoom] = getCondition(eventList[i]);
}
else if (eventName == "CameraMove") {
_xyConditions[ui::xyCameraMove] = getCondition(eventList[i]);
}
else if (eventName == "CameraAngle") {
_xyConditions[ui::xyCameraAngle] = getCondition(eventList[i]);
}
else if (eventName == "NewBrushDrag") {
_xyConditions[ui::xyNewBrushDrag] = getCondition(eventList[i]);
}
else {
rMessage() << "MouseEventManager: Warning: Ignoring unkown event name: " << eventName << std::endl;
}
}
}
else {
// No event definitions found!
rMessage() << "MouseEventManager: Critical: No XYView event definitions found!\n";
}
}
else {
// No event definitions found!
rMessage() << "MouseEventManager: Critical: No XYView event definitions found!\n";
}
}
示例8: rMessage
void ProcFile::saveToFile(const std::string& path)
{
// write the file
rMessage() << "----- WriteOutputFile -----" << std::endl;
rMessage() << "writing " << path << std::endl;
std::ofstream str(path.c_str());
if (!str.good())
{
rMessage() << "error opening " << path << std::endl;
return;
}
str << FILE_ID << std::endl << std::endl;
// write the entity models and information, writing entities first
for (ProcEntities::reverse_iterator i = entities.rbegin(); i != entities.rend(); ++i)
{
ProcEntity& entity = **i;
if (entity.primitives.empty())
{
continue;
}
writeProcEntity(str, entity);
}
// write the shadow volumes
for (std::size_t i = 0 ; i < lights.size(); ++i)
{
ProcLight& light = lights[i];
if (light.shadowTris.vertices.empty())
{
continue;
}
str << (boost::format("shadowModel { /* name = */ \"_prelight_%s\"") % light.name) << std::endl << std::endl;
writeShadowTriangles(str, light.shadowTris);
str << "}" << std::endl << std::endl;
}
str.flush();
str.close();
}
示例9: rMessage
void Doom3FileSystem::initialise()
{
rMessage() << "filesystem initialised" << std::endl;
std::string extensions = GlobalGameManager().currentGame()->getKeyValue("archivetypes");
boost::algorithm::split(_allowedExtensions, extensions, boost::algorithm::is_any_of(" "));
// Build list of dir extensions, e.g. pk4 -> pk4dir
for (std::set<std::string>::const_iterator i = _allowedExtensions.begin();
i != _allowedExtensions.end();
++i)
{
std::string extDir = *i + "dir";
_allowedExtensionsDir.insert(extDir);
}
// Get the VFS search paths from the game manager
const game::IGameManager::PathList& paths =
GlobalGameManager().getVFSSearchPaths();
// Initialise the paths, in the given order
for (game::IGameManager::PathList::const_iterator i = paths.begin();
i != paths.end(); i++)
{
initDirectory(*i);
}
for (ObserverList::iterator i = _observers.begin(); i != _observers.end(); ++i)
{
(*i)->onFileSystemInitialise();
}
}
示例10: initialiseModule
virtual void initialiseModule(const ApplicationContext& ctx)
{
rMessage() << getName() << "::initialiseModule called." << std::endl;
// Associated "def_head" with an empty property editor instance
GlobalEntityInspector().registerPropertyEditor(
ui::DEF_HEAD_KEY, ui::IPropertyEditorPtr(new ui::AIHeadPropertyEditor())
);
GlobalEntityInspector().registerPropertyEditor(
ui::DEF_VOCAL_SET_KEY, ui::IPropertyEditorPtr(new ui::AIVocalSetPropertyEditor())
);
GlobalCommandSystem().addCommand("FixupMapDialog", ui::FixupMapDialog::RunDialog);
GlobalEventManager().addCommand("FixupMapDialog", "FixupMapDialog");
GlobalUIManager().getMenuManager().add("main/map",
"FixupMapDialog", ui::menuItem,
_("Fixup Map..."), // caption
"", // icon
"FixupMapDialog"
);
GlobalRadiant().signal_radiantStarted().connect(
sigc::ptr_fun(ui::AIEditingPanel::onRadiantStartup)
);
}
示例11: loadLanguageSetting
void LanguageManager::initFromContext(const ApplicationContext& ctx)
{
// Initialise these members
_languageSettingFile = ctx.getSettingsPath() + LANGUAGE_SETTING_FILE;
_curLanguage = loadLanguageSetting();
rMessage() << "Current language setting: " << _curLanguage << std::endl;
// No handling of POSIX needed, since we don't use the LanguageManager on
// POSIX
_i18nPath = os::standardPathWithSlash(
ctx.getApplicationPath() + "i18n"
);
// Set the LANG environment. As GLIB/GTK+ (in Win32) is using its own C
// runtime, we need to call their GLIB setenv function for the environment
// variable to take effect.
g_setenv("LANG", _curLanguage.c_str(), TRUE);
// Tell glib to load stuff from the given i18n path
bindtextdomain(GETTEXT_PACKAGE, _i18nPath.c_str());
// set encoding to utf-8 to prevent errors for Windows
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
}
示例12: GlobalFileSystem
GlyphSetPtr GlyphSet::createFromDatFile(const std::string& vfsPath,
const std::string& fontname,
const std::string& language,
Resolution resolution)
{
ArchiveFilePtr file = GlobalFileSystem().openFile(vfsPath);
// Check file size
if (file->size() != sizeof(q3font::Q3FontInfo))
{
rWarning() << "FontLoader: invalid file size of file "
<< vfsPath << ", expected " << sizeof(q3font::Q3FontInfo)
<< ", found " << file->size() << std::endl;
return GlyphSetPtr();
}
// Allocate a buffer with the Quake3 info structure
q3font::Q3FontInfoPtr buf(new q3font::Q3FontInfo);
InputStream& stream = file->getInputStream();
stream.read(
reinterpret_cast<StreamBase::byte_type*>(buf.get()),
sizeof(q3font::Q3FontInfo)
);
// Construct a glyph set using the loaded info
GlyphSetPtr glyphSet(new GlyphSet(*buf, fontname, language, resolution));
rMessage() << "FontLoader: " << vfsPath << " loaded successfully." << std::endl;
return glyphSet;
}
示例13: rMessage
void UIManager::initialiseModule(const ApplicationContext& ctx)
{
rMessage() << "UIManager::initialiseModule called" << std::endl;
_dialogManager = DialogManagerPtr(new DialogManager);
_menuManager.loadFromRegistry();
_toolbarManager.initialise();
ColourSchemeManager::Instance().loadColourSchemes();
GlobalCommandSystem().addCommand("EditColourScheme", ColourSchemeEditor::editColourSchemes);
GlobalEventManager().addCommand("EditColourScheme", "EditColourScheme");
GlobalRadiant().signal_radiantShutdown().connect(
sigc::mem_fun(this, &UIManager::clear)
);
// Add the statusbar command text item
_statusBarManager.addTextElement(
STATUSBAR_COMMAND,
"", // no icon
IStatusBarManager::POS_COMMAND
);
addLocalBitmapsAsIconFactory();
}
示例14: PicoPrintFunc
void PicoPrintFunc( int level, const char *str )
{
if( str == 0 )
return;
switch( level )
{
case PICO_NORMAL:
rMessage() << str << "\n";
break;
case PICO_VERBOSE:
//rMessage() << "PICO_VERBOSE: " << str << "\n";
break;
case PICO_WARNING:
rError() << "PICO_WARNING: " << str << "\n";
break;
case PICO_ERROR:
rError() << "PICO_ERROR: " << str << "\n";
break;
case PICO_FATAL:
rError() << "PICO_FATAL: " << str << "\n";
break;
}
}
示例15: getexename
/// brief Returns the filename of the executable belonging to the current process, or 0 if not found.
char* getexename(char *buf, char* argv[]) {
/* Now read the symbolic link */
int ret = readlink(LINK_NAME, buf, PATH_MAX);
if (ret == -1) {
rMessage() << "getexename: falling back to argv[0]: '" << argv[0] << "'";
const char* path = realpath(argv[0], buf);
if (path == NULL) {
/* In case of an error, leave the handling up to the caller */
return "";
}
}
/* Ensure proper NUL termination */
buf[ret] = 0;
/* delete the program name */
*(strrchr(buf, '/')) = '\0';
// NOTE: we build app path with a trailing '/'
// it's a general convention in Radiant to have the slash at the end of directories
if (buf[strlen(buf)-1] != '/') {
strcat(buf, "/");
}
return buf;
}