Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions engine/includes/editor/assetconverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class ENGINE_EXPORT AssetConverterSettings : public Object {
AssetConverterSettings();
~AssetConverterSettings();

AssetConverter *converter();
void setConverter(AssetConverter *converter);

uint32_t type() const;

virtual StringList typeNames() const;
Expand Down Expand Up @@ -139,6 +142,8 @@ class ENGINE_EXPORT AssetConverterSettings : public Object {

static std::map<TString, TString> m_defaultIcons;

AssetConverter *m_converter;

};

#endif // ASSETCONVERTER_H
15 changes: 14 additions & 1 deletion engine/src/editor/assetconverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,25 @@ AssetConverterSettings::AssetConverterSettings() :
m_modified(false),
m_dir(false),
m_version(0),
m_currentVersion(0) {
m_currentVersion(0),
m_converter(nullptr) {

}

AssetConverterSettings::~AssetConverterSettings() {

}
/*!
Returns assotiated AssetConverter.
*/
AssetConverter *AssetConverterSettings::converter() {
return m_converter;
}
/*!
Sets assotiated asset \a converter.
*/
void AssetConverterSettings::setConverter(AssetConverter *converter) {
m_converter = converter;
}
/*!
Returns the asset type for conversion for more details see MetaType.
Expand Down
16 changes: 8 additions & 8 deletions engine/src/editor/assetmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,12 @@ AssetConverterSettings *AssetManager::fetchSettings(const TString &source) {
AssetConverterSettings *settings = nullptr;

if(!path.isEmpty() && File::exists(source)) {
TString suffix(Url(source).completeSuffix().toLower());
auto it = m_converters.find(suffix);

if(it != m_converters.end()) {
settings = it->second->createSettings();
AssetConverter *converter = getConverter(source);
if(converter) {
settings = converter->createSettings();
settings->setConverter(converter);
} else {
TString suffix(Url(source).suffix().toLower());
CodeBuilder *currentBuilder = m_projectManager->currentBuilder();
CodeBuilder *builder = nullptr;
for(auto it : m_builders) {
Expand Down Expand Up @@ -424,7 +424,7 @@ Actor *AssetManager::createActor(const TString &source) {
if(!source.isEmpty()) {
TString uuid;
TString path = source;
if(source.at(0) == '{') {
if(source.front() == '{') {
uuid = source;
path = uuidToPath(uuid);
} else {
Expand All @@ -433,7 +433,7 @@ Actor *AssetManager::createActor(const TString &source) {

AssetConverterSettings *settings = fetchSettings(path);
if(settings) {
AssetConverter *converter = getConverter(path);
AssetConverter *converter = settings->converter();
if(converter) {
return converter->createActor(settings, uuid);
}
Expand Down Expand Up @@ -534,7 +534,7 @@ void AssetManager::onPerform() {
}

AssetConverter *AssetManager::getConverter(const TString &source) {
auto it = m_converters.find(Url(source).suffix().toLower());
auto it = m_converters.find(Url(source).completeSuffix().toLower());
if(it != m_converters.end()) {
return it->second;
}
Expand Down
1 change: 1 addition & 0 deletions modules/editor/particletools/converter/effectbuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ float EffectBuilderSettings::thumbnailWarmup() const {
void EffectBuilderSettings::setThumbnailWarmup(float value) {
if(m_thumbnailWarmup != value) {
m_thumbnailWarmup = value;
setModified();
}
}

Expand Down
2 changes: 1 addition & 1 deletion modules/editor/particletools/editor/particleedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ParticleProxy : public Object {
ParticleEdit::ParticleEdit() :
ui(new Ui::ParticleEdit),
m_builder(new EffectBuilder),
m_controller(new CameraController()),
m_controller(new CameraController),
m_light(nullptr),
m_effect(nullptr),
m_render(nullptr),
Expand Down
2 changes: 1 addition & 1 deletion modules/editor/shadertools/editor/materialedit.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>1024</width>
<height>800</height>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
Expand Down
12 changes: 8 additions & 4 deletions worldeditor/src/managers/assetimporter/iconrender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,19 @@ const QImage IconRender::render(const TString &uuid) {

m_render->update(m_world);

QImage result;

if(m_color) {
ByteArray data(m_color->getPixels(0));
QImage result(data.data(), m_color->width(), m_color->height(), QImage::Format_RGBA8888);
result = QImage(data.data(), m_color->width(), m_color->height(), QImage::Format_RGBA8888);

result = result.mirrored();
}

if(object) {
object->setParent(nullptr);
delete object;

return result.mirrored();
}

return QImage();
return result;
}
Loading