Save 470KB by not re-initializing lineTypeNames over a thousand cpp files it leaks into

I saved a bunch of money on my car insurance by switching to Extern
This commit is contained in:
Marek Roszko 2023-09-19 20:03:34 -04:00
parent 7d12e1c4f5
commit 9deff07ca6
2 changed files with 10 additions and 8 deletions

View File

@ -32,6 +32,15 @@
using namespace STROKEPARAMS_T;
const std::map<PLOT_DASH_TYPE, struct lineTypeStruct> lineTypeNames = {
{ PLOT_DASH_TYPE::SOLID, { _( "Solid" ), BITMAPS::stroke_solid } },
{ PLOT_DASH_TYPE::DASH, { _( "Dashed" ), BITMAPS::stroke_dash } },
{ PLOT_DASH_TYPE::DOT, { _( "Dotted" ), BITMAPS::stroke_dot } },
{ PLOT_DASH_TYPE::DASHDOT, { _( "Dash-Dot" ), BITMAPS::stroke_dashdot } },
{ PLOT_DASH_TYPE::DASHDOTDOT, { _( "Dash-Dot-Dot" ), BITMAPS::stroke_dashdotdot } }
};
void STROKE_PARAMS::Stroke( const SHAPE* aShape, PLOT_DASH_TYPE aLineStyle, int aWidth,
const KIGFX::RENDER_SETTINGS* aRenderSettings,
std::function<void( const VECTOR2I& a, const VECTOR2I& b )> aStroker )

View File

@ -67,14 +67,7 @@ struct lineTypeStruct
/*
* Conversion map between PLOT_DASH_TYPE values and style names displayed
*/
const std::map<PLOT_DASH_TYPE, struct lineTypeStruct> lineTypeNames =
{
{ PLOT_DASH_TYPE::SOLID, { _( "Solid" ), BITMAPS::stroke_solid } },
{ PLOT_DASH_TYPE::DASH, { _( "Dashed" ), BITMAPS::stroke_dash } },
{ PLOT_DASH_TYPE::DOT, { _( "Dotted" ), BITMAPS::stroke_dot } },
{ PLOT_DASH_TYPE::DASHDOT, { _( "Dash-Dot" ), BITMAPS::stroke_dashdot } },
{ PLOT_DASH_TYPE::DASHDOTDOT, { _( "Dash-Dot-Dot" ), BITMAPS::stroke_dashdotdot } }
};
extern const std::map<PLOT_DASH_TYPE, struct lineTypeStruct> lineTypeNames;
#define DEFAULT_STYLE _( "Default" )