mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Refactor: rename ShaderCombiner methods - name starts from lower case letter.
This commit is contained in:
parent
4843c0ffdd
commit
0f176dcc4c
|
@ -232,7 +232,7 @@ void CombinerInfo::setCombine(u64 _mux )
|
|||
{
|
||||
if (m_pCurrent != NULL && m_pCurrent->getMux() == _mux) {
|
||||
m_bChanged = false;
|
||||
m_pCurrent->Update();
|
||||
m_pCurrent->update();
|
||||
return;
|
||||
}
|
||||
Combiners::const_iterator iter = m_combiners.find(_mux);
|
||||
|
@ -242,7 +242,7 @@ void CombinerInfo::setCombine(u64 _mux )
|
|||
m_pCurrent = _compile(_mux);
|
||||
m_combiners[_mux] = m_pCurrent;
|
||||
}
|
||||
m_pCurrent->Update();
|
||||
m_pCurrent->update();
|
||||
m_bChanged = true;
|
||||
gDP.changed |= CHANGED_COMBINE_COLORS;
|
||||
}
|
||||
|
|
|
@ -426,7 +426,7 @@ void FrameBuffer_AttachDepthBuffer()
|
|||
#endif
|
||||
assert(checkFBO());
|
||||
}
|
||||
CombinerInfo::get().getCurrent()->UpdateDepthInfo(true);
|
||||
CombinerInfo::get().getCurrent()->updateDepthInfo(true);
|
||||
}
|
||||
|
||||
#ifndef GLES2
|
||||
|
|
|
@ -554,7 +554,7 @@ void ShaderCombiner::_locate_attributes() const {
|
|||
glBindAttribLocation(m_program, SC_NUMLIGHTS, "aNumLights");
|
||||
}
|
||||
|
||||
void ShaderCombiner::Update() {
|
||||
void ShaderCombiner::update() {
|
||||
glUseProgram(m_program);
|
||||
|
||||
_setIUniform(m_uniforms.uTex0, 0, true);
|
||||
|
@ -562,19 +562,19 @@ void ShaderCombiner::Update() {
|
|||
_setFUniform(m_uniforms.uScreenWidth, OGL.width, true);
|
||||
_setFUniform(m_uniforms.uScreenHeight, OGL.height, true);
|
||||
|
||||
UpdateRenderState(true);
|
||||
UpdateColors(true);
|
||||
UpdateTextureInfo(true);
|
||||
UpdateAlphaTestInfo(true);
|
||||
UpdateDepthInfo(true);
|
||||
UpdateLight(true);
|
||||
updateRenderState(true);
|
||||
updateColors(true);
|
||||
updateTextureInfo(true);
|
||||
updateAlphaTestInfo(true);
|
||||
updateDepthInfo(true);
|
||||
updateLight(true);
|
||||
}
|
||||
|
||||
void ShaderCombiner::UpdateRenderState(bool _bForce) {
|
||||
void ShaderCombiner::updateRenderState(bool _bForce) {
|
||||
_setIUniform(m_uniforms.uRenderState, OGL.renderState, _bForce);
|
||||
}
|
||||
|
||||
void ShaderCombiner::UpdateLight(bool _bForce) {
|
||||
void ShaderCombiner::updateLight(bool _bForce) {
|
||||
if (config.enableHWLighting == 0)
|
||||
return;
|
||||
for (s32 i = 0; i <= gSP.numLights; ++i) {
|
||||
|
@ -583,7 +583,7 @@ void ShaderCombiner::UpdateLight(bool _bForce) {
|
|||
}
|
||||
}
|
||||
|
||||
void ShaderCombiner::UpdateColors(bool _bForce) {
|
||||
void ShaderCombiner::updateColors(bool _bForce) {
|
||||
_setV4Uniform(m_uniforms.uEnvColor, &gDP.envColor.r, _bForce);
|
||||
_setV4Uniform(m_uniforms.uPrimColor, &gDP.primColor.r, _bForce);
|
||||
_setV4Uniform(m_uniforms.uCenterColor, &gDP.key.center.r, _bForce);
|
||||
|
@ -620,7 +620,7 @@ void ShaderCombiner::UpdateColors(bool _bForce) {
|
|||
gDP.changed &= ~CHANGED_COMBINE_COLORS;
|
||||
}
|
||||
|
||||
void ShaderCombiner::UpdateTextureInfo(bool _bForce) {
|
||||
void ShaderCombiner::updateTextureInfo(bool _bForce) {
|
||||
_setIUniform(m_uniforms.uTexturePersp, gDP.otherMode.texturePersp, _bForce);
|
||||
_setFV2Uniform(m_uniforms.uTexScale, gSP.texture.scales, gSP.texture.scalet, _bForce);
|
||||
int nFB0 = 0, nFB1 = 0;
|
||||
|
@ -659,7 +659,7 @@ void ShaderCombiner::UpdateTextureInfo(bool _bForce) {
|
|||
_setFUniform(m_uniforms.uPrimLod, gDP.primColor.l, _bForce);
|
||||
}
|
||||
|
||||
void ShaderCombiner::UpdateFBInfo(bool _bForce) {
|
||||
void ShaderCombiner::updateFBInfo(bool _bForce) {
|
||||
int nFb8bitMode = 0, nFbFixedAlpha = 0;
|
||||
if (cache.current[0] != NULL && cache.current[0]->frameBufferTexture == TRUE) {
|
||||
if (cache.current[0]->size == G_IM_SIZ_8b) {
|
||||
|
@ -681,7 +681,7 @@ void ShaderCombiner::UpdateFBInfo(bool _bForce) {
|
|||
gDP.changed &= ~CHANGED_FB_TEXTURE;
|
||||
}
|
||||
|
||||
void ShaderCombiner::UpdateDepthInfo(bool _bForce) {
|
||||
void ShaderCombiner::updateDepthInfo(bool _bForce) {
|
||||
if (!OGL.bImageTexture)
|
||||
return;
|
||||
|
||||
|
@ -702,7 +702,7 @@ void ShaderCombiner::UpdateDepthInfo(bool _bForce) {
|
|||
_setFUniform(m_uniforms.uDepthTrans, gSP.viewport.vtrans[2]*32768.0f, _bForce);
|
||||
}
|
||||
|
||||
void ShaderCombiner::UpdateAlphaTestInfo(bool _bForce) {
|
||||
void ShaderCombiner::updateAlphaTestInfo(bool _bForce) {
|
||||
if ((gDP.otherMode.alphaCompare == G_AC_THRESHOLD) && !(gDP.otherMode.alphaCvgSel)) {
|
||||
_setIUniform(m_uniforms.uEnableAlphaTest, 1, _bForce);
|
||||
_setFUniform(m_uniforms.uAlphaTestValue, gDP.blendColor.a, _bForce);
|
||||
|
|
|
@ -8,14 +8,14 @@ public:
|
|||
ShaderCombiner(Combiner & _color, Combiner & _alpha, const gDPCombine & _combine);
|
||||
~ShaderCombiner();
|
||||
|
||||
void Update();
|
||||
void UpdateColors(bool _bForce = false);
|
||||
void UpdateFBInfo(bool _bForce = false);
|
||||
void UpdateDepthInfo(bool _bForce = false);
|
||||
void UpdateAlphaTestInfo(bool _bForce = false);
|
||||
void UpdateTextureInfo(bool _bForce = false);
|
||||
void UpdateRenderState(bool _bForce = false);
|
||||
void UpdateLight(bool _bForce = false);
|
||||
void update();
|
||||
void updateColors(bool _bForce = false);
|
||||
void updateFBInfo(bool _bForce = false);
|
||||
void updateDepthInfo(bool _bForce = false);
|
||||
void updateAlphaTestInfo(bool _bForce = false);
|
||||
void updateTextureInfo(bool _bForce = false);
|
||||
void updateRenderState(bool _bForce = false);
|
||||
void updateLight(bool _bForce = false);
|
||||
|
||||
u64 getMux() const {return m_combine.mux;}
|
||||
|
||||
|
|
22
OpenGL.cpp
22
OpenGL.cpp
|
@ -767,7 +767,7 @@ void OGL_UpdateStates()
|
|||
OGL_UpdateCullFace();
|
||||
|
||||
if (gSP.changed & CHANGED_LIGHT)
|
||||
CombinerInfo::get().getCurrent()->UpdateLight();
|
||||
CombinerInfo::get().getCurrent()->updateLight();
|
||||
|
||||
if (config.frameBufferEmulation.N64DepthCompare) {
|
||||
glDisable( GL_DEPTH_TEST );
|
||||
|
@ -794,7 +794,7 @@ void OGL_UpdateStates()
|
|||
}
|
||||
|
||||
if ((gDP.changed & (CHANGED_ALPHACOMPARE|CHANGED_RENDERMODE|CHANGED_BLENDCOLOR)) != 0)
|
||||
CombinerInfo::get().getCurrent()->UpdateAlphaTestInfo();
|
||||
CombinerInfo::get().getCurrent()->updateAlphaTestInfo();
|
||||
|
||||
if (gDP.changed & CHANGED_SCISSOR)
|
||||
{
|
||||
|
@ -822,15 +822,15 @@ void OGL_UpdateStates()
|
|||
TextureCache_Update(1);
|
||||
else
|
||||
TextureCache_ActivateDummy(1);
|
||||
CombinerInfo::get().getCurrent()->UpdateTextureInfo(true);
|
||||
CombinerInfo::get().getCurrent()->updateTextureInfo(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (gDP.changed & CHANGED_FB_TEXTURE)
|
||||
CombinerInfo::get().getCurrent()->UpdateFBInfo(true);
|
||||
CombinerInfo::get().getCurrent()->updateFBInfo(true);
|
||||
|
||||
if ((gDP.changed & CHANGED_RENDERMODE) || (gSP.geometryMode & G_ZBUFFER))
|
||||
CombinerInfo::get().getCurrent()->UpdateDepthInfo(true);
|
||||
CombinerInfo::get().getCurrent()->updateDepthInfo(true);
|
||||
|
||||
if ((gDP.changed & CHANGED_RENDERMODE) || (gDP.changed & CHANGED_CYCLETYPE))
|
||||
{
|
||||
|
@ -957,11 +957,11 @@ void OGL_DrawTriangles()
|
|||
OGL_UpdateCullFace();
|
||||
OGL_UpdateViewport();
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
CombinerInfo::get().getCurrent()->UpdateRenderState();
|
||||
CombinerInfo::get().getCurrent()->updateRenderState();
|
||||
}
|
||||
|
||||
CombinerInfo::get().getCurrent()->UpdateColors(true);
|
||||
CombinerInfo::get().getCurrent()->UpdateLight(true);
|
||||
CombinerInfo::get().getCurrent()->updateColors(true);
|
||||
CombinerInfo::get().getCurrent()->updateLight(true);
|
||||
glDrawElements(GL_TRIANGLES, OGL.triangles.num, GL_UNSIGNED_BYTE, OGL.triangles.elements);
|
||||
OGL.triangles.num = 0;
|
||||
|
||||
|
@ -985,7 +985,7 @@ void OGL_DrawLine(int v0, int v1, float width )
|
|||
OGL_UpdateCullFace();
|
||||
OGL_UpdateViewport();
|
||||
OGL.renderState = GLInfo::rsLine;
|
||||
CombinerInfo::get().getCurrent()->UpdateRenderState();
|
||||
CombinerInfo::get().getCurrent()->updateRenderState();
|
||||
}
|
||||
|
||||
unsigned short elem[2];
|
||||
|
@ -1013,7 +1013,7 @@ void OGL_DrawRect( int ulx, int uly, int lrx, int lry, float *color )
|
|||
glVertexAttrib4f(SC_COLOR, 0, 0, 0, 0);
|
||||
glVertexAttrib4f(SC_POSITION, 0, 0, (gDP.otherMode.depthSource == G_ZS_PRIM) ? gDP.primDepth.z : gSP.viewport.nearz, 1.0);
|
||||
glVertexAttribPointer(SC_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(GLVertex), &OGL.rect[0].x);
|
||||
CombinerInfo::get().getCurrent()->UpdateRenderState();
|
||||
CombinerInfo::get().getCurrent()->updateRenderState();
|
||||
}
|
||||
|
||||
if (frameBuffer.drawBuffer != GL_FRAMEBUFFER)
|
||||
|
@ -1062,7 +1062,7 @@ void OGL_DrawTexturedRect( float ulx, float uly, float lrx, float lry, float uls
|
|||
glVertexAttribPointer(SC_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(GLVertex), &OGL.rect[0].x);
|
||||
glVertexAttribPointer(SC_TEXCOORD0, 2, GL_FLOAT, GL_FALSE, sizeof(GLVertex), &OGL.rect[0].s0);
|
||||
glVertexAttribPointer(SC_TEXCOORD1, 2, GL_FLOAT, GL_FALSE, sizeof(GLVertex), &OGL.rect[0].s1);
|
||||
CombinerInfo::get().getCurrent()->UpdateRenderState();
|
||||
CombinerInfo::get().getCurrent()->updateRenderState();
|
||||
}
|
||||
|
||||
#ifndef GLES2
|
||||
|
|
Loading…
Reference in New Issue
Block a user