From 195336021f7890cc4a308b4437bd0f3e083cfc0a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 7 Apr 2013 17:11:29 -0400 Subject: Fix a few typos in the comments/logging in VideoDX9, VideoCommon, and VideoSoftware projects. See Render.cpp, PixelShaderGen.cpp, and PixelShaderManager.cpp for most of the changes. See VertexShaderManager.cpp for a logging typo fix. See SWRenderer.cpp for a small typo fix for a message that gets swprintf'd in DrawDebugText. See SWVertexLoader.cpp for a typo fix of an assert message. Should slightly improve the readability of some of those files. --- Source/Core/VideoCommon/Src/PixelShaderManager.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Source/Core/VideoCommon/Src/PixelShaderManager.cpp') diff --git a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp index ad84f6876e..265bebf991 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp @@ -245,14 +245,14 @@ void PixelShaderManager::SetConstants() { //bpmem.fogRange.Base.Center : center of the viewport in x axis. observation: bpmem.fogRange.Base.Center = realcenter + 342; int center = ((u32)bpmem.fogRange.Base.Center) - 342; - // normalice center to make calculations easy + // normalize center to make calculations easy float ScreenSpaceCenter = center / (2.0f * xfregs.viewport.wd); ScreenSpaceCenter = (ScreenSpaceCenter * 2.0f) - 1.0f; - //bpmem.fogRange.K seems to be a table of precalculated coeficients for the adjust factor - //observations: bpmem.fogRange.K[0].LO apears to be the lowest value and bpmem.fogRange.K[4].HI the largest - // they always seems to be larger than 256 so my teory is : - // they are the coeficients from the center to th e border of the screen - // so to simplify i use the hi coeficient as K in the shader taking 256 as the scale + //bpmem.fogRange.K seems to be a table of precalculated coefficients for the adjust factor + //observations: bpmem.fogRange.K[0].LO appears to be the lowest value and bpmem.fogRange.K[4].HI the largest + // they always seems to be larger than 256 so my theory is : + // they are the coefficients from the center to the border of the screen + // so to simplify I use the hi coefficient as K in the shader taking 256 as the scale SetPSConstant4f(C_FOG + 2, ScreenSpaceCenter, (float)Renderer::EFBToScaledX((int)(2.0f * xfregs.viewport.wd)), bpmem.fogRange.K[4].HI / 256.0f,0.0f); } else -- cgit v1.2.3 From bab9963b00953d60bdd6fabe265d5daa45a27661 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 17 Apr 2013 23:09:55 -0400 Subject: New license header introduced for DiscIO, AudioCommon, InputCommon, VideoCommon, and Common projects. --- Source/Core/VideoCommon/Src/PixelShaderManager.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'Source/Core/VideoCommon/Src/PixelShaderManager.cpp') diff --git a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp index 265bebf991..6c421856d3 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp @@ -1,19 +1,6 @@ -// Copyright (C) 2003 Dolphin Project. - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, version 2.0. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License 2.0 for more details. - -// A copy of the GPL 2.0 should have been included with the program. -// If not, see http://www.gnu.org/licenses/ - -// Official SVN repository and contact information can be found at -// http://code.google.com/p/dolphin-emu/ +// Copyright 2013 Dolphin Emulator Project +// Licensed under GPLv2 +// Refer to the license.txt file included. #include -- cgit v1.2.3 From 8da425b008b46ef90d649e55c6c0d4a0bc2b556b Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 24 Apr 2013 09:21:54 -0400 Subject: Formatting cleanup for VideoCommon. Block braces on new lines. Also killed off trailing whitespace and dangling elses. Spaced some things out to make them more readable (only in places where it looked like a bit of a clusterfuck). --- Source/Core/VideoCommon/Src/PixelShaderManager.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'Source/Core/VideoCommon/Src/PixelShaderManager.cpp') diff --git a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp index 6c421856d3..1d1ac8f5c6 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp @@ -74,6 +74,7 @@ void PixelShaderManager::SetConstants() { if (g_ActiveConfig.backend_info.APIType == API_OPENGL && !g_ActiveConfig.backend_info.bSupportsGLSLUBO) Dirty(); + for (int i = 0; i < 2; ++i) { if (s_nColorsChanged[i]) @@ -158,8 +159,10 @@ void PixelShaderManager::SetConstants() SetPSConstant4fv(C_INDTEXSCALE, f); } - if (s_nIndTexScaleChanged & 0x0c) { - for (u32 i = 2; i < 4; ++i) { + if (s_nIndTexScaleChanged & 0x0c) + { + for (u32 i = 2; i < 4; ++i) + { f[2 * i] = bpmem.texscale[1].getScaleS(i & 1); f[2 * i + 1] = bpmem.texscale[1].getScaleT(i & 1); PRIM_LOG("tex indscale%d: %f %f\n", i, f[2 * i], f[2 * i + 1]); @@ -243,7 +246,9 @@ void PixelShaderManager::SetConstants() SetPSConstant4f(C_FOG + 2, ScreenSpaceCenter, (float)Renderer::EFBToScaledX((int)(2.0f * xfregs.viewport.wd)), bpmem.fogRange.K[4].HI / 256.0f,0.0f); } else + { SetPSConstant4f(C_FOG + 2, 0.0f, 1.0f, 1.0f, 0.0f); // Need to update these values for older hardware that fails to divide by zero in shaders. + } s_bFogRangeAdjustChanged = false; } @@ -279,7 +284,9 @@ void PixelShaderManager::SetConstants() SetPSConstant4f(C_PLIGHTS+5*i+j+1, 0.00001f, xfmemptr[1], xfmemptr[2], 0); } else + { SetPSConstant4fv(C_PLIGHTS+5*i+j+1, xfmemptr); + } } } @@ -347,17 +354,22 @@ void PixelShaderManager::SetPSTextureDims(int texid) void PixelShaderManager::SetColorChanged(int type, int num, bool high) { float *pf = &lastRGBAfull[type][num][0]; - if (!high) { + + if (!high) + { int r = bpmem.tevregs[num].low.a; int a = bpmem.tevregs[num].low.b; pf[0] = (float)r * (1.0f / 255.0f); pf[3] = (float)a * (1.0f / 255.0f); - } else { + } + else + { int b = bpmem.tevregs[num].high.a; int g = bpmem.tevregs[num].high.b; pf[1] = (float)g * (1.0f / 255.0f); pf[2] = (float)b * (1.0f / 255.0f); } + s_nColorsChanged[type] |= 1 << num; PRIM_LOG("pixel %scolor%d: %f %f %f %f\n", type?"k":"", num, pf[0], pf[1], pf[2], pf[3]); } -- cgit v1.2.3