]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
doom3
authorThomas Debesse <dev@illwieckz.net>
Sun, 28 Mar 2021 15:11:22 +0000 (17:11 +0200)
committerThomas Debesse <dev@illwieckz.net>
Wed, 29 Sep 2021 21:26:13 +0000 (23:26 +0200)
plugins/entity/light.cpp
radiant/camwindow.cpp
radiant/renderstate.cpp

index 9d8b92472c5f3165f546dc4c62beb109da1246e7..3d1c9348b14d1d051da48411ac7043fb8a97b5fa 100644 (file)
@@ -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 ){
index 233262b5a6e5ade6370e07015159a5ef872ed02d..90bad3b21392ac089225f9f5150904f6be017ee5 100644 (file)
@@ -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<Camera_FarClip>()
                );
 
+#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 ) );
index 6b30a19c4d7fced23411a2e7df0570a195dce965..4999dcce9d8c27e1b9b302a5d82ab557bbef876e 100644 (file)
@@ -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 );