diff --git a/stepmania/src/RageMovieTexture.cpp b/stepmania/src/RageMovieTexture.cpp index 1bce0f5d1b..ed5ac5ddcd 100644 --- a/stepmania/src/RageMovieTexture.cpp +++ b/stepmania/src/RageMovieTexture.cpp @@ -40,7 +40,6 @@ struct __declspec(uuid("{71771540-2017-11cf-ae26-0020afd79767}")) CLSID_TextureR #include "RageLog.h" #include "RageException.h" - #include //----------------------------------------------------------------------------- @@ -65,8 +64,8 @@ public: HRESULT DoRenderSample(IMediaSample *pMediaSample); // New video sample // new methods - LONG GetVidWidth() {return m_lVidWidth;}; - LONG GetVidHeight(){return m_lVidHeight;}; + LONG GetVidWidth() const { return m_lVidWidth; } + LONG GetVidHeight() const { return m_lVidHeight; } HRESULT SetRenderTarget( RageMovieTexture* pTexture ); protected: @@ -89,6 +88,9 @@ CTextureRenderer::CTextureRenderer( LPUNKNOWN pUnk, HRESULT *phr ) : CBaseVideoRenderer(__uuidof(CLSID_TextureRenderer), NAME("Texture Renderer"), pUnk, phr) { + if( FAILED(*phr) ) + throw RageException( *phr, "Could not create texture renderer object!" ); + // Store and ARageef the texture for our use. m_pTexture = NULL; m_bBackBufferLocked = FALSE; @@ -137,8 +139,6 @@ HRESULT CTextureRenderer::CheckMediaType(const CMediaType *pmt) //----------------------------------------------------------------------------- HRESULT CTextureRenderer::SetMediaType(const CMediaType *pmt) { -// HRESULT hr; - // Retrive the size of this media type VIDEOINFO *pviBmp; // Bitmap info header pviBmp = (VIDEOINFO *)pmt->Format(); @@ -146,7 +146,6 @@ HRESULT CTextureRenderer::SetMediaType(const CMediaType *pmt) m_lVidHeight = abs(pviBmp->bmiHeader.biHeight); m_lVidPitch = (m_lVidWidth * 3 + 3) & ~(3); // We are forcing RGB24 - return S_OK; } @@ -345,7 +344,7 @@ LPDIRECT3DTEXTURE8 RageMovieTexture::GetD3DTexture() //----------------------------------------------------------------------------- // RageMovieTexture::Create() //----------------------------------------------------------------------------- -VOID RageMovieTexture::Create() +void RageMovieTexture::Create() { HRESULT hr; @@ -396,8 +395,6 @@ HRESULT RageMovieTexture::InitDShowTextureRenderer() // Create the Texture Renderer object m_pCTR = new CTextureRenderer(NULL, &hr); - if( FAILED(hr) ) - throw RageException( hr, "Could not create texture renderer object!" ); // Get a pointer to the IBaseFilter on the TextureRenderer, add it to graph CComPtr pFTR = m_pCTR; @@ -450,7 +447,6 @@ HRESULT RageMovieTexture::InitDShowTextureRenderer() m_iImageWidth = m_iSourceWidth; m_iImageHeight = m_iSourceHeight; - return S_OK; } @@ -512,7 +508,7 @@ void RageMovieTexture::CheckMovieStatus() // Check for completion events m_pME->GetEvent( &lEventCode, &lParam1, &lParam2, 0 ); - if( EC_COMPLETE == lEventCode && m_bLoop ) + if( EC_COMPLETE == lEventCode && m_bLoop ) m_pMP->put_CurrentPosition(0); } @@ -547,16 +543,6 @@ void RageMovieTexture::Stop() throw RageException( hr, "Could not stop the DirectShow graph." ); } -void RageMovieTexture::TurnLoopOn() -{ - m_bLoop = true; -} - -void RageMovieTexture::TurnLoopOff() -{ - m_bLoop = false; -} - void RageMovieTexture::SetPosition( float fSeconds ) { m_pMP->put_CurrentPosition(0); diff --git a/stepmania/src/RageMovieTexture.h b/stepmania/src/RageMovieTexture.h index e8cdeb351b..0b6900f927 100644 --- a/stepmania/src/RageMovieTexture.h +++ b/stepmania/src/RageMovieTexture.h @@ -53,8 +53,7 @@ public: virtual void Stop(); virtual void SetPosition( float fSeconds ); virtual bool IsAMovie() { return true; }; - virtual void TurnLoopOn(); - virtual void TurnLoopOff(); + void SetLooping(bool looping=true) { m_bLoop = looping; } LPDIRECT3DTEXTURE8 GetBackBuffer() { return m_pd3dTexture[!m_iIndexFrontBuffer]; } void Flip() { m_iIndexFrontBuffer = !m_iIndexFrontBuffer; } @@ -63,7 +62,7 @@ protected: LPDIRECT3DTEXTURE8 m_pd3dTexture[2]; // double buffered int m_iIndexFrontBuffer; // index of the buffer that should be rendered from - either 0 or 1 - virtual VOID Create(); + virtual void Create(); virtual HRESULT CreateD3DTexture(); virtual HRESULT InitDShowTextureRenderer(); diff --git a/stepmania/src/RageTexture.cpp b/stepmania/src/RageTexture.cpp index cd753a763a..788c401128 100644 --- a/stepmania/src/RageTexture.cpp +++ b/stepmania/src/RageTexture.cpp @@ -111,11 +111,3 @@ void RageTexture::GetFrameDimensionsFromFileName( CString sPath, int* piFramesWi } } - -void RageTexture::TurnLoopOn() -{ -} - -void RageTexture::TurnLoopOff() -{ -} diff --git a/stepmania/src/RageTexture.h b/stepmania/src/RageTexture.h index e047df74b4..257333d377 100644 --- a/stepmania/src/RageTexture.h +++ b/stepmania/src/RageTexture.h @@ -64,8 +64,7 @@ public: virtual void Pause() {}; virtual void SetPosition( float fSeconds ) {}; virtual bool IsAMovie() { return false; }; - virtual void TurnLoopOn(); - virtual void TurnLoopOff(); + void SetLooping(bool looping=true) { } int GetSourceWidth() {return m_iSourceWidth;}; int GetSourceHeight() {return m_iSourceHeight;};