Skip to content

Commit

Permalink
Merge pull request #564 from paroj/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
paroj committed Nov 11, 2017
2 parents 186028f + 1dac814 commit d243771
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 25 deletions.
4 changes: 2 additions & 2 deletions CMake/Packaging.cmake
Expand Up @@ -20,8 +20,8 @@ set(CPACK_PACKAGE_VENDOR "Torus Knot Software")

# CPack won't allow file without recognized extension to be used as
# license file.
configure_file("${OGRE_SOURCE_DIR}/COPYING" "${OGRE_BINARY_DIR}/COPYING.txt" COPYONLY)
set(CPACK_RESOURCE_FILE_LICENSE "${OGRE_BINARY_DIR}/COPYING.txt")
file(COPY "${OGRE_SOURCE_DIR}/LICENSE" DESTINATION "${OGRE_BINARY_DIR}/LICENSE.txt")
set(CPACK_RESOURCE_FILE_LICENSE "${OGRE_BINARY_DIR}/LICENSE.txt")

#set(CPACK_PACKAGE_ICON "${OGRE_SOURCE_DIR}\\\\ogrelogo.gif")

Expand Down
2 changes: 1 addition & 1 deletion Components/Bites/src/OgreApplicationContext.cpp
Expand Up @@ -567,7 +567,7 @@ void ApplicationContext::locateResources()
cf.load(openAPKFile(mFSLayer->getConfigFilePath("resources.cfg")));
# else
Ogre::String resourcesPath = mFSLayer->getConfigFilePath("resources.cfg");
if (Ogre::FileSystemLayer::fileExists(resourcesPath))
if (Ogre::FileSystemLayer::fileExists(resourcesPath) || OGRE_PLATFORM == OGRE_PLATFORM_EMSCRIPTEN)
{
cf.load(resourcesPath);
}
Expand Down
12 changes: 6 additions & 6 deletions Components/RTShaderSystem/src/OgreShaderGenerator.cpp
Expand Up @@ -88,14 +88,14 @@ ShaderGenerator::ShaderGenerator() :
{
mShaderLanguage = "glsles";
}
else if (hmgr.isLanguageSupported("cg"))
{
mShaderLanguage = "cg";
}
else if (hmgr.isLanguageSupported("glsl"))
{
mShaderLanguage = "glsl";
}
else if (hmgr.isLanguageSupported("cg"))
{
mShaderLanguage = "cg";
}
else if (hmgr.isLanguageSupported("hlsl"))
{
mShaderLanguage = "hlsl";
Expand All @@ -107,8 +107,8 @@ ShaderGenerator::ShaderGenerator() :
"ShaderGenerator::ShaderGenerator" );
}

setVertexShaderProfiles("gpu_vp gp4vp vp40 vp30 arbvp1 vs_4_0 vs_4_0_level_9_3 vs_4_0_level_9_1 vs_3_0 vs_2_x vs_2_a vs_2_0 vs_1_1");
setFragmentShaderProfiles("ps_4_0 ps_4_0_level_9_3 ps_4_0_level_9_1 ps_3_x ps_3_0 fp40 fp30 fp20 arbfp1 ps_2_x ps_2_a ps_2_b ps_2_0 ps_1_4 ps_1_3 ps_1_2 ps_1_1");
setVertexShaderProfiles("gpu_vp gp4vp vp40 vp30 arbvp1 vs_4_0 vs_4_0_level_9_3 vs_4_0_level_9_1 vs_3_0 vs_2_x vs_2_a vs_2_0 vs_1_1 glslv");
setFragmentShaderProfiles("ps_4_0 ps_4_0_level_9_3 ps_4_0_level_9_1 ps_3_x ps_3_0 fp40 fp30 fp20 arbfp1 ps_2_x ps_2_a ps_2_b ps_2_0 ps_1_4 ps_1_3 ps_1_2 ps_1_1 glslf");
}

//-----------------------------------------------------------------------------
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions OgreMain/src/OgreScriptParser.cpp
Expand Up @@ -474,6 +474,7 @@ namespace Ogre
node->parent = 0;
node->token = token->lexeme.substr(1, token->lexeme.size() - 2);
node->type = CNT_QUOTE;
break;
default:
OGRE_EXCEPT(Exception::ERR_INVALID_STATE,
Ogre::String("unexpected token") + token->lexeme + " at line " +
Expand Down
7 changes: 0 additions & 7 deletions PlugIns/CgProgramManager/src/OgreCgPlugin.cpp
Expand Up @@ -55,13 +55,6 @@ namespace Ogre
//---------------------------------------------------------------------
void CgPlugin::initialise()
{
// Cg is also not supported on OpenGL 3+
if(Root::getSingletonPtr()->getRenderSystem()->getName().find("OpenGL 3+") != String::npos)
{
LogManager::getSingleton().logMessage("Disabling Cg Plugin for GL3+");
return;
}

// Check for gles2 by the glsles factory (this plugin is not supported on embedded systems for now)
if (HighLevelGpuProgramManager::getSingleton().isLanguageSupported("glsles") == false)

Expand Down
15 changes: 7 additions & 8 deletions PlugIns/CgProgramManager/src/OgreCgProgram.cpp
Expand Up @@ -51,7 +51,7 @@ namespace Ogre {
iend = mProfiles.end();
GpuProgramManager& gpuMgr = GpuProgramManager::getSingleton();
bool useDelegate = false;
bool foundProfile = false;

for (i = mProfiles.begin(); i != iend; ++i)
{
bool syntaxSupported = gpuMgr.isSyntaxSupported(*i);
Expand Down Expand Up @@ -86,7 +86,7 @@ namespace Ogre {
"Unable to find CG profile enum for program " + mName + ": ", mCgContext);

// do we need a delegate?
if (useDelegate && mDelegate)
if (useDelegate && !mDelegate)
{
mDelegate =
HighLevelGpuProgramManager::getSingleton().createProgram(
Expand All @@ -105,15 +105,9 @@ namespace Ogre {
mDelegate.reset();
}

foundProfile = true;
break;
}
}

if (!foundProfile)
{
LogManager::getSingleton().logMessage(String("Error: ") + mName + "'s syntax is not supported", LML_CRITICAL);
}
}
//-----------------------------------------------------------------------
void CgProgram::buildArgs(void)
Expand Down Expand Up @@ -879,6 +873,11 @@ namespace Ogre {
//-----------------------------------------------------------------------
void CgProgram::unloadHighLevelImpl(void)
{
if (mDelegate)
{
mDelegate->getCreator()->remove(mDelegate);
mDelegate.reset();
}
}
//-----------------------------------------------------------------------
void CgProgram::buildConstantDefinitions() const
Expand Down
2 changes: 1 addition & 1 deletion RenderSystems/GLES2/src/OgreGLES2FrameBufferObject.cpp
Expand Up @@ -236,7 +236,7 @@ namespace Ogre {
// Depth buffer is not handled here anymore.
// See GLES2FrameBufferObject::attachDepthBuffer() & RenderSystem::setDepthBufferFor()

if(rs->hasMinGLVersion(3, 0))
if(rs->hasMinGLVersion(3, 0) && OGRE_PLATFORM != OGRE_PLATFORM_EMSCRIPTEN) // ED on Emscripten
{
GLenum bufs[OGRE_MAX_MULTIPLE_RENDER_TARGETS];
GLsizei n=0;
Expand Down
2 changes: 2 additions & 0 deletions RenderSystems/GLES2/src/OgreGLES2PixelFormat.cpp
Expand Up @@ -272,7 +272,9 @@ namespace Ogre {

void GLES2PixelUtil::useSizedFormats()
{
#if OGRE_PLATFORM != OGRE_PLATFORM_EMSCRIPTEN // still just Editors Draft
memcpy(_pixelFormats, _pixelFormatsSized, sizeof(_pixelFormatsSized));
#endif
}

//-----------------------------------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions RenderSystems/GLES2/src/OgreGLES2Texture.cpp
Expand Up @@ -139,6 +139,9 @@ namespace Ogre {
GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

bool hasGLES30 = mRenderSystem->hasMinGLVersion(3, 0);
#if OGRE_PLATFORM == OGRE_PLATFORM_EMSCRIPTEN
hasGLES30 = false; // still just Editors Draft
#endif

// Set up texture swizzling
if (hasGLES30 && PixelUtil::isLuminance(mFormat))
Expand Down

0 comments on commit d243771

Please sign in to comment.