From 195336021f7890cc4a308b4437bd0f3e083cfc0a Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 7 Apr 2013 17:11:29 -0400 Subject: [PATCH] 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/PixelShaderGen.cpp | 4 ++-- Source/Core/VideoCommon/Src/PixelShaderManager.cpp | 12 ++++++------ Source/Core/VideoCommon/Src/VertexShaderManager.cpp | 4 ++-- .../Plugins/Plugin_VideoDX9/Src/FramebufferManager.h | 8 ++++---- Source/Plugins/Plugin_VideoDX9/Src/Render.cpp | 10 +++++----- .../Plugins/Plugin_VideoSoftware/Src/SWRenderer.cpp | 2 +- .../Plugin_VideoSoftware/Src/SWVertexLoader.cpp | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index 5c2e4a66b8..5385d09546 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -390,7 +390,7 @@ static const char *tevCInputTable[] = // CC "float3(0.5f, 0.5f, 0.5f)", // HALF "(konsttemp.rgb)", //"konsttemp.rgb", // KONST "float3(0.0f, 0.0f, 0.0f)", // ZERO - ///aded extra values to map clamped values + ///added extra values to map clamped values "(cprev.rgb)", // CPREV, "(cprev.aaa)", // APREV, "(cc0.rgb)", // C0, @@ -1336,7 +1336,7 @@ static void WriteFog(char *&p) // x_adjust = sqrt((x-center)^2 + k^2)/k // ze *= x_adjust - //this is complitly teorical as the real hard seems to use a table intead of calculate the values. + //this is completely theoretical as the real hardware seems to use a table instead of calculating the values. if (bpmem.fogRange.Base.Enabled) { WRITE (p, "\tfloat x_adjust = (2.0f * (clipPos.x / " I_FOG"[2].y)) - 1.0f - " I_FOG"[2].x;\n"); 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 diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp index 0f5b940580..b8c9b7d5a3 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp @@ -122,7 +122,7 @@ void UpdateProjectionHack(int iPhackvalue[], std::string sPhackvalue[]) if (iPhackvalue[0] == 1) { - NOTICE_LOG(VIDEO, "\t\t--- Ortographic Projection Hack ON ---"); + NOTICE_LOG(VIDEO, "\t\t--- Orthographic Projection Hack ON ---"); fhacksign1 *= (iPhackvalue[1] == 1) ? -1.0f : fhacksign1; sTemp[0] = (iPhackvalue[1] == 1) ? " * (-1)" : ""; @@ -191,7 +191,7 @@ void VertexShaderManager::Dirty() } // Syncs the shader constant buffers with xfmem -// TODO: A cleaner way to control the matricies without making a mess in the parameters field +// TODO: A cleaner way to control the matrices without making a mess in the parameters field void VertexShaderManager::SetConstants() { if (g_ActiveConfig.backend_info.APIType == API_OPENGL && !g_ActiveConfig.backend_info.bSupportsGLSLUBO) diff --git a/Source/Plugins/Plugin_VideoDX9/Src/FramebufferManager.h b/Source/Plugins/Plugin_VideoDX9/Src/FramebufferManager.h index 5b5993a12b..d2dd829044 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/FramebufferManager.h +++ b/Source/Plugins/Plugin_VideoDX9/Src/FramebufferManager.h @@ -114,9 +114,9 @@ private: color_surface_Format(D3DFMT_UNKNOWN), depth_surface_Format(D3DFMT_UNKNOWN), depth_ReadBuffer_Format(D3DFMT_UNKNOWN) {} - LPDIRECT3DTEXTURE9 color_texture;//Texture thats contains the color data of the render target + LPDIRECT3DTEXTURE9 color_texture;//Texture that contains the color data of the render target LPDIRECT3DTEXTURE9 colorRead_texture;//1 pixel texture for temporal data store - LPDIRECT3DTEXTURE9 depth_texture;//Texture thats contains the depth data of the render target + LPDIRECT3DTEXTURE9 depth_texture;//Texture that contains the depth data of the render target LPDIRECT3DTEXTURE9 depthRead_texture;//4 pixel texture for temporal data store LPDIRECT3DTEXTURE9 color_reinterpret_texture;//buffer used for ReinterpretPixelData @@ -126,8 +126,8 @@ private: LPDIRECT3DSURFACE9 color_surface;//Color Surface LPDIRECT3DSURFACE9 color_ReadBuffer;//Surface 0 of colorRead_texture LPDIRECT3DSURFACE9 depth_ReadBuffer;//Surface 0 of depthRead_texture - LPDIRECT3DSURFACE9 color_OffScreenReadBuffer;//System memory Surface that can be locked to retriebe the data - LPDIRECT3DSURFACE9 depth_OffScreenReadBuffer;//System memory Surface that can be locked to retriebe the data + LPDIRECT3DSURFACE9 color_OffScreenReadBuffer;//System memory Surface that can be locked to retrieve the data + LPDIRECT3DSURFACE9 depth_OffScreenReadBuffer;//System memory Surface that can be locked to retrieve the data D3DFORMAT color_surface_Format;//Format of the color Surface D3DFORMAT depth_surface_Format;//Format of the Depth Surface diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp index 147ad0c35d..987c21bcc2 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp @@ -455,7 +455,7 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) } else if(type == PEEK_COLOR) { - // We can't directly StretchRect to System buf because is not suported by all implementations + // We can't directly StretchRect to System buf because is not supported by all implementations // this is the only safe path that works in most cases hr = D3D::dev->StretchRect(pEFBSurf, &RectToLock, pBufferRT, NULL, D3DTEXF_NONE); D3D::dev->GetRenderTargetData(pBufferRT, pSystemBuf); @@ -665,8 +665,8 @@ void Renderer::SetBlendMode(bool forceUpdate) // Our render target always uses an alpha channel, so we need to override the blend functions to assume a destination alpha of 1 if the render target isn't supposed to have an alpha channel // Example: D3DBLEND_DESTALPHA needs to be D3DBLEND_ONE since the result without an alpha channel is assumed to always be 1. bool target_has_alpha = bpmem.zcontrol.pixel_format == PIXELFMT_RGBA6_Z24; - //bDstAlphaPass is taked in account because the ability of disabling alpha composition is - //really usefull for debuging shader and blending errors + //bDstAlphaPass is taken into account because the ability to disable alpha composition is + //really useful for debugging shader and blending errors bool use_DstAlpha = !g_ActiveConfig.bDstAlphaPass && bpmem.dstalpha.enable && bpmem.blendmode.alphaupdate && target_has_alpha; bool use_DualSource = use_DstAlpha && g_ActiveConfig.backend_info.bSupportsDualSourceBlend; const D3DBLEND d3dSrcFactors[8] = @@ -1133,7 +1133,7 @@ void Renderer::ApplyState(bool bUseDstAlpha) if(bpmem.zmode.testenable && bpmem.zmode.updateenable) { // This is needed to draw to the correct pixels in multi-pass algorithms - // to avoid z-figthing and grants that you write to the same pixels + // to avoid z-fighting and grants that you write to the same pixels // affected by the last pass D3D::ChangeRenderState(D3DRS_ZWRITEENABLE, false); D3D::ChangeRenderState(D3DRS_ZFUNC, D3DCMP_EQUAL); @@ -1327,7 +1327,7 @@ void Renderer::SetLineWidth() // We can't change line width in D3D unless we use ID3DXLine float fratio = xfregs.viewport.wd != 0 ? Renderer::EFBToScaledXf(1.f) : 1.0f; float psize = bpmem.lineptwidth.linesize * fratio / 6.0f; - //little hack to compensate scalling problems in dx9 must be taken out when scalling is fixed. + //little hack to compensate scaling problems in dx9 must be taken out when scaling is fixed. psize *= 2.0f; if (psize > m_fMaxPointSize) { diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.cpp index 111e6ca57b..2151a0647d 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/SWRenderer.cpp @@ -117,7 +117,7 @@ void SWRenderer::DrawDebugText() if (g_SWVideoConfig.bShowStats) { p+=sprintf(p,"Objects: %i\n",swstats.thisFrame.numDrawnObjects); - p+=sprintf(p,"Primatives: %i\n",swstats.thisFrame.numPrimatives); + p+=sprintf(p,"Primitives: %i\n",swstats.thisFrame.numPrimatives); p+=sprintf(p,"Vertices Loaded: %i\n",swstats.thisFrame.numVerticesLoaded); p+=sprintf(p,"Triangles Input: %i\n",swstats.thisFrame.numTrianglesIn); diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/SWVertexLoader.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/SWVertexLoader.cpp index 1c1eeb2005..063e806865 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/SWVertexLoader.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/SWVertexLoader.cpp @@ -238,7 +238,7 @@ void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType) const int elements = tcElements[i]; _assert_msg_(VIDEO, NOT_PRESENT <= desc && desc <= INDEX16, "Invalid texture coordinates description!\n(desc = %d)", desc); _assert_msg_(VIDEO, FORMAT_UBYTE <= format && format <= FORMAT_FLOAT, "Invalid texture coordinates format!\n(format = %d)", format); - _assert_msg_(VIDEO, 0 <= elements && elements <= 1, "Invalid number of texture coordinates elemnts!\n(elements = %d)", elements); + _assert_msg_(VIDEO, 0 <= elements && elements <= 1, "Invalid number of texture coordinates elements!\n(elements = %d)", elements); m_texCoordLoader[i] = VertexLoader_TextCoord::GetFunction(desc, format, elements); m_VertexSize += VertexLoader_TextCoord::GetSize(desc, format, elements);