Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/source/camera/CullingManager.cpp b/source/camera/CullingManager.cpp
- index 4b7af2c7..55c6ec7d 100644
- --- a/source/camera/CullingManager.cpp
- +++ b/source/camera/CullingManager.cpp
- @@ -135,11 +135,7 @@ void CullingManager::newBashAndSplashTiles(uint32_t mode)
- int64_t xxRight = mWalk.getTopRightVertex().x;
- int64_t xxp, yyp;
- std::stringstream ss;
- - // NOTE(oyvindln): Added code to avoid shifting a negative number here, not sure if it's correct.
- - int64_t bb = std::max(
- - (std::max(std::min(mWalk.getBottomLeftVertex().y, mOldWalk.getBottomRightVertex().y), 0L)
- - >> VectorInt64::PRECISION_DIGITS) - 2
- - ,0L) << VectorInt64::PRECISION_DIGITS;
- + int64_t bb = ((std::min(mWalk.getBottomLeftVertex().y, mOldWalk.getBottomRightVertex().y) >> VectorInt64::PRECISION_DIGITS) - 2) << VectorInt64::PRECISION_DIGITS;
- for (int64_t yy = ((std::max(mWalk.getTopLeftVertex().y, mOldWalk.getTopRightVertex().y ) >> VectorInt64::PRECISION_DIGITS) + 2) << VectorInt64::PRECISION_DIGITS; yy >= bb; yy -= VectorInt64::UNIT)
- {
- @@ -149,9 +145,8 @@ void CullingManager::newBashAndSplashTiles(uint32_t mode)
- xxLeftOld = mOldWalk.getCurrentXLeft(yy);
- xxRight = mWalk.getCurrentXRight(yy);
- xxRightOld = mOldWalk.getCurrentXRight(yy);
- + int64_t mm = ((std::min(xxLeft, xxLeftOld) >> VectorInt64::PRECISION_DIGITS) << VectorInt64::PRECISION_DIGITS) ;
- - // NOTE(oyvindln): Added code to avoid shifting a negative number here, not sure if it's correct.
- - int64_t mm = (std::max(std::min(xxLeft, xxLeftOld),0L) >> VectorInt64::PRECISION_DIGITS) << VectorInt64::PRECISION_DIGITS;
- if(std::min(xxLeft, xxLeftOld) < std::max(xxRight,xxRightOld))
- {
- for (int64_t xx = mm ; xx <= std::max(xxRight,xxRightOld); xx += VectorInt64::UNIT)
- @@ -205,8 +200,8 @@ bool CullingManager::computeIntersectionPoints(Ogre::Camera* camera, std::vector
- void CullingManager::update(Ogre::Camera* camera, const std::vector<Ogre::Vector3>& ogreVectors)
- {
- - /*if(mCullTilesFlag)
- - cullTiles(ogreVectors);*/
- + if(mCullTilesFlag)
- + cullTiles(ogreVectors);
- }
- /*! \brief Sort two VectorInt64 p1 and p2 to satisfy p1 <= p2 according to
- diff --git a/source/camera/SlopeWalk.cpp b/source/camera/SlopeWalk.cpp
- index f09715ef..0ad3b94b 100644
- --- a/source/camera/SlopeWalk.cpp
- +++ b/source/camera/SlopeWalk.cpp
- @@ -62,13 +62,7 @@ void SlopeWalk::buildSlopes()
- for(int ii = mTopRightIndex; ii != mDownRightIndex ; ++ii, ii %= mVertices.mMyArray.size())
- {
- int64_t divisor = mVertices[ii].y - mVertices[ii+1].y;
- - // NOTE(oyvindln): Avoid divide by zero.
- - if(divisor == 0) {
- - break;
- - }
- -
- mRightSlopes.push_back((mVertices[ii].x - mVertices[ii+1].x) * VectorInt64::UNIT / divisor);
- -
- mRightVertices.push_back(ii);
- }
- @@ -82,9 +76,6 @@ void SlopeWalk::buildSlopes()
- for(int ii = mTopLeftIndex; ii != mDownLeftIndex ; ii+=mVertices.mMyArray.size() - 1, ii%=mVertices.mMyArray.size())
- {
- int64_t divisor = mVertices[ii].y - mVertices[ii-1].y;
- - if(divisor == 0) {
- - break;
- - }
- mLeftSlopes.push_back((mVertices[ii].x - mVertices[ii-1].x) * VectorInt64::UNIT / divisor);
- mLeftVertices.push_back(ii);
- }
- diff --git a/source/entities/Tile.cpp b/source/entities/Tile.cpp
- index 897d0001..93449b1b 100644
- --- a/source/entities/Tile.cpp
- +++ b/source/entities/Tile.cpp
- @@ -66,7 +66,7 @@ Tile::Tile(GameMap* gameMap, int x, int y, TileType type, double fullness) :
- mColorCustomMesh (true),
- mHasBridge (false),
- mLocalPlayerHasVision (false),
- - mTileCulling (CullingType::SHOW_ALL),
- + mTileCulling (CullingType::HIDE),
- mNbWorkersClaiming(0)
- {
- computeTileVisual();
- diff --git a/source/gamemap/MiniMapCamera.cpp b/source/gamemap/MiniMapCamera.cpp
- index 3701a3f8..0cd0a4aa 100644
- --- a/source/gamemap/MiniMapCamera.cpp
- +++ b/source/gamemap/MiniMapCamera.cpp
- @@ -82,7 +82,7 @@ MiniMapCamera::MiniMapCamera(CEGUI::Window* miniMapWindow) :
- mMiniMapCam->setNearClipDistance(0.02f);
- mMiniMapCam->setFarClipDistance(300.0f);
- mMiniMapCam->setFOVy(ANGLE_CAM);
- -
- + mMiniMapCamNode->attachObject(mMiniMapCam);
- Ogre::RenderTarget* rt = mMiniMapOgreTexture->getBuffer()->getRenderTarget();
- rt->addListener(this);
- rt->setAutoUpdated(false);
- @@ -109,8 +109,8 @@ MiniMapCamera::MiniMapCamera(CEGUI::Window* miniMapWindow) :
- mHeight = mMiniMapWindow->getUnclippedOuterRect().get().getSize().d_height;
- updateMinimapCamera();
- - //mCullingManager->computeIntersectionPoints(mMiniMapCam, mCameraTilesIntersections);
- - //mCullingManager->startTileCulling(mMiniMapCam, mCameraTilesIntersections);
- + mCullingManager->computeIntersectionPoints(mMiniMapCam, mCameraTilesIntersections);
- + mCullingManager->startTileCulling(mMiniMapCam, mCameraTilesIntersections);
- }
- MiniMapCamera::~MiniMapCamera()
- @@ -157,8 +157,8 @@ void MiniMapCamera::update(Ogre::Real timeSinceLastFrame, const std::vector<Ogre
- mElapsedTime = 0;
- updateMinimapCamera();
- - //mCullingManager->computeIntersectionPoints(mMiniMapCam, mCameraTilesIntersections);
- - //mCullingManager->update(mMiniMapCam, mCameraTilesIntersections);
- + mCullingManager->computeIntersectionPoints(mMiniMapCam, mCameraTilesIntersections);
- + mCullingManager->update(mMiniMapCam, mCameraTilesIntersections);
- Ogre::RenderTarget* rt = mMiniMapOgreTexture->getBuffer()->getRenderTarget();
- rt->update();
- @@ -173,7 +173,7 @@ void MiniMapCamera::updateMinimapCamera()
- const Ogre::Quaternion& orientation = mCameraManager.getActiveCameraNode()->getOrientation();
- mMiniMapCamNode->setPosition(mCurCamPosX, mCurCamPosY, CAM_HEIGHT);
- mMiniMapCamNode->lookAt(Ogre::Vector3(mCurCamPosX, mCurCamPosY, 0.0),
- - Ogre::Node::TransformSpace::TS_LOCAL);
- + Ogre::Node::TransformSpace::TS_WORLD);
- mMiniMapCamNode->roll(orientation.getRoll());
- }
Add Comment
Please, Sign In to add comment