Remove hacks for GlueTheGiant, will need to be handled differently
This commit is contained in:
parent
8ed1859f92
commit
65244f1979
2 changed files with 26 additions and 20 deletions
|
@ -56,22 +56,6 @@ std::string system(std::string filename) {
|
|||
// get plugin resource
|
||||
std::string plugin(plugin::Plugin* plugin, std::string filename) {
|
||||
DISTRHO_SAFE_ASSERT_RETURN(plugin != nullptr, {});
|
||||
// always use dark scheme
|
||||
if (plugin->slug == "GlueTheGiant")
|
||||
{
|
||||
if (filename == "res/BusDepot.svg"
|
||||
|| filename == "res/BusRoute.svg"
|
||||
|| filename == "res/EnterBus.svg"
|
||||
|| filename == "res/ExitBus.svg"
|
||||
|| filename == "res/GigBus.svg"
|
||||
|| filename == "res/MetroCityBus.svg"
|
||||
|| filename == "res/MiniBus.svg"
|
||||
|| filename == "res/Road.svg"
|
||||
|| filename == "res/SchoolBus.svg")
|
||||
{
|
||||
filename = filename.substr(0, filename.size()-4) + "_Night.svg";
|
||||
}
|
||||
}
|
||||
return system::join(plugin->path, filename);
|
||||
}
|
||||
|
||||
|
|
|
@ -762,10 +762,7 @@ bool invertPaintForLightMode(NSVGshape* const shape, NSVGpaint& paint)
|
|||
paint.gradient->stops[i].color = invertColor(paint.gradient->stops[i].color);
|
||||
return true;
|
||||
case NSVG_PAINT_COLOR:
|
||||
paint.color = (paint.color & 0xff000000)
|
||||
| (0xff0000 - (paint.color & 0xff0000))
|
||||
| (0xff00 - (paint.color & 0xff00))
|
||||
| (0xff - (paint.color & 0xff));
|
||||
paint.color = invertColor(paint.color);
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
@ -893,6 +890,31 @@ NSVGimage* nsvgParseFromFileCardinal(const char* const filename, const char* con
|
|||
goto postparse;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Special case for GlueTheGiant
|
||||
if (std::strstr(filename, "/GlueTheGiant/res/") != nullptr)
|
||||
{
|
||||
printf("special hack for glue\n");
|
||||
if (std::strncmp(filename + (filenamelen - 13), "/BusDepot.svg", 13) == 0 ||
|
||||
std::strncmp(filename + (filenamelen - 13), "/BusRoute.svg", 13) == 0 ||
|
||||
std::strncmp(filename + (filenamelen - 13), "/EnterBus.svg", 13) == 0 ||
|
||||
std::strncmp(filename + (filenamelen - 12), "/ExitBus.svg", 12) == 0 ||
|
||||
std::strncmp(filename + (filenamelen - 11), "/GigBus.svg", 11) == 0 ||
|
||||
std::strncmp(filename + (filenamelen - 17), "/MetroCityBus.svg", 17) == 0 ||
|
||||
std::strncmp(filename + (filenamelen - 12), "/MiniBus.svg", 12) == 0 ||
|
||||
std::strncmp(filename + (filenamelen - 9), "/Road.svg", 9) == 0 ||
|
||||
std::strncmp(filename + (filenamelen - 14), "/SchoolBus.svg", 14) == 0)
|
||||
{
|
||||
const std::string nightfilename = std::string(filename).substr(0, filenamelen-4) + "_Night.svg";
|
||||
hasDarkMode = true;
|
||||
shapesOrig = shapesMOD = nullptr;
|
||||
handleMOD = nsvgParseFromFile(nightfilename.c_str(), units, dpi);
|
||||
printf("special hack for glue: %s -> %s\n", filename, nightfilename.c_str());
|
||||
goto postparse;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
for (size_t i = 0; i < sizeof(svgFilesToInvertForDarkMode)/sizeof(svgFilesToInvertForDarkMode[0]); ++i)
|
||||
{
|
||||
const char* const svgFileToInvert = svgFilesToInvertForDarkMode[i].filename;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue