Skip to content

Commit 5964e2a

Browse files
committed
make code forward-compatible with 1.13
1 parent 43687e8 commit 5964e2a

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if(WIN32)
3535
set(CMAKE_MODULE_PATH "$ENV{OGRE_HOME}/CMake/;${CMAKE_MODULE_PATH}")
3636
endif(WIN32)
3737

38-
find_package(OGRE 1.11 REQUIRED)
38+
find_package(OGRE REQUIRED CONFIG)
3939
find_package(Qt5 COMPONENTS Core Gui Widgets REQUIRED)
4040

4141
add_subdirectory(Engine)

Engine/EngineCore/RenderView.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ void RenderView::update()
259259
}
260260
else
261261
{
262-
mOverlay->hide();
262+
//mOverlay->hide();
263263
}
264264

265265
mRenderWindow->update();

Engine/GPU2DOperation/GPU2DOperationRenderableQuad.cpp

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,25 @@ void GPU2DOperationRenderableQuad::setMaterialTexture(const string& aliasName,
211211
mAliasTextureMap[aliasName] = textureName;
212212
}
213213

214+
static void applyTextureAliases(const Ogre::Technique* t, const Ogre::NameValuePairList& aliasList)
215+
{
216+
for (auto p : t->getPasses())
217+
{
218+
for (auto tus : p->getTextureUnitStates())
219+
{
220+
auto aliasIt = aliasList.find(tus->getTextureNameAlias());
221+
if (aliasIt == aliasList.end())
222+
continue;
223+
224+
if (tus->getNumFrames() > 1)
225+
tus->setAnimatedTextureName(aliasIt->second, tus->getNumFrames(),
226+
tus->getAnimationDuration());
227+
else
228+
tus->setTextureName(aliasIt->second, tus->getTextureType());
229+
}
230+
}
231+
}
232+
214233
void GPU2DOperationRenderableQuad::prepareForRender(Ogre::ushort zOrder)
215234
{
216235
mZOrder = zOrder;
@@ -231,11 +250,11 @@ void GPU2DOperationRenderableQuad::prepareForRender(Ogre::ushort zOrder)
231250
// Update material texture(s) if necessary
232251
if (newMaterial)
233252
{
234-
technique->applyTextureAliases(mAliasTextureMap, true);
253+
applyTextureAliases(technique, mAliasTextureMap);
235254
}
236255
else
237256
{
238-
technique->applyTextureAliases(mNewAliasTextureMap, true);
257+
applyTextureAliases(technique, mNewAliasTextureMap);
239258
}
240259
mNewAliasTextureMap.clear();
241260

Engine/Utils/Utils.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
#include "ScapeEngineStableHeaders.h"
88
#include "Utils.h"
99

10+
#if OGRE_PLATFORM == OGRE_PLATFORM_LINUX
11+
#include <unistd.h>
12+
#endif
13+
1014
using namespace ScapeEngine;
1115

1216
const string Utils::emptyString = _T("");

0 commit comments

Comments
 (0)