From d868c7a5d65ac43567e13eb45c0eba0a425d24fa Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Tue, 21 May 2013 15:31:41 -0700 Subject: [PATCH] Hack to fix movie crasher A movie larger than the max texture size would be rendered - at its original size - onto a smaller texture, causing an access violation. This just ignores the max texture size for movies. Two better solutions: 1. Resize the movie to the texture size. Ideal, but slow in my experiments. 2. Don't load the movie texture at all in this case. A possibility in the future, but will require some refactoring first. --- src/arch/MovieTexture/MovieTexture_Generic.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/arch/MovieTexture/MovieTexture_Generic.cpp b/src/arch/MovieTexture/MovieTexture_Generic.cpp index 05909a0740..be164bba1e 100644 --- a/src/arch/MovieTexture/MovieTexture_Generic.cpp +++ b/src/arch/MovieTexture/MovieTexture_Generic.cpp @@ -197,10 +197,11 @@ void MovieTexture_Generic::CreateTexture() else if( fSourceAspectRatio > 1 ) m_iSourceWidth = lrintf( m_iSourceWidth * fSourceAspectRatio ); - /* Cap the max texture size to the hardware max. */ - int iMaxSize = min( GetID().iMaxSize, DISPLAY->GetMaxTextureSize() ); - m_iImageWidth = min( m_iSourceWidth, iMaxSize ); - m_iImageHeight = min( m_iSourceHeight, iMaxSize ); + /* HACK: Don't cap movie textures to the max texture size, since we + * render them onto the texture at the source dimensions. If we find a + * fast way to resize movies, we can change this back. */ + m_iImageWidth = m_iSourceWidth; + m_iImageHeight = m_iSourceHeight; /* Texture dimensions need to be a power of two; jump to the next. */ m_iTextureWidth = power_of_two( m_iImageWidth );