Bundle an empty font file and pass it to projectM so it doesn't crash when FTGL is turned on.
This commit is contained in:
parent
11e18bb22f
commit
1a5f865d53
Binary file not shown.
|
@ -250,5 +250,6 @@
|
||||||
<file>icons/32x32/go-down.png</file>
|
<file>icons/32x32/go-down.png</file>
|
||||||
<file>icons/48x48/go-down.png</file>
|
<file>icons/48x48/go-down.png</file>
|
||||||
<file>hypnotoad.gif</file>
|
<file>hypnotoad.gif</file>
|
||||||
|
<file>blank.ttf</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include <QPaintEngine>
|
#include <QPaintEngine>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
#include <QTemporaryFile>
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
#include <QTimerEvent>
|
#include <QTimerEvent>
|
||||||
|
|
||||||
|
@ -92,6 +93,12 @@ void ProjectMVisualisation::InitProjectM() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Write an empty font out to a temporary directory. libprojectM dies if it's
|
||||||
|
// compiled with FTGL support and you pass it an empty font URL, so we have
|
||||||
|
// to give it a dummy font even though we won't use it.
|
||||||
|
temporary_font_.reset(QTemporaryFile::createLocalFile(":blank.ttf"));
|
||||||
|
const QString font_path = temporary_font_->fileName();
|
||||||
|
|
||||||
// Create projectM settings
|
// Create projectM settings
|
||||||
projectM::Settings s;
|
projectM::Settings s;
|
||||||
s.meshX = 32;
|
s.meshX = 32;
|
||||||
|
@ -106,12 +113,14 @@ void ProjectMVisualisation::InitProjectM() {
|
||||||
s.shuffleEnabled = true;
|
s.shuffleEnabled = true;
|
||||||
s.easterEgg = 0; // ??
|
s.easterEgg = 0; // ??
|
||||||
s.softCutRatingsEnabled = false;
|
s.softCutRatingsEnabled = false;
|
||||||
|
s.menuFontURL = font_path.toStdString();
|
||||||
|
s.titleFontURL = font_path.toStdString();
|
||||||
|
|
||||||
projectm_.reset(new projectM(s));
|
projectm_.reset(new projectM(s));
|
||||||
preset_model_ = new ProjectMPresetModel(this, this);
|
preset_model_ = new ProjectMPresetModel(this, this);
|
||||||
Load();
|
Load();
|
||||||
|
|
||||||
if (preset_path.isNull()) {
|
if (font_path.isNull()) {
|
||||||
qWarning("ProjectM presets could not be found, search path was:\n %s",
|
qWarning("ProjectM presets could not be found, search path was:\n %s",
|
||||||
paths.join("\n ").toLocal8Bit().constData());
|
paths.join("\n ").toLocal8Bit().constData());
|
||||||
QMessageBox::warning(NULL, tr("Missing projectM presets"),
|
QMessageBox::warning(NULL, tr("Missing projectM presets"),
|
||||||
|
|
|
@ -29,6 +29,8 @@ class projectM;
|
||||||
|
|
||||||
class ProjectMPresetModel;
|
class ProjectMPresetModel;
|
||||||
|
|
||||||
|
class QTemporaryFile;
|
||||||
|
|
||||||
class ProjectMVisualisation : public QGraphicsScene, public BufferConsumer {
|
class ProjectMVisualisation : public QGraphicsScene, public BufferConsumer {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
@ -79,6 +81,8 @@ private:
|
||||||
Mode mode_;
|
Mode mode_;
|
||||||
int duration_;
|
int duration_;
|
||||||
|
|
||||||
|
boost::scoped_ptr<QTemporaryFile> temporary_font_;
|
||||||
|
|
||||||
std::vector<int> default_rating_list_;
|
std::vector<int> default_rating_list_;
|
||||||
|
|
||||||
int texture_size_;
|
int texture_size_;
|
||||||
|
|
Loading…
Reference in New Issue