Skip to content

Commit

Permalink
OgreRootLayout uses json elements despite OGRE_NO_JSON.
Browse files Browse the repository at this point in the history
Some code parts use json elements despite OGRE_NO_JSON. As a result, OgreMain is not compiled.
  • Loading branch information
Th3V1kt0r committed Apr 19, 2024
1 parent 3b39603 commit 6fac3b5
Showing 1 changed file with 32 additions and 17 deletions.
49 changes: 32 additions & 17 deletions OgreMain/src/OgreRootLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,27 @@ THE SOFTWARE.
#include "OgreGpuProgram.h"
#include "OgreLogManager.h"
#include "OgreLwString.h"
#include "OgreStringConverter.h"

#if defined( __GNUC__ ) && !defined( __clang__ )
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wclass-memaccess"
#endif
#if defined( __clang__ )
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
# pragma clang diagnostic ignored "-Wdeprecated-copy"
#endif
#include "rapidjson/document.h"
#include "rapidjson/error/en.h"
#if defined( __clang__ )
# pragma clang diagnostic pop
#endif
#if defined( __GNUC__ ) && !defined( __clang__ )
# pragma GCC diagnostic pop
#if !OGRE_NO_JSON
# include "OgreStringConverter.h"
#
# if defined( __GNUC__ ) && !defined( __clang__ )
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wclass-memaccess"
# endif
# if defined( __clang__ )
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wimplicit-int-float-conversion"
# pragma clang diagnostic ignored "-Wdeprecated-copy"
# endif
# include "rapidjson/document.h"
# include "rapidjson/error/en.h"
# if defined( __clang__ )
# pragma clang diagnostic pop
# endif
# if defined( __GNUC__ ) && !defined( __clang__ )
# pragma GCC diagnostic pop
# endif
#endif

#define TODO_limit_NUM_BIND_TEXTURES // and co.
Expand Down Expand Up @@ -358,6 +361,7 @@ namespace Ogre
void RootLayout::parseSet( const rapidjson::Value &jsonValue, const size_t setIdx,
const String &filename )
{
#if !OGRE_NO_JSON
rapidjson::Value::ConstMemberIterator itor;

itor = jsonValue.FindMember( "baked" );
Expand Down Expand Up @@ -450,6 +454,11 @@ namespace Ogre
}
}
}
#else
OGRE_EXCEPT( Exception::ERR_INVALID_CALL,
"Ogre must be built with JSON support to call this function!",
"RootLayout::parseSet" );
#endif
}
//-------------------------------------------------------------------------
void RootLayout::addArrayBinding( DescBindingTypes::DescBindingTypes bindingType,
Expand Down Expand Up @@ -543,6 +552,7 @@ namespace Ogre
void RootLayout::parseRootLayout( const char *rootLayout, const bool bCompute,
const String &filename )
{
#if !OGRE_NO_JSON
mCompute = bCompute;
mParamsBuffStages = 0u;

Expand Down Expand Up @@ -623,6 +633,11 @@ namespace Ogre
LogManager::getSingleton().logMessage( dumpStr, LML_CRITICAL );
throw;
}
#else
OGRE_EXCEPT( Exception::ERR_INVALID_CALL,
"Ogre must be built with JSON support to call this function!",
"RootLayout::parseRootLayout" );
#endif
}
//-----------------------------------------------------------------------------------
inline void RootLayout::flushLwString( LwString &jsonStr, String &outJson )
Expand Down

0 comments on commit 6fac3b5

Please sign in to comment.