From b984fe493d9f7ac84a35af3e6f80f16607aceb09 Mon Sep 17 00:00:00 2001 From: poco0317 Date: Mon, 15 Oct 2018 23:12:30 -0500 Subject: [PATCH] Fix consistent crashing on 64 bit d3d Cause: 64 bit pointer arithmetic. We assumed unsigned ints are 32 bits, while pointers are as well. In 64 bit, unsigned ints are still 32 bits but pointers are 64 bits. Converting between the two truncates half the data. This breaks pointers. --- src/ImageCache.cpp | 4 +-- src/RageBitmapTexture.h | 4 +-- src/RageDisplay.h | 16 +++++----- src/RageDisplay_D3D.cpp | 32 +++++++++---------- src/RageDisplay_D3D.h | 16 +++++----- src/RageDisplay_Null.h | 8 ++--- src/RageDisplay_OGL.cpp | 26 +++++++-------- src/RageDisplay_OGL.h | 16 +++++----- src/RageTexture.h | 2 +- src/RageTextureManager.cpp | 4 +-- src/RageTextureRenderTarget.h | 6 ++-- .../MovieTexture/MovieTexture_Generic.cpp | 6 ++-- src/arch/MovieTexture/MovieTexture_Generic.h | 4 +-- src/arch/MovieTexture/MovieTexture_Null.cpp | 4 +-- 14 files changed, 74 insertions(+), 74 deletions(-) diff --git a/src/ImageCache.cpp b/src/ImageCache.cpp index fde2129c62..996053e16a 100644 --- a/src/ImageCache.cpp +++ b/src/ImageCache.cpp @@ -217,8 +217,8 @@ ImageCache::ReadFromDisk() struct ImageTexture : public RageTexture { - unsigned m_uTexHandle; - unsigned GetTexHandle() const override + intptr_t m_uTexHandle; + intptr_t GetTexHandle() const override { return m_uTexHandle; }; // accessed by RageDisplay diff --git a/src/RageBitmapTexture.h b/src/RageBitmapTexture.h index 2936efa3c1..85511f563a 100644 --- a/src/RageBitmapTexture.h +++ b/src/RageBitmapTexture.h @@ -13,7 +13,7 @@ class RageBitmapTexture : public RageTexture /* only called by RageTextureManager::InvalidateTextures */ void Invalidate() override { m_uTexHandle = 0; /* don't Destroy() */ } void Reload() override; - unsigned GetTexHandle() const override + intptr_t GetTexHandle() const override { return m_uTexHandle; }; // accessed by RageDisplay @@ -21,7 +21,7 @@ class RageBitmapTexture : public RageTexture private: void Create(); // called by constructor and Reload void Destroy(); - unsigned m_uTexHandle; // treat as unsigned in OpenGL, ID3D8Texture* for D3D + intptr_t m_uTexHandle; // treat as unsigned in OpenGL, ID3D8Texture* for D3D }; #endif diff --git a/src/RageDisplay.h b/src/RageDisplay.h index 79ecc0f552..9c03ee7942 100644 --- a/src/RageDisplay.h +++ b/src/RageDisplay.h @@ -229,23 +229,23 @@ class RageDisplay /* return 0 if failed or internal texture resource handle * (unsigned in OpenGL, texture pointer in D3D) */ - virtual unsigned CreateTexture( + virtual intptr_t CreateTexture( RagePixelFormat pixfmt, // format of img and of texture in video mem RageSurface* img, // must be in pixfmt bool bGenerateMipMaps) = 0; - virtual void UpdateTexture(unsigned iTexHandle, + virtual void UpdateTexture(intptr_t iTexHandle, RageSurface* img, int xoffset, int yoffset, int width, int height) = 0; - virtual void DeleteTexture(unsigned iTexHandle) = 0; + virtual void DeleteTexture(intptr_t iTexHandle) = 0; /* Return an object to lock pixels for streaming. If not supported, returns * NULL. Delete the object normally. */ virtual RageTextureLock* CreateTextureLock() { return nullptr; } virtual void ClearAllTextures() = 0; virtual int GetNumTextureUnits() = 0; - virtual void SetTexture(TextureUnit, unsigned /* iTexture */) = 0; + virtual void SetTexture(TextureUnit, intptr_t /* iTexture */) = 0; virtual void SetTextureMode(TextureUnit, TextureMode) = 0; virtual void SetTextureWrapping(TextureUnit, bool) = 0; virtual int GetMaxTextureSize() const = 0; @@ -263,14 +263,14 @@ class RageDisplay * DeleteTexture. (UpdateTexture is not permitted.) Returns 0 if render-to- * texture is unsupported. */ - virtual unsigned CreateRenderTarget(const RenderTargetParam&, + virtual intptr_t CreateRenderTarget(const RenderTargetParam&, int& /* iTextureWidthOut */, int& /* iTextureHeightOut */) { return 0; } - virtual unsigned GetRenderTarget() { return 0; } + virtual intptr_t GetRenderTarget() { return 0; } /* Set the render target, or 0 to resume rendering to the framebuffer. An * active render target may not be used as a texture. If bPreserveTexture is @@ -278,7 +278,7 @@ class RageDisplay * call; otherwise, cleared. If bPreserveTexture is true the first time a * render target is used, behave as if bPreserveTexture was false. */ - virtual void SetRenderTarget(unsigned /* iHandle */, + virtual void SetRenderTarget(intptr_t /* iHandle */, bool /* bPreserveTexture */ = true) { } @@ -352,7 +352,7 @@ class RageDisplay } virtual RageSurface* CreateScreenshot() = 0; // allocates a surface. Caller must delete it. - virtual RageSurface* GetTexture(unsigned /* iTexture */) + virtual RageSurface* GetTexture(intptr_t /* iTexture */) { return nullptr; } // allocates a surface. Caller must delete it. diff --git a/src/RageDisplay_D3D.cpp b/src/RageDisplay_D3D.cpp index 1f270494ec..1f0e52ad1a 100644 --- a/src/RageDisplay_D3D.cpp +++ b/src/RageDisplay_D3D.cpp @@ -57,7 +57,7 @@ IDirect3DSurface9* defaultDepthBuffer = 0; // of this application though. const D3DFORMAT g_DefaultAdapterFormat = D3DFMT_X8R8G8B8; -static map g_mapRenderTargets; +static map g_mapRenderTargets; static RenderTarget* g_pCurrentRenderTarget = NULL; static bool g_bInvertY = false; @@ -65,13 +65,13 @@ static bool g_bInvertY = false; /* Direct3D doesn't associate a palette with textures. Instead, we load a * palette into a slot. We need to keep track of which texture's palette is * stored in what slot. */ -map g_TexResourceToPaletteIndex; +map g_TexResourceToPaletteIndex; list g_PaletteIndex; struct TexturePalette { PALETTEENTRY p[256]; }; -map g_TexResourceToTexturePalette; +map g_TexResourceToTexturePalette; // Load the palette, if any, for the given texture into a palette slot, and make // it current. @@ -91,7 +91,7 @@ SetPalette(unsigned TexResource) // If any other texture is currently using this slot, mark that palette // unloaded. - for (map::iterator i = + for (map::iterator i = g_TexResourceToPaletteIndex.begin(); i != g_TexResourceToPaletteIndex.end(); ++i) { @@ -392,7 +392,7 @@ SetD3DParams(bool& bNewDeviceOut) g_pd3dDevice->SetRenderState(D3DRS_NORMALIZENORMALS, TRUE); // wipe old render targets - FOREACHM(unsigned, RenderTarget*, g_mapRenderTargets, rt) + FOREACHM(intptr_t, RenderTarget*, g_mapRenderTargets, rt) delete rt->second; g_mapRenderTargets.clear(); @@ -1211,7 +1211,7 @@ RageDisplay_D3D::GetNumTextureUnits() } void -RageDisplay_D3D::SetTexture(TextureUnit tu, unsigned iTexture) +RageDisplay_D3D::SetTexture(TextureUnit tu, intptr_t iTexture) { // g_DeviceCaps.MaxSimultaneousTextures = 1; if (tu >= (int)g_DeviceCaps.MaxSimultaneousTextures) // not supported @@ -1553,7 +1553,7 @@ RageDisplay_D3D::SetCullMode(CullMode mode) } void -RageDisplay_D3D::DeleteTexture(unsigned iTexHandle) +RageDisplay_D3D::DeleteTexture(intptr_t iTexHandle) { if (iTexHandle == 0) return; @@ -1579,7 +1579,7 @@ RageDisplay_D3D::DeleteTexture(unsigned iTexHandle) g_TexResourceToTexturePalette.find(iTexHandle)); } -unsigned +intptr_t RageDisplay_D3D::CreateTexture(RagePixelFormat pixfmt, RageSurface* img, bool bGenerateMipMaps) @@ -1602,7 +1602,7 @@ RageDisplay_D3D::CreateTexture(RagePixelFormat pixfmt, RagePixelFormatToString(pixfmt).c_str(), GetErrorString(hr).c_str()); - unsigned uTexHandle = (unsigned)pTex; + intptr_t uTexHandle = (intptr_t)pTex; if (pixfmt == RagePixelFormat_PAL) { // Save palette @@ -1627,7 +1627,7 @@ RageDisplay_D3D::CreateTexture(RagePixelFormat pixfmt, } void -RageDisplay_D3D::UpdateTexture(unsigned uTexHandle, +RageDisplay_D3D::UpdateTexture(intptr_t uTexHandle, RageSurface* img, int xoffset, int yoffset, @@ -1706,7 +1706,7 @@ class D3DRenderTarget_FramebufferObject : public RenderTarget void Create(const RenderTargetParam& param, int& iTextureWidthOut, int& iTextureHeightOut) override; - unsigned GetTexture() const override { return (unsigned)m_uTexHandle; } + intptr_t GetTexture() const override { return (intptr_t)m_uTexHandle; } void StartRenderingTo() override; void FinishRenderingTo() override; @@ -1812,7 +1812,7 @@ D3DRenderTarget_FramebufferObject::FinishRenderingTo() LOG->Warn("Failed to set targetDepth to BackBufferDepth"); } -unsigned +intptr_t RageDisplay_D3D::CreateRenderTarget(const RenderTargetParam& param, int& iTextureWidthOut, int& iTextureHeightOut) @@ -1821,7 +1821,7 @@ RageDisplay_D3D::CreateRenderTarget(const RenderTargetParam& param, pTarget->Create(param, iTextureWidthOut, iTextureHeightOut); - unsigned uTexture = pTarget->GetTexture(); + intptr_t uTexture = pTarget->GetTexture(); ASSERT(g_mapRenderTargets.find(uTexture) == g_mapRenderTargets.end()); g_mapRenderTargets[uTexture] = pTarget; @@ -1829,10 +1829,10 @@ RageDisplay_D3D::CreateRenderTarget(const RenderTargetParam& param, return uTexture; } -unsigned +intptr_t RageDisplay_D3D::GetRenderTarget() { - for (map::const_iterator it = + for (map::const_iterator it = g_mapRenderTargets.begin(); it != g_mapRenderTargets.end(); ++it) @@ -1842,7 +1842,7 @@ RageDisplay_D3D::GetRenderTarget() } void -RageDisplay_D3D::SetRenderTarget(unsigned uTexHandle, bool bPreserveTexture) +RageDisplay_D3D::SetRenderTarget(intptr_t uTexHandle, bool bPreserveTexture) { if (uTexHandle == 0) { g_pd3dDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_CCW); diff --git a/src/RageDisplay_D3D.h b/src/RageDisplay_D3D.h index e732dc1476..fae6d0fa4e 100644 --- a/src/RageDisplay_D3D.h +++ b/src/RageDisplay_D3D.h @@ -25,19 +25,19 @@ class RageDisplay_D3D : public RageDisplay bool realtime = false) override; bool SupportsThreadedRendering() override; bool SupportsPerVertexMatrixScale() override { return false; } - unsigned CreateTexture(RagePixelFormat pixfmt, + intptr_t CreateTexture(RagePixelFormat pixfmt, RageSurface* img, bool bGenerateMipMaps) override; - void UpdateTexture(unsigned iTexHandle, + void UpdateTexture(intptr_t iTexHandle, RageSurface* img, int xoffset, int yoffset, int width, int height) override; - void DeleteTexture(unsigned iTexHandle) override; + void DeleteTexture(intptr_t iTexHandle) override; void ClearAllTextures() override; int GetNumTextureUnits() override; - void SetTexture(TextureUnit tu, unsigned iTexture) override; + void SetTexture(TextureUnit tu, intptr_t iTexture) override; void SetTextureMode(TextureUnit tu, TextureMode tm) override; void SetTextureWrapping(TextureUnit tu, bool b) override; int GetMaxTextureSize() const override; @@ -63,11 +63,11 @@ class RageDisplay_D3D : public RageDisplay const RageColor& specular, const RageVector3& dir) override; - unsigned CreateRenderTarget(const RenderTargetParam& param, + intptr_t CreateRenderTarget(const RenderTargetParam& param, int& iTextureWidthOut, int& iTextureHeightOut) override; - unsigned GetRenderTarget() override; - void SetRenderTarget(unsigned uTexHandle, bool bPreserveTexture) override; + intptr_t GetRenderTarget() override; + void SetRenderTarget(intptr_t uTexHandle, bool bPreserveTexture) override; void SetSphereEnvironmentMapping(TextureUnit tu, bool b) override; void SetCelShaded(int stage) override; @@ -113,7 +113,7 @@ class RenderTarget int& iTextureWidthOut, int& iTextureHeightOut) = 0; - virtual unsigned GetTexture() const = 0; + virtual intptr_t GetTexture() const = 0; /* Render to this RenderTarget. */ virtual void StartRenderingTo() = 0; diff --git a/src/RageDisplay_Null.h b/src/RageDisplay_Null.h index 4381628fa0..91c72575a3 100644 --- a/src/RageDisplay_Null.h +++ b/src/RageDisplay_Null.h @@ -28,13 +28,13 @@ class RageDisplay_Null : public RageDisplay return true; } bool SupportsPerVertexMatrixScale() override { return false; } - unsigned CreateTexture(RagePixelFormat, + intptr_t CreateTexture(RagePixelFormat, RageSurface* /* img */, bool /* bGenerateMipMaps */) override { return 1; } - void UpdateTexture(unsigned /* iTexHandle */, + void UpdateTexture(intptr_t /* iTexHandle */, RageSurface* /* img */, int /* xoffset */, int /* yoffset */, @@ -43,10 +43,10 @@ class RageDisplay_Null : public RageDisplay ) override { } - void DeleteTexture(unsigned /* iTexHandle */) override {} + void DeleteTexture(intptr_t /* iTexHandle */) override {} void ClearAllTextures() override {} int GetNumTextureUnits() override { return 1; } - void SetTexture(TextureUnit, unsigned /* iTexture */) override {} + void SetTexture(TextureUnit, intptr_t /* iTexture */) override {} void SetTextureMode(TextureUnit, TextureMode) override {} void SetTextureWrapping(TextureUnit, bool) override {} int GetMaxTextureSize() const override { return 2048; } diff --git a/src/RageDisplay_OGL.cpp b/src/RageDisplay_OGL.cpp index 7dcc843515..d0b42ce892 100644 --- a/src/RageDisplay_OGL.cpp +++ b/src/RageDisplay_OGL.cpp @@ -61,7 +61,7 @@ static int g_iMaxTextureUnits = 0; /* If we support texture matrix scaling, a handle to the vertex program: */ static GLhandleARB g_bTextureMatrixShader = 0; -static map g_mapRenderTargets; +static map g_mapRenderTargets; static RenderTarget* g_pCurrentRenderTarget = NULL; static LowLevelWindow* g_pWind; @@ -792,7 +792,7 @@ RageDisplay_Legacy::TryVideoMode(const VideoModeParams& p, bool& bNewDeviceOut) /* Delete all render targets. They may have associated resources other * than the texture itself. */ - FOREACHM(unsigned, RenderTarget*, g_mapRenderTargets, rt) + FOREACHM(intptr_t, RenderTarget*, g_mapRenderTargets, rt) delete rt->second; g_mapRenderTargets.clear(); @@ -892,7 +892,7 @@ RageDisplay_Legacy::CreateScreenshot() } RageSurface* -RageDisplay_Legacy::GetTexture(unsigned iTexture) +RageDisplay_Legacy::GetTexture(intptr_t iTexture) { if (iTexture == 0) return NULL; // XXX @@ -1663,7 +1663,7 @@ RageDisplay_Legacy::GetNumTextureUnits() } void -RageDisplay_Legacy::SetTexture(TextureUnit tu, unsigned iTexture) +RageDisplay_Legacy::SetTexture(TextureUnit tu, intptr_t iTexture) { if (!SetTextureUnit(tu)) return; @@ -2118,7 +2118,7 @@ RageDisplay_Legacy::EndConcurrentRendering() } void -RageDisplay_Legacy::DeleteTexture(unsigned iTexture) +RageDisplay_Legacy::DeleteTexture(intptr_t iTexture) { if (iTexture == 0) return; @@ -2215,7 +2215,7 @@ SetPixelMapForSurface(int glImageFormat, DebugAssertNoGLError(); } -unsigned +intptr_t RageDisplay_Legacy::CreateTexture(RagePixelFormat pixfmt, RageSurface* pImg, bool bGenerateMipMaps) @@ -2261,7 +2261,7 @@ RageDisplay_Legacy::CreateTexture(RagePixelFormat pixfmt, SetTextureUnit(TextureUnit_1); // allocate OpenGL texture resource - unsigned int iTexHandle; + intptr_t iTexHandle; glGenTextures(1, reinterpret_cast(&iTexHandle)); ASSERT(iTexHandle != 0); @@ -2449,7 +2449,7 @@ RageDisplay_Legacy::CreateTextureLock() } void -RageDisplay_Legacy::UpdateTexture(unsigned iTexHandle, +RageDisplay_Legacy::UpdateTexture(intptr_t iTexHandle, RageSurface* pImg, int iXOffset, int iYOffset, @@ -2665,7 +2665,7 @@ RageDisplay_Legacy::SupportsRenderToTexture() const * faster when available. */ -unsigned +intptr_t RageDisplay_Legacy::CreateRenderTarget(const RenderTargetParam& param, int& iTextureWidthOut, int& iTextureHeightOut) @@ -2678,17 +2678,17 @@ RageDisplay_Legacy::CreateRenderTarget(const RenderTargetParam& param, pTarget->Create(param, iTextureWidthOut, iTextureHeightOut); - unsigned iTexture = pTarget->GetTexture(); + intptr_t iTexture = pTarget->GetTexture(); ASSERT(g_mapRenderTargets.find(iTexture) == g_mapRenderTargets.end()); g_mapRenderTargets[iTexture] = pTarget; return iTexture; } -unsigned +intptr_t RageDisplay_Legacy::GetRenderTarget() { - for (map::const_iterator it = + for (map::const_iterator it = g_mapRenderTargets.begin(); it != g_mapRenderTargets.end(); ++it) @@ -2698,7 +2698,7 @@ RageDisplay_Legacy::GetRenderTarget() } void -RageDisplay_Legacy::SetRenderTarget(unsigned iTexture, bool bPreserveTexture) +RageDisplay_Legacy::SetRenderTarget(intptr_t iTexture, bool bPreserveTexture) { if (iTexture == 0) { g_bInvertY = false; diff --git a/src/RageDisplay_OGL.h b/src/RageDisplay_OGL.h index 80bdc55927..0093ed1bd4 100644 --- a/src/RageDisplay_OGL.h +++ b/src/RageDisplay_OGL.h @@ -56,22 +56,22 @@ class RageDisplay_Legacy : public RageDisplay bool SupportsTextureFormat(RagePixelFormat pixfmt, bool realtime = false) override; bool SupportsPerVertexMatrixScale() override; - unsigned CreateTexture(RagePixelFormat pixfmt, + intptr_t CreateTexture(RagePixelFormat pixfmt, RageSurface* img, bool bGenerateMipMaps) override; - void UpdateTexture(unsigned iTexHandle, + void UpdateTexture(intptr_t iTexHandle, RageSurface* img, int xoffset, int yoffset, int width, int height) override; - void DeleteTexture(unsigned iTexHandle) override; - RageSurface* GetTexture(unsigned iTexture) override; + void DeleteTexture(intptr_t iTexHandle) override; + RageSurface* GetTexture(intptr_t iTexture) override; RageTextureLock* CreateTextureLock() override; void ClearAllTextures() override; int GetNumTextureUnits() override; - void SetTexture(TextureUnit tu, unsigned iTexture) override; + void SetTexture(TextureUnit tu, intptr_t iTexture) override; void SetTextureMode(TextureUnit tu, TextureMode tm) override; void SetTextureWrapping(TextureUnit tu, bool b) override; int GetMaxTextureSize() const override; @@ -79,11 +79,11 @@ class RageDisplay_Legacy : public RageDisplay void SetEffectMode(EffectMode effect) override; bool IsEffectModeSupported(EffectMode effect) override; bool SupportsRenderToTexture() const; - unsigned CreateRenderTarget(const RenderTargetParam& param, + intptr_t CreateRenderTarget(const RenderTargetParam& param, int& iTextureWidthOut, int& iTextureHeightOut) override; - unsigned GetRenderTarget() override; - void SetRenderTarget(unsigned iHandle, bool bPreserveTexture) override; + intptr_t GetRenderTarget() override; + void SetRenderTarget(intptr_t iHandle, bool bPreserveTexture) override; bool IsZWriteEnabled() const override; bool IsZTestEnabled() const override; void SetZWrite(bool b) override; diff --git a/src/RageTexture.h b/src/RageTexture.h index cf26aee87d..47545ad9d9 100644 --- a/src/RageTexture.h +++ b/src/RageTexture.h @@ -17,7 +17,7 @@ class RageTexture virtual void Reload() {} virtual void Invalidate() { } /* only called by RageTextureManager::InvalidateTextures */ - virtual unsigned GetTexHandle() const = 0; // accessed by RageDisplay + virtual intptr_t GetTexHandle() const = 0; // accessed by RageDisplay // movie texture/animated texture stuff virtual void SetPosition(float /* fSeconds */) {} // seek diff --git a/src/RageTextureManager.cpp b/src/RageTextureManager.cpp index 3386e81f84..a7f7f14475 100644 --- a/src/RageTextureManager.cpp +++ b/src/RageTextureManager.cpp @@ -155,10 +155,10 @@ class RageTexture_Default : public RageTexture m_iImageWidth = m_iImageHeight = 1; CreateFrameRects(); } - unsigned GetTexHandle() const override { return m_uTexHandle; } + intptr_t GetTexHandle() const override { return m_uTexHandle; } private: - unsigned m_uTexHandle{ 0 }; + intptr_t m_uTexHandle{ 0 }; }; // Load and unload textures from disk. diff --git a/src/RageTextureRenderTarget.h b/src/RageTextureRenderTarget.h index 9a804f7f00..c807a119e9 100644 --- a/src/RageTextureRenderTarget.h +++ b/src/RageTextureRenderTarget.h @@ -16,7 +16,7 @@ class RageTextureRenderTarget : public RageTexture ~RageTextureRenderTarget() override; void Invalidate() override { m_iTexHandle = 0; /* don't Destroy() */ } void Reload() override; - unsigned GetTexHandle() const override { return m_iTexHandle; } + intptr_t GetTexHandle() const override { return m_iTexHandle; } void BeginRenderingTo(bool bPreserveTexture = true); void FinishRenderingTo(); @@ -28,8 +28,8 @@ class RageTextureRenderTarget : public RageTexture void Create(); void Destroy(); - unsigned m_iTexHandle; - unsigned m_iPreviousRenderTarget; + intptr_t m_iTexHandle; + intptr_t m_iPreviousRenderTarget; }; #endif diff --git a/src/arch/MovieTexture/MovieTexture_Generic.cpp b/src/arch/MovieTexture/MovieTexture_Generic.cpp index e30144e8d1..88edd249b7 100644 --- a/src/arch/MovieTexture/MovieTexture_Generic.cpp +++ b/src/arch/MovieTexture/MovieTexture_Generic.cpp @@ -161,7 +161,7 @@ class RageMovieTexture_Generic_Intermediate : public RageTexture virtual void Invalidate() { m_uTexHandle = 0; } virtual void Reload() {} - virtual unsigned GetTexHandle() const { return m_uTexHandle; } + virtual intptr_t GetTexHandle() const { return m_uTexHandle; } bool IsAMovie() const { return true; } @@ -185,7 +185,7 @@ class RageMovieTexture_Generic_Intermediate : public RageTexture delete pSurface; } - unsigned m_uTexHandle; + intptr_t m_uTexHandle; RageSurfaceFormat m_SurfaceFormat; RagePixelFormat m_PixFmt; }; @@ -539,7 +539,7 @@ MovieTexture_Generic::SetPosition(float fSeconds) m_bWantRewind = true; } -unsigned +intptr_t MovieTexture_Generic::GetTexHandle() const { if (m_pRenderTarget != NULL) diff --git a/src/arch/MovieTexture/MovieTexture_Generic.h b/src/arch/MovieTexture/MovieTexture_Generic.h index f7c660bfc7..0b3e06445b 100644 --- a/src/arch/MovieTexture/MovieTexture_Generic.h +++ b/src/arch/MovieTexture/MovieTexture_Generic.h @@ -95,7 +95,7 @@ class MovieTexture_Generic : public RageMovieTexture virtual void DecodeSeconds(float fSeconds); virtual void SetPlaybackRate(float fRate) { m_fRate = fRate; } void SetLooping(bool bLooping = true) { m_bLoop = bLooping; } - unsigned GetTexHandle() const; + intptr_t GetTexHandle() const; static EffectMode GetEffectMode(MovieDecoderPixelFormatYCbCr fmt); @@ -111,7 +111,7 @@ class MovieTexture_Generic : public RageMovieTexture bool m_bLoop; bool m_bWantRewind; - unsigned m_uTexHandle; + intptr_t m_uTexHandle; RageTextureRenderTarget* m_pRenderTarget; RageTexture* m_pTextureIntermediate; Sprite* m_pSprite; diff --git a/src/arch/MovieTexture/MovieTexture_Null.cpp b/src/arch/MovieTexture/MovieTexture_Null.cpp index 377f6a441a..168157d39f 100644 --- a/src/arch/MovieTexture/MovieTexture_Null.cpp +++ b/src/arch/MovieTexture/MovieTexture_Null.cpp @@ -12,7 +12,7 @@ class MovieTexture_Null : public RageMovieTexture MovieTexture_Null(RageTextureID ID); virtual ~MovieTexture_Null(); void Invalidate() { texHandle = 0; } - unsigned GetTexHandle() const { return texHandle; } + intptr_t GetTexHandle() const { return texHandle; } void Update(float /* delta */) {} void Reload() {} void SetPosition(float /* seconds */) {} @@ -21,7 +21,7 @@ class MovieTexture_Null : public RageMovieTexture private: bool loop; - unsigned texHandle; + intptr_t texHandle; }; MovieTexture_Null::MovieTexture_Null(RageTextureID ID)