chore: more cleanup and fixes

This commit is contained in:
Almamu 2025-04-25 21:47:32 +02:00
parent 93139b7e21
commit 27f2b6d0cd
4 changed files with 9 additions and 9 deletions

View File

@ -14,7 +14,7 @@ CVirtualContainer::~CVirtualContainer() {
} }
void CVirtualContainer::add (const std::filesystem::path& filename, const uint8_t* contents, uint32_t length) { 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) { void CVirtualContainer::add (const std::filesystem::path& filename, const std::string& contents) {

View File

@ -259,13 +259,13 @@ CFBO* CWallpaper::createFBO (const std::string& name, ITexture::TextureFormat fo
uint32_t textureHeight) { uint32_t textureHeight) {
CFBO* fbo = new CFBO (name, format, flags, scale, realWidth, realHeight, textureWidth, 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; return fbo;
} }
void CWallpaper::aliasFBO (const std::string& alias, CFBO* original) { 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 { const std::map<std::string, CFBO*>& CWallpaper::getFBOs () const {

View File

@ -334,7 +334,7 @@ void CShaderUnit::parseComboConfiguration (const std::string& content, int defau
const auto entry = this->m_combos.find (combo->get<std::string> ()); const auto entry = this->m_combos.find (combo->get<std::string> ());
// add the combo to the found list // 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 // 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 // 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 no combo is defined just load the default settings
if (defvalue == data.end ()) { if (defvalue == data.end ()) {
// TODO: PROPERLY SUPPORT EMPTY COMBOS // 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 ()) { } else if (defvalue->is_number_float ()) {
sLog.exception ("float combos are not supported in shader ", this->m_file, ". ", *combo); sLog.exception ("float combos are not supported in shader ", this->m_file, ". ", *combo);
} else if (defvalue->is_number_integer ()) { } 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 ()) { } else if (defvalue->is_string ()) {
sLog.exception ("string combos are not supported in shader ", this->m_file, ". ", *combo); sLog.exception ("string combos are not supported in shader ", this->m_file, ". ", *combo);
} else { } else {
@ -475,11 +475,11 @@ void CShaderUnit::parseParameterConfiguration (
if (isRequired) { if (isRequired) {
// add the new combo to the list // 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 // textures linked to combos need to be tracked too
if (this->m_usedCombos.find (*combo) == this->m_usedCombos.end ()) 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));
} }
} }

View File

@ -194,7 +194,7 @@ Render::CObject* CScene::createObject (const Core::CObject* object) {
} }
if (renderObject != nullptr) if (renderObject != nullptr)
this->m_objects.insert (std::make_pair (renderObject->getId (), renderObject)); this->m_objects.insert (std::pair (renderObject->getId (), renderObject));
return renderObject; return renderObject;
} }