Source changes needed for Linux build.

This commit is contained in:
bank 2012-09-23 14:18:12 +04:00 committed by bank
parent 109a766748
commit d2700f881c
16 changed files with 73 additions and 27 deletions

View file

@ -31,7 +31,7 @@
#include "gfx/gfxDevice.h"
#include "core/util/safeDelete.h"
#ifndef TORQUE_OS_MAC
#if !defined( TORQUE_OS_MAC ) && !defined( TORQUE_OS_LINUX )
# include "lighting/advanced/hlsl/gBufferConditionerHLSL.h"
# include "lighting/advanced/hlsl/advancedLightingFeaturesHLSL.h"
#else
@ -54,7 +54,7 @@ void AdvancedLightingFeatures::registerFeatures( const GFXFormat &prepassTargetF
if(GFX->getAdapterType() == OpenGL)
{
#ifdef TORQUE_OS_MAC
#if defined( TORQUE_OS_MAC ) || defined( TORQUE_OS_LINUX )
cond = new GBufferConditionerGLSL( prepassTargetFormat );
FEATUREMGR->registerFeature(MFT_PrePassConditioner, cond);
FEATUREMGR->registerFeature(MFT_RTLighting, new DeferredRTLightingFeatGLSL());
@ -66,7 +66,7 @@ void AdvancedLightingFeatures::registerFeatures( const GFXFormat &prepassTargetF
}
else
{
#ifndef TORQUE_OS_MAC
#if !defined( TORQUE_OS_MAC ) && !defined( TORQUE_OS_LINUX )
cond = new GBufferConditionerHLSL( prepassTargetFormat, GBufferConditionerHLSL::ViewSpace );
FEATUREMGR->registerFeature(MFT_PrePassConditioner, cond);
FEATUREMGR->registerFeature(MFT_RTLighting, new DeferredRTLightingFeatHLSL());

View file

@ -49,7 +49,7 @@
#include "lighting/common/projectedShadow.h"
#ifdef TORQUE_OS_MAC
#if defined( TORQUE_OS_MAC ) || defined( TORQUE_OS_LINUX )
#include "shaderGen/GLSL/shaderFeatureGLSL.h"
#include "shaderGen/GLSL/bumpGLSL.h"
#include "shaderGen/GLSL/pixSpecularGLSL.h"
@ -167,7 +167,7 @@ void BasicLightManager::activate( SceneManager *sceneManager )
if( GFX->getAdapterType() == OpenGL )
{
#ifdef TORQUE_OS_MAC
#if defined( TORQUE_OS_MAC ) || defined( TORQUE_OS_LINUX )
FEATUREMGR->registerFeature( MFT_LightMap, new LightmapFeatGLSL );
FEATUREMGR->registerFeature( MFT_ToneMap, new TonemapFeatGLSL );
FEATUREMGR->registerFeature( MFT_NormalMap, new BumpFeatGLSL );
@ -177,7 +177,7 @@ void BasicLightManager::activate( SceneManager *sceneManager )
}
else
{
#ifndef TORQUE_OS_MAC
#if !defined( TORQUE_OS_MAC ) && !defined( TORQUE_OS_LINUX )
FEATUREMGR->registerFeature( MFT_LightMap, new LightmapFeatHLSL );
FEATUREMGR->registerFeature( MFT_ToneMap, new TonemapFeatHLSL );
FEATUREMGR->registerFeature( MFT_NormalMap, new BumpFeatHLSL );

View file

@ -22,8 +22,17 @@
#include "lighting/common/lightMapParams.h"
#include "core/stream/bitStream.h"
#include "core/module.h"
const LightInfoExType LightMapParams::Type( "LightMapParams" );
MODULE_BEGIN( LightMapParams )
MODULE_INIT_AFTER( ShadowMapParams )
MODULE_INIT
{
LightMapParams::Type = "LightMapParams";
}
MODULE_END;
LightInfoExType LightMapParams::Type( "" );
LightMapParams::LightMapParams( LightInfo *light ) :
representedInLightmap(false),

View file

@ -34,7 +34,7 @@ public:
virtual ~LightMapParams();
/// The LightInfoEx hook type.
static const LightInfoExType Type;
static LightInfoExType Type;
// LightInfoEx
virtual void set( const LightInfoEx *ex );

View file

@ -314,7 +314,7 @@ void LightManager::_update4LightConsts( const SceneData &sgData,
// NOTE: We haven't ported the lighting shaders on OSX
// to the optimized HLSL versions.
#ifdef TORQUE_OS_MAC
#if defined( TORQUE_OS_MAC ) || defined( TORQUE_OS_LINUX )
static AlignedArray<Point3F> lightPositions( 4, sizeof( Point4F ) );
#else
static AlignedArray<Point4F> lightPositions( 3, sizeof( Point4F ) );
@ -342,7 +342,7 @@ void LightManager::_update4LightConsts( const SceneData &sgData,
if ( !light )
break;
#ifdef TORQUE_OS_MAC
#if defined( TORQUE_OS_MAC ) || defined( TORQUE_OS_LINUX )
lightPositions[i] = light->getPosition();
@ -381,7 +381,7 @@ void LightManager::_update4LightConsts( const SceneData &sgData,
shaderConsts->setSafe( lightDiffuseSC, lightColors );
shaderConsts->setSafe( lightInvRadiusSqSC, lightInvRadiusSq );
#ifndef TORQUE_OS_MAC
#if !defined( TORQUE_OS_MAC ) && !defined( TORQUE_OS_LINUX )
shaderConsts->setSafe( lightSpotDirSC, lightSpotDirs );
shaderConsts->setSafe( lightSpotAngleSC, lightSpotAngle );

View file

@ -34,7 +34,7 @@
#include "materials/baseMatInstance.h"
#include "scene/sceneManager.h"
#include "scene/sceneRenderState.h"
#include "scene/zones/SceneZoneSpace.h"
#include "scene/zones/sceneZoneSpace.h"
#include "lighting/lightManager.h"
#include "math/mathUtils.h"
#include "shaderGen/shaderGenVars.h"
@ -42,6 +42,7 @@
#include "core/stream/bitStream.h"
#include "math/mathIO.h"
#include "materials/shaderData.h"
#include "core/module.h"
// Used for creation in ShadowMapParams::getOrCreateShadowMap()
#include "lighting/shadowMap/singleLightShadowMap.h"
@ -545,8 +546,15 @@ void LightingShaderConstants::_onShaderReload()
init( mShader );
}
MODULE_BEGIN( ShadowMapParams )
MODULE_INIT_BEFORE( LightMapParams )
MODULE_INIT
{
ShadowMapParams::Type = "ShadowMapParams" ;
}
MODULE_END;
const LightInfoExType ShadowMapParams::Type( "ShadowMapParams" );
LightInfoExType ShadowMapParams::Type( "" );
ShadowMapParams::ShadowMapParams( LightInfo *light )
: mLight( light ),

View file

@ -287,7 +287,7 @@ public:
virtual ~ShadowMapParams();
/// The LightInfoEx hook type.
static const LightInfoExType Type;
static LightInfoExType Type;
// LightInfoEx
virtual void set( const LightInfoEx *ex );