From: Thomas Debesse Date: Sun, 28 Mar 2021 15:11:22 +0000 (+0200) Subject: doom3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c5dcaf535f05410b87aa4aa28447a1a98294d6c1;p=xonotic%2Fnetradiant.git doom3 --- diff --git a/plugins/entity/light.cpp b/plugins/entity/light.cpp index 9d8b9247..3d1c9348 100644 --- a/plugins/entity/light.cpp +++ b/plugins/entity/light.cpp @@ -1698,6 +1698,7 @@ scene::Instance* erase( scene::Instantiable::Observer* observer, const scene::Pa }; void Light_Construct( LightType lightType ){ +#if !defined( DISABLE_DOOM3_LIGHTING ) g_lightType = lightType; if ( g_lightType == LIGHTTYPE_DOOM3 ) { LightShader::m_defaultShader = "lights/defaultPointLight"; @@ -1707,10 +1708,13 @@ void Light_Construct( LightType lightType ){ } RenderLightRadiiFill::m_state = GlobalShaderCache().capture( "$Q3MAP2_LIGHT_SPHERE" ); RenderLightCenter::m_state = GlobalShaderCache().capture( "$BIGPOINT" ); +#endif // !DISABLE_DOOM3_LIGHTING } void Light_Destroy(){ +#if !defined( DISABLE_DOOM3_LIGHTING ) GlobalShaderCache().release( "$Q3MAP2_LIGHT_SPHERE" ); GlobalShaderCache().release( "$BIGPOINT" ); +#endif // !DISABLE_DOOM3_LIGHTING } scene::Node& New_Light( EntityClass* eclass ){ diff --git a/radiant/camwindow.cpp b/radiant/camwindow.cpp index 233262b5..90bad3b2 100644 --- a/radiant/camwindow.cpp +++ b/radiant/camwindow.cpp @@ -1742,9 +1742,11 @@ void CamWnd_constructToolbar( ui::Toolbar toolbar ){ void CamWnd_registerShortcuts(){ toggle_add_accelerator( "ToggleCubicClip" ); +#if !defined( DISABLE_DOOM3_LIGHTING ) if ( g_pGameDescription->mGameType == "doom3" ) { command_connect_accelerator( "TogglePreview" ); } +#endif // !DISABLE_DOOM3_LIGHTING command_connect_accelerator( "FOVInc" ); command_connect_accelerator( "FOVDec" ); @@ -1778,6 +1780,7 @@ void CamWnd_SetMode( camera_draw_mode mode ){ } } +#if !defined( DISABLE_DOOM3_LIGHTING ) void CamWnd_TogglePreview( void ){ // gametype must be doom3 for this function to work // if the gametype is not doom3 something is wrong with the @@ -1787,6 +1790,7 @@ void CamWnd_TogglePreview( void ){ // switch between textured and lighting mode CamWnd_SetMode( ( CamWnd_GetMode() == cd_lighting ) ? cd_texture : cd_lighting ); } +#endif // !DISABLE_DOOM3_LIGHTING CameraModel* g_camera_model = 0; @@ -1883,6 +1887,7 @@ void Camera_constructPreferences( PreferencesPage& page ){ make_property() ); +#if !defined( DISABLE_DOOM3_LIGHTING ) if ( g_pGameDescription->mGameType == "doom3" ) { const char* render_mode[] = { "Wireframe", "Flatshade", "Textured", "Lighting" }; @@ -1893,6 +1898,7 @@ void Camera_constructPreferences( PreferencesPage& page ){ ); } else +#endif // !DISABLE_DOOM3_LIGHTING { const char* render_mode[] = { "Wireframe", "Flatshade", "Textured" }; @@ -1981,9 +1987,11 @@ void CamWnd_Construct(){ GlobalCommands_insert( "LookThroughSelected", makeCallbackF(GlobalCamera_LookThroughSelected) ); GlobalCommands_insert( "LookThroughCamera", makeCallbackF(GlobalCamera_LookThroughCamera) ); +#if !defined( DISABLE_DOOM3_LIGHTING ) if ( g_pGameDescription->mGameType == "doom3" ) { GlobalCommands_insert( "TogglePreview", makeCallbackF(CamWnd_TogglePreview), Accelerator( GDK_KEY_F3 ) ); } +#endif // !DISABLE_DOOM3_LIGHTING GlobalCommands_insert( "FOVInc", makeCallbackF(FOV_increase), Accelerator( GDK_KEY_KP_Multiply, (GdkModifierType)GDK_SHIFT_MASK ) ); GlobalCommands_insert( "FOVDec", makeCallbackF(FOV_decrease), Accelerator( GDK_KEY_KP_Divide, (GdkModifierType)GDK_SHIFT_MASK ) ); diff --git a/radiant/renderstate.cpp b/radiant/renderstate.cpp index 6b30a19c..4999dcce 100644 --- a/radiant/renderstate.cpp +++ b/radiant/renderstate.cpp @@ -1577,6 +1577,7 @@ void ShaderCache_Construct(){ GlobalTexturesCache().attach( *g_ShaderCache ); GlobalShaderSystem().attach( *g_ShaderCache ); +#if !defined( DISABLE_DOOM3_LIGHTING ) if ( g_pGameDescription->mGameType == "doom3" ) { g_defaultPointLight = g_ShaderCache->capture( "lights/defaultPointLight" ); //Shader* overbright = @@ -1611,9 +1612,11 @@ void ShaderCache_Construct(){ } #endif } +#endif // !DISABLE_DOOM3_LIGHTING } void ShaderCache_Destroy(){ +#if !defined( DISABLE_DOOM3_LIGHTING ) if ( g_pGameDescription->mGameType == "doom3" ) { g_ShaderCache->release( "lights/defaultPointLight" ); g_ShaderCache->release( "$OVERBRIGHT" ); @@ -1629,6 +1632,7 @@ void ShaderCache_Destroy(){ } #endif } +#endif // !DISABLE_DOOM3_LIGHTING GlobalShaderSystem().detach( *g_ShaderCache ); GlobalTexturesCache().detach( *g_ShaderCache );