-void Brush_Construct(EBrushType type)
-{
- if(type == eBrushTypeQuake3)
- {
- g_showAlternativeTextureProjectionOption = true;
-
- GlobalPreferenceSystem().registerPreference(
- "AlternativeTextureProjection",
- BoolImportStringCaller(g_useAlternativeTextureProjection.m_latched),
- BoolExportStringCaller(g_useAlternativeTextureProjection.m_latched)
- );
- g_useAlternativeTextureProjection.useLatched();
-
- if(g_useAlternativeTextureProjection.m_value)
- {
- type = eBrushTypeQuake3BP;
- }
-
- // d1223m
- GlobalPreferenceSystem().registerPreference(
- "BrushAlwaysCaulk",
- BoolImportStringCaller(g_brush_always_caulk),
- BoolExportStringCaller(g_brush_always_caulk));
- }
-
- Brush_registerCommands();
- Brush_registerPreferencesPage();
-
- BrushFilters_construct();
-
- BrushClipPlane::constructStatic();
- BrushInstance::constructStatic();
- Brush::constructStatic(type);
-
- Brush::m_maxWorldCoord = g_MaxWorldCoord;
- BrushInstance::m_counter = &g_brushCount;
-
- g_texdef_default_scale = 0.5f;
- const char* value = g_pGameDescription->getKeyValue("default_scale");
- if(!string_empty(value))
- {
- float scale = static_cast<float>(atof(value));
- if(scale != 0)
- {
- g_texdef_default_scale = scale;
- }
- else
- {
- globalErrorStream() << "error parsing \"default_scale\" attribute\n";
- }
- }
-
- GlobalPreferenceSystem().registerPreference("TextureLock", BoolImportStringCaller(g_brush_texturelock_enabled), BoolExportStringCaller(g_brush_texturelock_enabled));
- GlobalPreferenceSystem().registerPreference("BrushSnapPlanes", makeBoolStringImportCallback(FaceImportSnapPlanesCaller()), makeBoolStringExportCallback(FaceExportSnapPlanesCaller()));
- GlobalPreferenceSystem().registerPreference("TexdefDefaultScale", FloatImportStringCaller(g_texdef_default_scale), FloatExportStringCaller(g_texdef_default_scale));
-
- GridStatus_getTextureLockEnabled = getTextureLockEnabled;
- g_texture_lock_status_changed = FreeCaller<GridStatus_onTextureLockEnabledChanged>();
-}
-
-void Brush_Destroy()
-{
- Brush::m_maxWorldCoord = 0;
- BrushInstance::m_counter = 0;
+void Brush_Construct( EBrushType type ){
+ if ( type == eBrushTypeQuake3 ) {
+ g_showAlternativeTextureProjectionOption = true;
+
+ const char *value = g_pGameDescription->getKeyValue( "brush_primit" );
+ if ( !string_empty( value ) ) {
+ g_useAlternativeTextureProjection.m_latched = atoi( value );
+ }
+
+ GlobalPreferenceSystem().registerPreference(
+ "AlternativeTextureProjection",
+ make_property_string( g_useAlternativeTextureProjection.m_latched )
+ );
+ g_useAlternativeTextureProjection.useLatched();
+
+ if ( g_useAlternativeTextureProjection.m_value ) {
+ type = eBrushTypeQuake3BP;
+ }
+
+ // d1223m
+ GlobalPreferenceSystem().registerPreference(
+ "BrushAlwaysCaulk",
+ make_property_string( g_brush_always_caulk )
+ );
+ }