Skip to content

Instantly share code, notes, and snippets.

@pvdk
pvdk / gist:1691838
Created January 28, 2012 00:44
Proposal for CMakeLists.txt in /apps/openmw
# Config file for version
configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/config.hpp.cmake" "${CMAKE_CURRENT_SOURCE_DIR}/config.hpp")
# Source files
file(GLOB_RECURSE OPENMW ${CMAKE_CURRENT_SOURCE_DIR} "[^.]*.[ch]pp" "[^.]*.[ch]")
# Make the variable accessible for other subdirectories
set(OPENMW ${OPENMW} PARENT_SCOPE)
# Create source groups
file(GLOB LOCAL ${CMAKE_CURRENT_SOURCE_DIR} "[^.]*.[ch]pp" "[^.]*.[ch]")
@pvdk
pvdk / gist:1801134
Created February 11, 2012 15:46
Quick fix for soundmanager.cpp
void SoundManager::MP3Lookup(boost::filesystem::path dir)
{
if (!boost::filesystem::exists(dir))
{
std::string lowercase = dir.string();
boost::to_lower(lowercase);
dir = boost::filesystem::path(lowercase);
std::cout << boost::generic_string(lowercase);
}
@pvdk
pvdk / gist:2170964
Created March 23, 2012 14:09
OpenMW Next: 0.14.0 backtrace
Adding /home/pvdk/.wine/drive_c/Program Files/Bethesda Softworks/Morrowind/Data Files/Morrowind.bsa
Data dir /home/pvdk/.wine/drive_c/Program Files/Bethesda Softworks/Morrowind/Data Files
Loading ESM /home/pvdk/.wine/drive_c/Program Files/Bethesda Softworks/Morrowind/Data Files/Morrowind.esm
player* Initialise: RenderManager
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff79a1de3 in Ogre::RenderTarget::getStatistics(float&, float&, float&, float&) const () from /usr/lib/libOgreMain.so.1.7.2
(gdb) bt
#0 0x00007ffff79a1de3 in Ogre::RenderTarget::getStatistics(float&, float&, float&, float&) const ()
from /usr/lib/libOgreMain.so.1.7.2
@pvdk
pvdk / datafilespage.cpp
Created June 20, 2012 13:32
QApplication exit problem
DataFilesPage::DataFilesPage(Files::ConfigurationManager &cfg, QWidget *parent)
: QWidget(parent)
, mCfgMgr(cfg)
{
mDataFilesModel = new QStandardItemModel(); // Contains all plugins with masters
mPluginsModel = new PluginsModel(); // Contains selectable plugins
[...]
createActions();
setupConfig();
setupDataFiles();
@pvdk
pvdk / gist:2995674
Created June 26, 2012 12:59
Replace method for AA options
int index = result.indexOf("FSAA 0");
if (index != -1)
result.replace(index, tr("Off"));
index = result.indexOf("MSAA 0");
if (index != -1)
result.replace(index, tr("Off"));
@pvdk
pvdk / gist:2995722
Created June 26, 2012 13:14
Resolution sorting
"1680 x 1050"
"1600 x 1200"
"1440 x 900"
"1400 x 1050"
"1280 x 1024"
"1280 x 960"
"1152 x 864"
"1024 x 768"
"832 x 624"
"800 x 600"
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
mRendererComboBox->setCurrentIndex(mRendererComboBox->findText("Direct3D9 Rendering Subsystem"));
#else
mRendererComboBox->setCurrentIndex(mRendererComboBox->findText("OpenGL Rendering Subsystem"));
#endif
}
// Create separate rendersystems
QString openGLName = mRendererComboBox->itemText(mRendererComboBox->findText(QString("OpenGL"), Qt::MatchStartsWith));
QString direct3DName = mRendererComboBox->itemText(mRendererComboBox->findText(QString("Direct3D"), Qt::MatchStartsWith));
@pvdk
pvdk / credits.txt
Created August 10, 2012 02:29
credits.txt improvements
Contributors
The OpenMW project was started in 2008 by Nicolay Korslund.
In the course of years many people have contributed to the project.
If you feel your name is missing from this list,
Feel free to modify it directly in our GitHub Repository,
or ask a developer to do it for you.
Programmers:
#include <iostream>
#include <QtDebug>
#include <QtGlobal>
#include "config.hpp"
/*
* Stellarium
* Copyright (C) 2008 Matthew Gates
*
#ifndef CONFIG_H
#define CONFIG_H
#include <QSettings>
class Config
{
public:
Config(const QString & cfgPath);
QString get(const QString & key);