mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-24 15:03:47 +00:00
[data] Refactor resources folder
Signed-off-by: Andrei Shkrob <github@shkrob.dev>
This commit is contained in:
committed by
Konstantin Pastbin
parent
04246a55f2
commit
8f5c8a5bd7
@@ -7,8 +7,8 @@
|
||||
|
||||
namespace
|
||||
{
|
||||
std::string const kSuffixDark = "_dark";
|
||||
std::string const kSuffixLight = "_light";
|
||||
std::string const kSuffixDark = "dark";
|
||||
std::string const kSuffixLight = "light";
|
||||
std::string const kSuffixDefaultDark = "_default_dark";
|
||||
std::string const kSuffixDefaultLight = "_default_light";
|
||||
std::string const kSuffixVehicleDark = "_vehicle_dark";
|
||||
@@ -42,7 +42,7 @@ std::string GetStyleRulesSuffix(MapStyle mapStyle)
|
||||
case MapStyleOutdoorsDark:
|
||||
return kSuffixOutdoorsDark;
|
||||
case MapStyleMerged:
|
||||
return std::string();
|
||||
return {};
|
||||
|
||||
case MapStyleCount:
|
||||
break;
|
||||
@@ -70,7 +70,7 @@ std::string GetStyleResourcesSuffix(MapStyle mapStyle)
|
||||
case MapStyleOutdoorsLight:
|
||||
return kSuffixLight;
|
||||
case MapStyleMerged:
|
||||
return std::string();
|
||||
return {};
|
||||
|
||||
case MapStyleCount:
|
||||
break;
|
||||
@@ -122,9 +122,7 @@ ReaderPtr<Reader> StyleReader::GetDrawingRulesReader() const
|
||||
ReaderPtr<Reader> StyleReader::GetResourceReader(std::string const & file,
|
||||
std::string_view density) const
|
||||
{
|
||||
std::string const resourceDir =
|
||||
std::string("resources-").append(density) + GetStyleResourcesSuffix(GetCurrentStyle());
|
||||
std::string resFile = base::JoinPath(resourceDir, file);
|
||||
std::string resFile = base::JoinPath("symbols", std::string{density}, GetStyleResourcesSuffix(GetCurrentStyle()), file);
|
||||
|
||||
auto overriddenResFile = base::JoinPath(GetPlatform().WritableDir(), kStylesOverrideDir, resFile);
|
||||
if (GetPlatform().IsFileExistsByFullPath(overriddenResFile))
|
||||
@@ -140,7 +138,7 @@ ReaderPtr<Reader> StyleReader::GetResourceReader(std::string const & file,
|
||||
|
||||
ReaderPtr<Reader> StyleReader::GetDefaultResourceReader(std::string const & file) const
|
||||
{
|
||||
return GetPlatform().GetReader(base::JoinPath("resources-default", file));
|
||||
return GetPlatform().GetReader(base::JoinPath("symbols/default", file));
|
||||
}
|
||||
|
||||
StyleReader & GetStyleReader()
|
||||
|
||||
Reference in New Issue
Block a user