mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-09-14 13:56:48 +08:00
chore: more cleanup and fixes
This commit is contained in:
parent
93139b7e21
commit
27f2b6d0cd
@ -14,7 +14,7 @@ CVirtualContainer::~CVirtualContainer() {
|
||||
}
|
||||
|
||||
void CVirtualContainer::add (const std::filesystem::path& filename, const uint8_t* contents, uint32_t length) {
|
||||
this->m_virtualFiles.insert (std::make_pair (filename, new CFileEntry (contents, length)));
|
||||
this->m_virtualFiles.insert (std::pair (filename, new CFileEntry (contents, length)));
|
||||
}
|
||||
|
||||
void CVirtualContainer::add (const std::filesystem::path& filename, const std::string& contents) {
|
||||
|
@ -259,13 +259,13 @@ CFBO* CWallpaper::createFBO (const std::string& name, ITexture::TextureFormat fo
|
||||
uint32_t textureHeight) {
|
||||
CFBO* fbo = new CFBO (name, format, flags, scale, realWidth, realHeight, textureWidth, textureHeight);
|
||||
|
||||
this->m_fbos.insert (std::make_pair (name, fbo));
|
||||
this->m_fbos.insert (std::pair (name, fbo));
|
||||
|
||||
return fbo;
|
||||
}
|
||||
|
||||
void CWallpaper::aliasFBO (const std::string& alias, CFBO* original) {
|
||||
this->m_fbos.insert (std::make_pair (alias, original));
|
||||
this->m_fbos.insert (std::pair (alias, original));
|
||||
}
|
||||
|
||||
const std::map<std::string, CFBO*>& CWallpaper::getFBOs () const {
|
||||
|
@ -334,7 +334,7 @@ void CShaderUnit::parseComboConfiguration (const std::string& content, int defau
|
||||
const auto entry = this->m_combos.find (combo->get<std::string> ());
|
||||
|
||||
// add the combo to the found list
|
||||
this->m_usedCombos.insert (std::make_pair (*combo, true));
|
||||
this->m_usedCombos.insert (std::pair (*combo, true));
|
||||
|
||||
// if the combo was not found in the predefined values this means that the default value in the JSON data can be
|
||||
// used so only define the ones that are not already defined
|
||||
@ -343,11 +343,11 @@ void CShaderUnit::parseComboConfiguration (const std::string& content, int defau
|
||||
// if no combo is defined just load the default settings
|
||||
if (defvalue == data.end ()) {
|
||||
// TODO: PROPERLY SUPPORT EMPTY COMBOS
|
||||
this->m_discoveredCombos.insert (std::make_pair (*combo, (int) defaultValue));
|
||||
this->m_discoveredCombos.insert (std::pair (*combo, (int) defaultValue));
|
||||
} else if (defvalue->is_number_float ()) {
|
||||
sLog.exception ("float combos are not supported in shader ", this->m_file, ". ", *combo);
|
||||
} else if (defvalue->is_number_integer ()) {
|
||||
this->m_discoveredCombos.insert (std::make_pair (*combo, defvalue->get<int> ()));
|
||||
this->m_discoveredCombos.insert (std::pair (*combo, defvalue->get<int> ()));
|
||||
} else if (defvalue->is_string ()) {
|
||||
sLog.exception ("string combos are not supported in shader ", this->m_file, ". ", *combo);
|
||||
} else {
|
||||
@ -475,11 +475,11 @@ void CShaderUnit::parseParameterConfiguration (
|
||||
|
||||
if (isRequired) {
|
||||
// add the new combo to the list
|
||||
this->m_discoveredCombos.insert (std::make_pair (*combo, comboValue));
|
||||
this->m_discoveredCombos.insert (std::pair (*combo, comboValue));
|
||||
|
||||
// textures linked to combos need to be tracked too
|
||||
if (this->m_usedCombos.find (*combo) == this->m_usedCombos.end ())
|
||||
this->m_usedCombos.insert (std::make_pair (*combo, true));
|
||||
this->m_usedCombos.insert (std::pair (*combo, true));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ Render::CObject* CScene::createObject (const Core::CObject* object) {
|
||||
}
|
||||
|
||||
if (renderObject != nullptr)
|
||||
this->m_objects.insert (std::make_pair (renderObject->getId (), renderObject));
|
||||
this->m_objects.insert (std::pair (renderObject->getId (), renderObject));
|
||||
|
||||
return renderObject;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user