Delete unused code

This commit is contained in:
halx99 2022-05-18 10:29:29 +08:00
parent c8822a9cda
commit 85f395383b
3 changed files with 6 additions and 29 deletions

View File

@ -62,7 +62,6 @@ RenderTexture::~RenderTexture()
{
CC_SAFE_RELEASE(_renderTarget);
CC_SAFE_RELEASE(_sprite);
CC_SAFE_RELEASE(_texture2DCopy);
CC_SAFE_RELEASE(_depthStencilTexture);
CC_SAFE_RELEASE(_UITextureImage);
}
@ -82,12 +81,6 @@ void RenderTexture::listenToBackground(EventCustom* /*event*/)
const Vec2& s = _texture2D->getContentSizeInPixels();
VolatileTextureMgr::addDataTexture(_texture2D, uiTextureImage->getData(), s.width * s.height * 4,
backend::PixelFormat::RGBA8, s);
if (_texture2DCopy)
{
VolatileTextureMgr::addDataTexture(_texture2DCopy, uiTextureImage->getData(), s.width * s.height * 4,
backend::PixelFormat::RGBA8, s);
}
}
else
{
@ -112,10 +105,6 @@ void RenderTexture::listenToForeground(EventCustom* /*event*/)
// }
_texture2D->setAntiAliasTexParameters();
if (_texture2DCopy)
{
_texture2DCopy->setAntiAliasTexParameters();
}
#endif
}
@ -216,10 +205,6 @@ bool RenderTexture::initWithWidthAndHeight(int w, int h, backend::PixelFormat fo
clearColorAttachment();
_texture2D->setAntiAliasTexParameters();
if (_texture2DCopy)
{
_texture2DCopy->setAntiAliasTexParameters();
}
// retained
setSprite(Sprite::createWithTexture(_texture2D));

View File

@ -375,7 +375,6 @@ protected:
Texture2D* _texture2D = nullptr;
Texture2D* _depthStencilTexture = nullptr;
Texture2D* _texture2DCopy = nullptr; // a copy of _texture
backend::RenderTarget* _renderTarget = nullptr;
backend::RenderTarget* _oldRenderTarget = nullptr;

View File

@ -171,9 +171,8 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe
Log.d(TAG, "onResume()");
paused = false;
super.onResume();
if (this.hasFocus) {
resume();
}
this.hideVirtualButton();
resumeIfHasFocus();
}
@Override
@ -182,15 +181,7 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe
super.onWindowFocusChanged(hasFocus);
this.hasFocus = hasFocus;
if (this.hasFocus && !paused) {
resume();
}
}
private void resume() {
this.hideVirtualButton();
Cocos2dxHelper.onResume();
mGLSurfaceView.onResume();
resumeIfHasFocus();
}
private void resumeIfHasFocus() {
@ -199,7 +190,9 @@ public abstract class Cocos2dxActivity extends Activity implements Cocos2dxHelpe
boolean readyToPlay = !isDeviceLocked() && !isDeviceAsleep();
if(hasFocus && readyToPlay) {
resume();
this.hideVirtualButton();
Cocos2dxHelper.onResume();
mGLSurfaceView.onResume();
}
}