VOID Create -> void Create

SetLoopOn/Off -> SetLooping(bool)

CTextureRenderer throws its own exception
This commit is contained in:
Glenn Maynard
2002-08-23 01:55:38 +00:00
parent 5111876b0d
commit 4d1a9e1d68
4 changed files with 10 additions and 34 deletions
+7 -21
View File
@@ -40,7 +40,6 @@ struct __declspec(uuid("{71771540-2017-11cf-ae26-0020afd79767}")) CLSID_TextureR
#include "RageLog.h"
#include "RageException.h"
#include <stdio.h>
//-----------------------------------------------------------------------------
@@ -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<IBaseFilter> 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);
+2 -3
View File
@@ -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();
-8
View File
@@ -111,11 +111,3 @@ void RageTexture::GetFrameDimensionsFromFileName( CString sPath, int* piFramesWi
}
}
void RageTexture::TurnLoopOn()
{
}
void RageTexture::TurnLoopOff()
{
}
+1 -2
View File
@@ -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;};