From b9c207765e18604f35fb4713718b01ffb168447d Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 11 May 2020 15:00:25 -0500 Subject: [PATCH] uninitialized variables-gfx --- Engine/source/gfx/D3D11/gfxD3D11Device.cpp | 7 +++++- Engine/source/gfx/D3D11/gfxD3D11Device.h | 1 + .../gfx/D3D11/gfxD3D11PrimitiveBuffer.h | 4 ++-- Engine/source/gfx/D3D11/gfxD3D11Shader.h | 22 +++++++++---------- Engine/source/gfx/D3D11/gfxD3D11Target.cpp | 2 ++ .../gfx/D3D11/gfxD3D11TextureObject.cpp | 5 ++++- .../source/gfx/D3D11/gfxD3D11VertexBuffer.h | 4 ++-- Engine/source/gfx/Null/gfxNullDevice.cpp | 2 +- Engine/source/gfx/bitmap/ddsFile.h | 12 ++++++++-- Engine/source/gfx/bitmap/gBitmap.cpp | 3 +-- Engine/source/gfx/bitmap/gBitmap.h | 3 +++ Engine/source/gfx/bitmap/imageUtils.cpp | 3 +-- Engine/source/gfx/gFont.cpp | 7 ++++-- Engine/source/gfx/gFont.h | 3 ++- Engine/source/gfx/gfxAdapter.h | 1 + Engine/source/gfx/gfxCubemap.h | 2 +- Engine/source/gfx/gfxFontRenderBatcher.cpp | 4 +++- Engine/source/gfx/gfxFormatUtils.h | 2 +- Engine/source/gfx/gfxStructs.h | 7 +++++- Engine/source/gfx/gfxVertexBuffer.h | 4 ++++ Engine/source/gfx/gfxVertexFormat.cpp | 1 + .../gfx/gl/gfxGLCircularVolatileBuffer.h | 3 ++- Engine/source/gfx/gl/gfxGLCubemap.cpp | 3 +++ Engine/source/gfx/gl/gfxGLDevice.cpp | 1 + Engine/source/gfx/gl/gfxGLDeviceProfiler.cpp | 2 +- Engine/source/gfx/gl/gfxGLPrimitiveBuffer.cpp | 6 +++-- Engine/source/gfx/gl/gfxGLShader.cpp | 1 + Engine/source/gfx/gl/gfxGLTextureObject.cpp | 9 ++++++++ Engine/source/gfx/gl/gfxGLVertexDecl.h | 4 ++-- Engine/source/gfx/video/theoraTexture.cpp | 4 +++- Engine/source/gfx/video/videoCapture.cpp | 6 ++++- Engine/source/gfx/video/videoCapture.h | 6 ++--- .../source/gfx/video/videoEncoderTheora.cpp | 7 +++++- 33 files changed, 108 insertions(+), 43 deletions(-) diff --git a/Engine/source/gfx/D3D11/gfxD3D11Device.cpp b/Engine/source/gfx/D3D11/gfxD3D11Device.cpp index a544452f8..1bbd68e6d 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11Device.cpp +++ b/Engine/source/gfx/D3D11/gfxD3D11Device.cpp @@ -90,6 +90,8 @@ GFXD3D11Device::GFXD3D11Device(U32 index) mDeviceSwizzle24 = &Swizzles::bgr; mAdapterIndex = index; + mSwapChain = NULL; + mD3DDevice = NULL; mD3DDeviceContext = NULL; mVolatileVB = NULL; @@ -107,6 +109,8 @@ GFXD3D11Device::GFXD3D11Device(U32 index) mPixVersion = 0.0; + mFeatureLevel = D3D_FEATURE_LEVEL_9_1; //lowest listed. should be overridden by init + mVertexShaderTarget = String::EmptyString; mPixelShaderTarget = String::EmptyString; mShaderModel = String::EmptyString; @@ -123,7 +127,8 @@ GFXD3D11Device::GFXD3D11Device(U32 index) mCreateFenceType = -1; // Unknown, test on first allocate mCurrentConstBuffer = NULL; - + mMultisampleDesc.Count = 0; + mMultisampleDesc.Quality = 0; mOcclusionQuerySupported = false; mDebugLayers = false; diff --git a/Engine/source/gfx/D3D11/gfxD3D11Device.h b/Engine/source/gfx/D3D11/gfxD3D11Device.h index 9fd853b86..75525ce95 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11Device.h +++ b/Engine/source/gfx/D3D11/gfxD3D11Device.h @@ -79,6 +79,7 @@ protected: class D3D11VertexDecl : public GFXVertexDecl { public: + D3D11VertexDecl() :decl(NULL) {} virtual ~D3D11VertexDecl() { SAFE_RELEASE( decl ); diff --git a/Engine/source/gfx/D3D11/gfxD3D11PrimitiveBuffer.h b/Engine/source/gfx/D3D11/gfxD3D11PrimitiveBuffer.h index 1be1952d4..948176af6 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11PrimitiveBuffer.h +++ b/Engine/source/gfx/D3D11/gfxD3D11PrimitiveBuffer.h @@ -73,11 +73,11 @@ inline GFXD3D11PrimitiveBuffer::GFXD3D11PrimitiveBuffer( GFXDevice *device, mLocked = false; #ifdef TORQUE_DEBUG mDebugGuardBuffer = NULL; - mLockedBuffer = NULL; mLockedSize = 0; +#endif mIndexStart = 0; mIndexEnd = 0; -#endif + mLockedBuffer = NULL; } #endif diff --git a/Engine/source/gfx/D3D11/gfxD3D11Shader.h b/Engine/source/gfx/D3D11/gfxD3D11Shader.h index b20ea8e3c..8ae17a979 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11Shader.h +++ b/Engine/source/gfx/D3D11/gfxD3D11Shader.h @@ -77,17 +77,17 @@ enum REGISTER_TYPE struct ConstantDesc { - String Name; - S32 RegisterIndex; - S32 RegisterCount; - S32 Rows; - S32 Columns; - S32 Elements; - S32 StructMembers; - REGISTER_TYPE RegisterSet; - CONST_CLASS Class; - CONST_TYPE Type; - U32 Bytes; + String Name = String::EmptyString; + S32 RegisterIndex = 0; + S32 RegisterCount = 0; + S32 Rows = 0; + S32 Columns = 0; + S32 Elements = 0; + S32 StructMembers = 0; + REGISTER_TYPE RegisterSet = D3DRS_FLOAT4; + CONST_CLASS Class = D3DPC_SCALAR; + CONST_TYPE Type = D3DPT_FLOAT; + U32 Bytes = 0; }; class ConstantTable diff --git a/Engine/source/gfx/D3D11/gfxD3D11Target.cpp b/Engine/source/gfx/D3D11/gfxD3D11Target.cpp index 45aabbf07..29eb8fb46 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11Target.cpp +++ b/Engine/source/gfx/D3D11/gfxD3D11Target.cpp @@ -324,6 +324,8 @@ GFXD3D11WindowTarget::GFXD3D11WindowTarget() mDepthStencilView = NULL; mDepthStencil = NULL; mBackBufferView = NULL; + mSwapChain = NULL; + dMemset(&mPresentationParams, 0, sizeof(mPresentationParams)); mSecondaryWindow = false; } diff --git a/Engine/source/gfx/D3D11/gfxD3D11TextureObject.cpp b/Engine/source/gfx/D3D11/gfxD3D11TextureObject.cpp index e2508eb40..27965a7da 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11TextureObject.cpp +++ b/Engine/source/gfx/D3D11/gfxD3D11TextureObject.cpp @@ -46,10 +46,13 @@ GFXD3D11TextureObject::GFXD3D11TextureObject( GFXDevice * d, GFXTextureProfile * mLocked = false; mD3DSurface = NULL; + dMemset(&mLockRect, 0, sizeof(mLockRect)); + dMemset(&mLockBox, 0, sizeof(mLockBox)); mLockedSubresource = 0; mDSView = NULL; mRTView = NULL; mSRView = NULL; + isManaged = false; } GFXD3D11TextureObject::~GFXD3D11TextureObject() @@ -318,4 +321,4 @@ ID3D11RenderTargetView** GFXD3D11TextureObject::getRTViewPtr() ID3D11DepthStencilView** GFXD3D11TextureObject::getDSViewPtr() { return &mDSView; -} \ No newline at end of file +} diff --git a/Engine/source/gfx/D3D11/gfxD3D11VertexBuffer.h b/Engine/source/gfx/D3D11/gfxD3D11VertexBuffer.h index 380a0f93b..9e961cc87 100644 --- a/Engine/source/gfx/D3D11/gfxD3D11VertexBuffer.h +++ b/Engine/source/gfx/D3D11/gfxD3D11VertexBuffer.h @@ -68,10 +68,10 @@ inline GFXD3D11VertexBuffer::GFXD3D11VertexBuffer() : GFXVertexBuffer(0,0,0,0,(G mIsFirstLock = true; lockedVertexEnd = lockedVertexStart = 0; mClearAtFrameEnd = false; + mLockedBuffer = NULL; #ifdef TORQUE_DEBUG mDebugGuardBuffer = NULL; - mLockedBuffer = NULL; #endif } @@ -92,4 +92,4 @@ inline GFXD3D11VertexBuffer::GFXD3D11VertexBuffer( GFXDevice *device, #endif } -#endif // _GFXD3D_VERTEXBUFFER_H_ \ No newline at end of file +#endif // _GFXD3D_VERTEXBUFFER_H_ diff --git a/Engine/source/gfx/Null/gfxNullDevice.cpp b/Engine/source/gfx/Null/gfxNullDevice.cpp index 83933733c..8767d4eee 100644 --- a/Engine/source/gfx/Null/gfxNullDevice.cpp +++ b/Engine/source/gfx/Null/gfxNullDevice.cpp @@ -187,7 +187,7 @@ public: const GFXVertexFormat *vertexFormat, U32 vertexSize, GFXBufferType bufferType ) : - GFXVertexBuffer(device, numVerts, vertexFormat, vertexSize, bufferType) { }; + GFXVertexBuffer(device, numVerts, vertexFormat, vertexSize, bufferType) {tempBuf =NULL;}; virtual void lock(U32 vertexStart, U32 vertexEnd, void **vertexPtr); virtual void unlock(); virtual void prepare(); diff --git a/Engine/source/gfx/bitmap/ddsFile.h b/Engine/source/gfx/bitmap/ddsFile.h index 8e726c54a..7aae54ff4 100644 --- a/Engine/source/gfx/bitmap/ddsFile.h +++ b/Engine/source/gfx/bitmap/ddsFile.h @@ -176,7 +176,15 @@ struct DDSFile // For debugging fun! static S32 smActiveCopies; - DDSFile() + DDSFile(): + mBytesPerPixel(0), + mHeight(0), + mWidth(0), + mDepth(0), + mFormat(GFXFormat_FIRST), + mFourCC(0), + mMipMapCount(0), + mPitchOrLinearSize(0) { VECTOR_SET_ASSOCIATION( mSurfaces ); smActiveCopies++; @@ -203,4 +211,4 @@ struct DDSFile bool decompressToGBitmap(GBitmap *dest); }; -#endif // _DDSFILE_H_ \ No newline at end of file +#endif // _DDSFILE_H_ diff --git a/Engine/source/gfx/bitmap/gBitmap.cpp b/Engine/source/gfx/bitmap/gBitmap.cpp index fe73ecf7e..380070346 100644 --- a/Engine/source/gfx/bitmap/gBitmap.cpp +++ b/Engine/source/gfx/bitmap/gBitmap.cpp @@ -50,8 +50,7 @@ GBitmap::GBitmap() mNumMipLevels(0), mHasTransparency(false) { - for (U32 i = 0; i < c_maxMipLevels; i++) - mMipLevelOffsets[i] = 0xffffffff; + std::fill_n(mMipLevelOffsets, c_maxMipLevels, 0xffffffff); } GBitmap::GBitmap(const GBitmap& rCopy) diff --git a/Engine/source/gfx/bitmap/gBitmap.h b/Engine/source/gfx/bitmap/gBitmap.h index 7ff215a81..16cb24985 100644 --- a/Engine/source/gfx/bitmap/gBitmap.h +++ b/Engine/source/gfx/bitmap/gBitmap.h @@ -82,6 +82,9 @@ public: Registration() { + readFunc = NULL; + writeFunc = NULL; + defaultCompression = 0; priority = 0; VECTOR_SET_ASSOCIATION( extensions ); } diff --git a/Engine/source/gfx/bitmap/imageUtils.cpp b/Engine/source/gfx/bitmap/imageUtils.cpp index 2d9e7ab8d..ed8d108da 100644 --- a/Engine/source/gfx/bitmap/imageUtils.cpp +++ b/Engine/source/gfx/bitmap/imageUtils.cpp @@ -69,7 +69,6 @@ namespace ImageUtil { S32 width; S32 height; - S32 flags; const U8 *pSrc; U8 *pDst; GFXFormat format; @@ -306,4 +305,4 @@ namespace ImageUtil { return mFloor(mLog2(mMax(width, height))) + 1; } -} \ No newline at end of file +} diff --git a/Engine/source/gfx/gFont.cpp b/Engine/source/gfx/gFont.cpp index 9193b1e58..d64e1066e 100644 --- a/Engine/source/gfx/gFont.cpp +++ b/Engine/source/gfx/gFont.cpp @@ -198,14 +198,17 @@ GFont::GFont() VECTOR_SET_ASSOCIATION(mCharInfoList); VECTOR_SET_ASSOCIATION(mTextureSheets); - for (U32 i = 0; i < (sizeof(mRemapTable) / sizeof(S32)); i++) - mRemapTable[i] = -1; + std::fill_n(mRemapTable, Font_Table_MAX,-1); mCurX = mCurY = mCurSheet = -1; mPlatformFont = NULL; mSize = 0; mCharSet = 0; + mHeight = 0; + mBaseline = 0; + mAscent = 0; + mDescent = 0; mNeedSave = false; mMutex = Mutex::createMutex(); diff --git a/Engine/source/gfx/gFont.h b/Engine/source/gfx/gFont.h index b67d7e72f..2f5274af2 100644 --- a/Engine/source/gfx/gFont.h +++ b/Engine/source/gfx/gFont.h @@ -42,6 +42,7 @@ GFX_DeclareTextureProfile(GFXFontTextureProfile); +#define Font_Table_MAX 65536 class GFont { @@ -159,7 +160,7 @@ private: Vector mCharInfoList; /// Index remapping - S32 mRemapTable[65536]; + S32 mRemapTable[Font_Table_MAX]; }; inline U32 GFont::getCharXIncrement(const UTF16 in_charIndex) diff --git a/Engine/source/gfx/gfxAdapter.h b/Engine/source/gfx/gfxAdapter.h index a7988e910..80435618c 100644 --- a/Engine/source/gfx/gfxAdapter.h +++ b/Engine/source/gfx/gfxAdapter.h @@ -82,6 +82,7 @@ public: mShaderModel = 0.f; mIndex = 0; dMemset(&mLUID, '\0', sizeof(mLUID)); + mType = GFXAdapterType::NullDevice; } ~GFXAdapter() diff --git a/Engine/source/gfx/gfxCubemap.h b/Engine/source/gfx/gfxCubemap.h index 798251d12..b3c6eac0e 100644 --- a/Engine/source/gfx/gfxCubemap.h +++ b/Engine/source/gfx/gfxCubemap.h @@ -125,7 +125,7 @@ protected: GFXFormat mFormat; public: - + GFXCubemapArray() :mNumCubemaps(0), mSize(0), mMipMapLevels(0), mFormat(GFXFormat_FIRST) {} virtual ~GFXCubemapArray() {}; /// Initialize from an array of cubemaps virtual void init(GFXCubemapHandle *cubemaps, const U32 cubemapCount) = 0; diff --git a/Engine/source/gfx/gfxFontRenderBatcher.cpp b/Engine/source/gfx/gfxFontRenderBatcher.cpp index fd4cb11cb..4b7722b7e 100644 --- a/Engine/source/gfx/gfxFontRenderBatcher.cpp +++ b/Engine/source/gfx/gfxFontRenderBatcher.cpp @@ -25,6 +25,8 @@ FontRenderBatcher::FontRenderBatcher() : mStorage(8096) { + mFont = NULL; + mLength = 0; if (!mFontSB) { GFXStateBlockDesc f; @@ -246,4 +248,4 @@ void FontRenderBatcher::init( GFont *font, U32 n ) mFont = font; mLength = n; -} \ No newline at end of file +} diff --git a/Engine/source/gfx/gfxFormatUtils.h b/Engine/source/gfx/gfxFormatUtils.h index 9000dcf3a..4d5729f00 100644 --- a/Engine/source/gfx/gfxFormatUtils.h +++ b/Engine/source/gfx/gfxFormatUtils.h @@ -57,7 +57,7 @@ struct GFXFormatInfo /// If true, channels are in floating-point. bool mIsFloatingPoint; - Data() {} + Data() :mBytesPerPixel(0), mHasAlpha(false), mIsCompressed(false), mIsFloatingPoint(false) {} Data( U32 bpp, bool hasAlpha = false, bool isCompressed = false, bool isFP = false ) : mBytesPerPixel( bpp ), mHasAlpha( hasAlpha ), diff --git a/Engine/source/gfx/gfxStructs.h b/Engine/source/gfx/gfxStructs.h index 3f2602331..65d0781bb 100644 --- a/Engine/source/gfx/gfxStructs.h +++ b/Engine/source/gfx/gfxStructs.h @@ -159,7 +159,12 @@ struct GFXPrimitive GFXPrimitive() { - dMemset( this, 0, sizeof( GFXPrimitive ) ); + type = GFXPT_FIRST; + startVertex = 0; + minIndex = 0; + startIndex = 0; + numPrimitives = 0; + numVertices = 0; } }; diff --git a/Engine/source/gfx/gfxVertexBuffer.h b/Engine/source/gfx/gfxVertexBuffer.h index 329d0cf72..b37769ad5 100644 --- a/Engine/source/gfx/gfxVertexBuffer.h +++ b/Engine/source/gfx/gfxVertexBuffer.h @@ -68,6 +68,10 @@ public: mVertexSize( vertexSize ), mBufferType( bufferType ), mDevice( device ), + isLocked(false), + lockedVertexStart(0), + lockedVertexEnd(0), + lockedVertexPtr(NULL), mVolatileStart( 0 ) { if ( vertexFormat ) diff --git a/Engine/source/gfx/gfxVertexFormat.cpp b/Engine/source/gfx/gfxVertexFormat.cpp index 943813d3c..bafd56da4 100644 --- a/Engine/source/gfx/gfxVertexFormat.cpp +++ b/Engine/source/gfx/gfxVertexFormat.cpp @@ -77,6 +77,7 @@ GFXVertexFormat::GFXVertexFormat() mHasColor( false ), mHasTangent( false ), mHasInstancing( false ), + mHasBlendIndices(false), mTexCoordCount( 0 ), mSizeInBytes( 0 ), mDecl( NULL ) diff --git a/Engine/source/gfx/gl/gfxGLCircularVolatileBuffer.h b/Engine/source/gfx/gl/gfxGLCircularVolatileBuffer.h index a3d2cb1dd..6abeaf8e4 100644 --- a/Engine/source/gfx/gl/gfxGLCircularVolatileBuffer.h +++ b/Engine/source/gfx/gl/gfxGLCircularVolatileBuffer.h @@ -174,7 +174,8 @@ public: struct { - U32 mOffset, mSize; + U32 mOffset = 0; + U32 mSize = 0; }_getBufferData; void lock(const U32 size, U32 offsetAlign, U32 &outOffset, void* &outPtr) diff --git a/Engine/source/gfx/gl/gfxGLCubemap.cpp b/Engine/source/gfx/gl/gfxGLCubemap.cpp index 40bf88f91..541cd4fc7 100644 --- a/Engine/source/gfx/gl/gfxGLCubemap.cpp +++ b/Engine/source/gfx/gl/gfxGLCubemap.cpp @@ -41,6 +41,8 @@ static GLenum faceList[6] = GFXGLCubemap::GFXGLCubemap() : mCubemap(0), mDynamicTexSize(0), + mWidth(0), + mHeight(0), mFaceFormat( GFXFormatR8G8B8A8 ) { for(U32 i = 0; i < 6; i++) @@ -313,6 +315,7 @@ U8* GFXGLCubemap::getTextureData(U32 face, U32 mip) GFXGLCubemapArray::GFXGLCubemapArray() { + mCubemap = NULL; } GFXGLCubemapArray::~GFXGLCubemapArray() diff --git a/Engine/source/gfx/gl/gfxGLDevice.cpp b/Engine/source/gfx/gl/gfxGLDevice.cpp index 9c09d324f..0b1932f6e 100644 --- a/Engine/source/gfx/gl/gfxGLDevice.cpp +++ b/Engine/source/gfx/gl/gfxGLDevice.cpp @@ -235,6 +235,7 @@ GFXGLDevice::GFXGLDevice(U32 adapterIndex) : mActiveTextureType[i] = GL_ZERO; mNumVertexStream = 2; + mSupportsAnisotropic = false; for(int i = 0; i < GS_COUNT; ++i) mModelViewProjSC[i] = NULL; diff --git a/Engine/source/gfx/gl/gfxGLDeviceProfiler.cpp b/Engine/source/gfx/gl/gfxGLDeviceProfiler.cpp index 423fbcc6c..d12ddb923 100644 --- a/Engine/source/gfx/gl/gfxGLDeviceProfiler.cpp +++ b/Engine/source/gfx/gl/gfxGLDeviceProfiler.cpp @@ -53,7 +53,7 @@ public: typedef Data DataType; - GLTimer(GFXDevice *device, Data &data) : mData(&data) + GLTimer(GFXDevice *device, Data &data) : mName(NULL), mData(&data) { glGenQueries(1, &mQueryId); } diff --git a/Engine/source/gfx/gl/gfxGLPrimitiveBuffer.cpp b/Engine/source/gfx/gl/gfxGLPrimitiveBuffer.cpp index 3df694de9..1c1b81171 100644 --- a/Engine/source/gfx/gl/gfxGLPrimitiveBuffer.cpp +++ b/Engine/source/gfx/gl/gfxGLPrimitiveBuffer.cpp @@ -38,7 +38,9 @@ GLCircularVolatileBuffer* getCircularVolatileIndexBuffer() GFXGLPrimitiveBuffer::GFXGLPrimitiveBuffer(GFXDevice *device, U32 indexCount, U32 primitiveCount, GFXBufferType bufferType) : GFXPrimitiveBuffer(device, indexCount, primitiveCount, bufferType), mBufferOffset(0), - mZombieCache(NULL) + mZombieCache(NULL), + lockedIndexEnd(0), + lockedIndexStart(0) { if( mBufferType == GFXBufferTypeVolatile ) { @@ -185,4 +187,4 @@ MODULE_BEGIN( GFX_GL_PrimitiveBuffer ) { GFXDevice::getDeviceEventSignal( ).remove( &onGFXDeviceSignal ); } -MODULE_END \ No newline at end of file +MODULE_END diff --git a/Engine/source/gfx/gl/gfxGLShader.cpp b/Engine/source/gfx/gl/gfxGLShader.cpp index 267924163..5d9d4d380 100644 --- a/Engine/source/gfx/gl/gfxGLShader.cpp +++ b/Engine/source/gfx/gl/gfxGLShader.cpp @@ -69,6 +69,7 @@ public: GFXGLShaderConstHandle::GFXGLShaderConstHandle( GFXGLShader *shader ) : mShader( shader ), mLocation(0), mOffset(0), mSize(0), mSamplerNum(-1), mInstancingConstant(false) { + dMemset(&mDesc, 0, sizeof(mDesc)); mValid = false; } diff --git a/Engine/source/gfx/gl/gfxGLTextureObject.cpp b/Engine/source/gfx/gl/gfxGLTextureObject.cpp index e326664b3..a7bc1d4f7 100644 --- a/Engine/source/gfx/gl/gfxGLTextureObject.cpp +++ b/Engine/source/gfx/gl/gfxGLTextureObject.cpp @@ -33,15 +33,24 @@ GFXGLTextureObject::GFXGLTextureObject(GFXDevice * aDevice, GFXTextureProfile *profile) : GFXTextureObject(aDevice, profile), + mIsNPoT2(false), mBinding(GL_TEXTURE_2D), mBytesPerTexel(4), mLockedRectRect(0, 0, 0, 0), mGLDevice(static_cast(mDevice)), + mIsZombie(false), mZombieCache(NULL), mNeedInitSamplerState(true), mFrameAllocatorMark(0), mFrameAllocatorPtr(NULL) { + +#if TORQUE_DEBUG + mFrameAllocatorMarkGuard == FrameAllocator::getWaterMark(); +#endif + + dMemset(&mLockedRect, 0, sizeof(mLockedRect)); + AssertFatal(dynamic_cast(mDevice), "GFXGLTextureObject::GFXGLTextureObject - Invalid device type, expected GFXGLDevice!"); glGenTextures(1, &mHandle); glGenBuffers(1, &mBuffer); diff --git a/Engine/source/gfx/gl/gfxGLVertexDecl.h b/Engine/source/gfx/gl/gfxGLVertexDecl.h index 545694323..dd80dd852 100644 --- a/Engine/source/gfx/gl/gfxGLVertexDecl.h +++ b/Engine/source/gfx/gl/gfxGLVertexDecl.h @@ -7,7 +7,7 @@ class GFXGLDevice; class GFXGLVertexDecl : public GFXVertexDecl { public: - GFXGLVertexDecl() : mFormat(NULL), mVertexAttribActiveMask(0) {} + GFXGLVertexDecl() : mFormat(NULL), mVertexAttribActiveMask(0) { std::fill_n(mVertexSize, 4, 0); } void init(const GFXVertexFormat *format); void prepareVertexFormat() const; @@ -36,4 +36,4 @@ protected: void _initVerticesFormat2(); }; -#endif //GFX_GL_VERTEX_DECL \ No newline at end of file +#endif //GFX_GL_VERTEX_DECL diff --git a/Engine/source/gfx/video/theoraTexture.cpp b/Engine/source/gfx/video/theoraTexture.cpp index 4ac7bb41e..1b85837b7 100644 --- a/Engine/source/gfx/video/theoraTexture.cpp +++ b/Engine/source/gfx/video/theoraTexture.cpp @@ -278,7 +278,9 @@ bool TheoraTexture::AsyncState::isAtEnd() TheoraTexture::TheoraTexture() : mCurrentFrame( NULL ), mPlaybackQueue( NULL ), - mIsPaused( true ) + mIsPaused( true ), + mLastFrameNumber(0), + mNumDroppedFrames(0) { GFXTextureManager::addEventDelegate( this, &TheoraTexture::_onTextureEvent ); } diff --git a/Engine/source/gfx/video/videoCapture.cpp b/Engine/source/gfx/video/videoCapture.cpp index c147cf8ae..101f784e3 100644 --- a/Engine/source/gfx/video/videoCapture.cpp +++ b/Engine/source/gfx/video/videoCapture.cpp @@ -52,12 +52,16 @@ MODULE_BEGIN( VideoCapture ) MODULE_END; -VideoCapture::VideoCapture() : +VideoCapture::VideoCapture() : + mCapturedFramePos(-1.0f), mEncoder(NULL), mFrameGrabber(NULL), mCanvas(NULL), mIsRecording(false), + mVideoCaptureStartTime(0), + mNextFramePosition(0.0f), mFrameRate(30.0f), + mMsPerFrame(1000.0f / mFrameRate), mResolution(0,0), mWaitingForCanvas(false), mEncoderName("THEORA"), diff --git a/Engine/source/gfx/video/videoCapture.h b/Engine/source/gfx/video/videoCapture.h index 7f46b133f..ca3598067 100644 --- a/Engine/source/gfx/video/videoCapture.h +++ b/Engine/source/gfx/video/videoCapture.h @@ -126,12 +126,12 @@ private: /// Frame to be captured next F32 mNextFramePosition; - /// The per-frame time (in milliseconds) - F32 mMsPerFrame; - /// The framerate we'll use to record F32 mFrameRate; + /// The per-frame time (in milliseconds) + F32 mMsPerFrame; + /// Accumulated error when converting the per-frame-time to integer /// this is used to dither the value and keep overall time advancing /// correct diff --git a/Engine/source/gfx/video/videoEncoderTheora.cpp b/Engine/source/gfx/video/videoEncoderTheora.cpp index f3c1e4674..d64f76487 100644 --- a/Engine/source/gfx/video/videoEncoderTheora.cpp +++ b/Engine/source/gfx/video/videoEncoderTheora.cpp @@ -195,6 +195,11 @@ public: VideoEncoderTheora() : mCurrentFrame(0), td(NULL), mLastFrame(NULL) { + dMemset(&to, 0, sizeof(to)); + dMemset(&ti, 0, sizeof(ti)); + dMemset(&tc, 0, sizeof(tc)); + dMemset(&mBuffer, 0, sizeof(mBuffer)); + setStatus(false); } @@ -458,4 +463,4 @@ public: REGISTER_VIDEO_ENCODER(VideoEncoderTheora, THEORA) -#endif \ No newline at end of file +#endif