Permalink
Browse files

Render3D: Make _textureList universal for all 3D renderers.

  • Loading branch information...
1 parent 1368b2d commit 8821e7b162fca542922137c96458bc10ed896615 @rogerman rogerman committed Nov 30, 2016
@@ -3056,7 +3056,7 @@ Render3DError OpenGLRenderer_1_2::SetupPolygon(const POLY &thePoly)
Render3DError OpenGLRenderer_1_2::SetupTexture(const POLY &thePoly, size_t polyRenderIndex)
{
- OpenGLTexture *theTexture = this->_textureList[polyRenderIndex];
+ OpenGLTexture *theTexture = (OpenGLTexture *)this->_textureList[polyRenderIndex];
const NDSTextureFormat packFormat = theTexture->GetPackFormat();
const OGLRenderRef &OGLRef = *this->ref;
@@ -4650,7 +4650,7 @@ Render3DError OpenGLRenderer_2_0::SetupPolygon(const POLY &thePoly)
Render3DError OpenGLRenderer_2_0::SetupTexture(const POLY &thePoly, size_t polyRenderIndex)
{
- OpenGLTexture *theTexture = this->_textureList[polyRenderIndex];
+ OpenGLTexture *theTexture = (OpenGLTexture *)this->_textureList[polyRenderIndex];
const NDSTextureFormat packFormat = theTexture->GetPackFormat();
const OGLRenderRef &OGLRef = *this->ref;
@@ -611,7 +611,6 @@ class OpenGLRenderer : public Render3D
bool _pixelReadNeedsFinish;
size_t _currentPolyIndex;
std::vector<u8> _shadowPolyID;
- OpenGLTexture *_textureList[POLYLIST_SIZE];
Render3DError FlushFramebuffer(const FragmentColor *__restrict srcFramebuffer, FragmentColor *__restrict dstFramebuffer, u16 *__restrict dstRGBA5551);
OpenGLTexture* GetLoadedTextureFromPolygon(const POLY &thePoly, bool enableTexturing);
@@ -1687,7 +1687,7 @@ Render3DError OpenGLRenderer_3_2::SetupPolygon(const POLY &thePoly)
Render3DError OpenGLRenderer_3_2::SetupTexture(const POLY &thePoly, size_t polyRenderIndex)
{
- OpenGLTexture *theTexture = this->_textureList[polyRenderIndex];
+ OpenGLTexture *theTexture = (OpenGLTexture *)this->_textureList[polyRenderIndex];
glBindTexture(GL_TEXTURE_2D, theTexture->GetID());
@@ -345,7 +345,7 @@ class RasterizerUnit
Render3DError SetupTexture(const POLY &thePoly, size_t polyRenderIndex)
{
- SoftRasterizerTexture *theTexture = this->_softRender->_textureList[polyRenderIndex];
+ SoftRasterizerTexture *theTexture = (SoftRasterizerTexture *)this->_softRender->GetTextureByPolygonRenderIndex(polyRenderIndex);
this->currentTexture = theTexture;
if (!theTexture->IsSamplingEnabled())
@@ -122,7 +122,6 @@ class SoftRasterizerRenderer : public Render3D
FragmentColor toonColor32LUT[32];
GFX3D_Clipper::TClippedPoly *clippedPolys;
FragmentAttributesBuffer *_framebufferAttributes;
- SoftRasterizerTexture *_textureList[POLYLIST_SIZE];
bool polyVisible[POLYLIST_SIZE];
bool polyBackfacing[POLYLIST_SIZE];
GFX3D_State *currentRenderState;
@@ -453,6 +453,11 @@ void Render3D::SetTextureProcessingProperties(size_t scalingFactor, bool willDep
}
}
+Render3DTexture* Render3D::GetTextureByPolygonRenderIndex(size_t polyRenderIndex) const
+{
+ return this->_textureList[polyRenderIndex];
+}
+
Render3DError Render3D::BeginRender(const GFX3D &engine)
{
return RENDER3DERROR_NOERR;
@@ -162,6 +162,7 @@ class Render3D
SSurface _textureDeposterizeDstSurface;
u32 *_textureUpscaleBuffer;
+ Render3DTexture *_textureList[POLYLIST_SIZE];
CACHE_ALIGN u16 clearImageColor16Buffer[GPU_FRAMEBUFFER_NATIVE_WIDTH * GPU_FRAMEBUFFER_NATIVE_HEIGHT];
CACHE_ALIGN u32 clearImageDepthBuffer[GPU_FRAMEBUFFER_NATIVE_WIDTH * GPU_FRAMEBUFFER_NATIVE_HEIGHT];
@@ -230,6 +231,7 @@ class Render3D
void SetRenderNeedsFinish(const bool renderNeedsFinish);
void SetTextureProcessingProperties(size_t scalingFactor, bool willDeposterize, bool willSmooth);
+ Render3DTexture* GetTextureByPolygonRenderIndex(size_t polyRenderIndex) const;
};
#ifdef ENABLE_SSE2

0 comments on commit 8821e7b

Please sign in to comment.