MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / Resize

Method Resize

Engine/source/environment/VolumetricFogRTManager.cpp:224–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224bool VolumetricFogRTManager::Resize()
225{
226 if (mTargetScale < 1 || GFX->getAdapterType() == Direct3D11)
227 mTargetScale = 1;
228
229 mWidth = mFloor(mPlatformWindow->getClientExtent().x / mTargetScale);
230 mHeight = mFloor(mPlatformWindow->getClientExtent().y / mTargetScale);
231
232 if (mWidth < 16 || mHeight < 16)
233 return false;
234
235 if (mFrontTarget.isRegistered())
236 mFrontTarget.setTexture(NULL);
237
238 if (mDepthTarget.isRegistered())
239 mDepthTarget.setTexture(NULL);
240
241 if (mDepthBuffer.isValid())
242 mDepthBuffer->kill();
243
244 if (mFrontBuffer.isValid())
245 mFrontBuffer->kill();
246
247 mFrontBuffer = GFXTexHandle(mWidth, mHeight, GFXFormatR32F,
248 &GFXRenderTargetProfile, avar("%s() - mFrontBuffer (line %d)", __FUNCTION__, __LINE__));
249 if (!mFrontBuffer.isValid())
250 {
251 Con::errorf("VolumetricFogRTManager::Resize() Fatal Error: Unable to create front buffer");
252 return false;
253 }
254 mFrontTarget.setTexture(mFrontBuffer);
255
256 mDepthBuffer = GFXTexHandle(mWidth, mHeight, GFXFormatR32F,
257 &GFXRenderTargetProfile, avar("%s() - mDepthBuffer (line %d)", __FUNCTION__, __LINE__));
258 if (!mDepthBuffer.isValid())
259 {
260 Con::errorf("VolumetricFogRTManager::Resize() Fatal Error: Unable to create Depthbuffer");
261 return false;
262 }
263 mDepthTarget.setTexture(mDepthBuffer);
264 return true;
265}
266
267S32 VolumetricFogRTManager::setQuality(U32 Quality)
268{

Callers

nothing calls this directly

Calls 10

mFloorFunction · 0.85
avarFunction · 0.85
GFXTexHandleClass · 0.50
errorfFunction · 0.50
getAdapterTypeMethod · 0.45
getClientExtentMethod · 0.45
isRegisteredMethod · 0.45
setTextureMethod · 0.45
isValidMethod · 0.45
killMethod · 0.45

Tested by

no test coverage detected