Skip to content

Commit

Permalink
Merge pull request #578 from lasalvavida/effect-images
Browse files Browse the repository at this point in the history
Load images declared in profile_COMMON
  • Loading branch information
RemiArnaud authored Jul 19, 2018
2 parents d826fd0 + f9dc40b commit 619d942
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
This file is part of COLLADASaxFrameworkLoader.
Licensed under the MIT Open Source License,
Licensed under the MIT Open Source License,
for details please see LICENSE file or the website
http://www.opensource.org/licenses/mit-license.php
*/

#ifndef __COLLADASAXFWL_LIBRARYEFFECTSSLOADER_H__
#define __COLLADASAXFWL_LIBRARYEFFECTSSLOADER_H__

#include "COLLADASaxFWLPrerequisites.h"
#include "COLLADASaxFWLFilePartLoader.h"
#include "COLLADASaxFWLXmlTypes.h"
#include "COLLADASaxFWLLibraryImagesLoader.h"

#include "COLLADAFWEffectCommon.h"
#include "COLLADAFWTypes.h"
Expand All @@ -32,7 +30,7 @@ namespace COLLADASaxFWL
{

/** TODO Documentation */
class LibraryEffectsLoader : public FilePartLoader
class LibraryEffectsLoader : public LibraryImagesLoader
{
public:
enum ShaderParameterTypes
Expand Down Expand Up @@ -218,7 +216,7 @@ namespace COLLADASaxFWL
/** Store the sid of the new param.*/
virtual bool begin__newparam____cg_newparam( const newparam____cg_newparam__AttributeData& attributeData );

/** Set the current profile to PROFILE_COMMON. Create and append common effect to current
/** Set the current profile to PROFILE_COMMON. Create and append common effect to current
effect.*/
virtual bool begin__profile_COMMON( const profile_COMMON__AttributeData& attributeData );

Expand Down Expand Up @@ -258,7 +256,7 @@ namespace COLLADASaxFWL
virtual bool begin__minfilter(){return true;}
virtual bool end__minfilter(){return true;}
virtual bool data__minfilter( const ENUM__fx_sampler_filter_common value );

/** We don't need to do anything here.*/
virtual bool begin__source____NCName(){return true;}

Expand Down Expand Up @@ -289,7 +287,7 @@ namespace COLLADASaxFWL
/** Resolve all the samplers and copy them to the current effect.*/
virtual bool begin__profile_COMMON__technique( const profile_COMMON__technique__AttributeData& attributeData );

/** Iterate over the list of used samplers in the current effect profile and push them
/** Iterate over the list of used samplers in the current effect profile and push them
in the sampler array. */
bool fillSamplerArray();

Expand Down Expand Up @@ -377,7 +375,7 @@ namespace COLLADASaxFWL

private:
/** Set the shader type of the current profile.*/
bool setCommonEffectShaderType( COLLADAFW::EffectCommon::ShaderType shaderType);
bool setCommonEffectShaderType( COLLADAFW::EffectCommon::ShaderType shaderType);

/** Stores color data into the correct color object.*/
bool handleColorData( const float* value, size_t length );
Expand All @@ -391,7 +389,7 @@ namespace COLLADASaxFWL
bool handleExtraEffectTextures( const COLLADAFW::PointerArray<COLLADAFW::TextureAttributes>& effectTextures );

/**
* Luminance is the function, based on the ISO/CIE color standards (see ITU-R
* Luminance is the function, based on the ISO/CIE color standards (see ITU-R
* Recommendation BT.709-4), that averages the color channels into one value.
*/
double calculateLuminance ( const COLLADAFW::Color& color );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include "COLLADASaxFWLPrerequisites.h"
#include "COLLADASaxFWLLibraryEffectsLoader.h"
#include "COLLADASaxFWLIParserImpl14.h"
#include "COLLADASaxFWLLibraryImagesLoader14.h"


namespace COLLADASaxFWL
Expand All @@ -25,14 +25,14 @@ namespace COLLADASaxFWL
class IFilePartLoader;


class LibraryEffectsLoader14 : public IParserImpl14
class LibraryEffectsLoader14 : public LibraryImagesLoader14
{
private:
LibraryEffectsLoader* mLoader;

public:
LibraryEffectsLoader14(LibraryEffectsLoader* loader)
: mLoader(loader)
: LibraryImagesLoader14(static_cast<LibraryImagesLoader*>(loader)), mLoader(loader)
{}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include "COLLADASaxFWLPrerequisites.h"
#include "COLLADASaxFWLLibraryEffectsLoader.h"
#include "COLLADASaxFWLIParserImpl15.h"
#include "COLLADASaxFWLLibraryImagesLoader15.h"


namespace COLLADASaxFWL
Expand All @@ -25,14 +25,14 @@ namespace COLLADASaxFWL
class IFilePartLoader;


class LibraryEffectsLoader15 : public IParserImpl15
class LibraryEffectsLoader15 : public LibraryImagesLoader15
{
private:
LibraryEffectsLoader* mLoader;

public:
LibraryEffectsLoader15(LibraryEffectsLoader* loader)
: mLoader(loader)
: LibraryImagesLoader15(static_cast<LibraryImagesLoader*>(loader)), mLoader(loader)
{}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace COLLADASaxFWL

//------------------------------
LibraryEffectsLoader::LibraryEffectsLoader( IFilePartLoader* callingFilePartLoader )
: FilePartLoader(callingFilePartLoader)
: LibraryImagesLoader(callingFilePartLoader)
, mCurrentEffect(0)
, mTransparency(1)
, mOpaqueMode(UNSPECIFIED_OPAQUE)
Expand Down

0 comments on commit 619d942

Please sign in to comment.