MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / newBashAndSplashTiles

Method newBashAndSplashTiles

source/camera/CullingManager.cpp:130–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130void CullingManager::newBashAndSplashTiles(uint32_t mode)
131{
132 int64_t xxLeftOld = mOldWalk.getTopLeftVertex().x;
133 int64_t xxRightOld = mOldWalk.getTopRightVertex().x;
134 int64_t xxLeft = mWalk.getTopLeftVertex().x;
135 int64_t xxRight = mWalk.getTopRightVertex().x;
136 int64_t xxp, yyp;
137 std::stringstream ss;
138 int64_t bb = ((std::min(mWalk.getBottomLeftVertex().y, mOldWalk.getBottomRightVertex().y) >> VectorInt64::PRECISION_DIGITS) - 2) << VectorInt64::PRECISION_DIGITS;
139
140 for (int64_t yy = ((std::max(mWalk.getTopLeftVertex().y, mOldWalk.getTopRightVertex().y ) >> VectorInt64::PRECISION_DIGITS) + 2) << VectorInt64::PRECISION_DIGITS; yy >= bb; yy -= VectorInt64::UNIT)
141 {
142 mOldWalk.notifyOnMoveDown(yy);
143 mWalk.notifyOnMoveDown(yy);
144 xxLeft = mWalk.getCurrentXLeft(yy);
145 xxLeftOld = mOldWalk.getCurrentXLeft(yy);
146 xxRight = mWalk.getCurrentXRight(yy);
147 xxRightOld = mOldWalk.getCurrentXRight(yy);
148
149 int64_t mm = ((std::min(xxLeft, xxLeftOld) >> VectorInt64::PRECISION_DIGITS) << VectorInt64::PRECISION_DIGITS) ;
150 if(std::min(xxLeft, xxLeftOld) < std::max(xxRight,xxRightOld))
151 {
152 for (int64_t xx = mm ; xx <= std::max(xxRight,xxRightOld); xx += VectorInt64::UNIT)
153 {
154 bool bash = (xx >= xxLeftOld && xx <= xxRightOld && (yy >= mOldWalk.getBottomLeftVertex().y) && yy <= mOldWalk.getTopLeftVertex().y);
155 bool splash = (xx >= xxLeft && xx <= xxRight && (yy >= mWalk.getBottomLeftVertex().y) && yy <= mWalk.getTopLeftVertex().y);
156
157 xxp = (xx >> VectorInt64::PRECISION_DIGITS);
158 yyp = (yy >> VectorInt64::PRECISION_DIGITS);
159 Tile* tile = mGameMap->getTile(xxp, yyp);
160 if(bash && splash && (mode & HIDE) && (mode & SHOW))
161 {
162 // Nothing
163 }
164
165 else if (bash && (mode & HIDE) && (tile != nullptr))
166 {
167 tile->setTileCullingFlags(mCullingMask, false);
168 }
169 else if (splash && (mode & SHOW) && (tile != nullptr))
170 {
171 tile->setTileCullingFlags(mCullingMask, true);
172 }
173 }
174 }
175 }
176}
177
178bool CullingManager::computeIntersectionPoints(Ogre::Camera* camera, std::vector<Ogre::Vector3>& ogreVectors)
179{

Callers

nothing calls this directly

Calls 5

notifyOnMoveDownMethod · 0.80
getCurrentXLeftMethod · 0.80
getCurrentXRightMethod · 0.80
setTileCullingFlagsMethod · 0.80
getTileMethod · 0.45

Tested by

no test coverage detected