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/BPStructs.cpp | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'Source/Core/VideoCommon/Src/BPStructs.cpp') diff --git a/Source/Core/VideoCommon/Src/BPStructs.cpp b/Source/Core/VideoCommon/Src/BPStructs.cpp index 9580eea447..ee641c2892 100644 --- a/Source/Core/VideoCommon/Src/BPStructs.cpp +++ b/Source/Core/VideoCommon/Src/BPStructs.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/BPStructs.cpp | 56 ++++++++++++++++++------------- 1 file changed, 33 insertions(+), 23 deletions(-) (limited to 'Source/Core/VideoCommon/Src/BPStructs.cpp') diff --git a/Source/Core/VideoCommon/Src/BPStructs.cpp b/Source/Core/VideoCommon/Src/BPStructs.cpp index ee641c2892..314041f894 100644 --- a/Source/Core/VideoCommon/Src/BPStructs.cpp +++ b/Source/Core/VideoCommon/Src/BPStructs.cpp @@ -102,7 +102,9 @@ void BPWritten(const BPCmd& bp) if (!mapTexFound) { if (bp.address != BPMEM_TEV_COLOR_ENV && bp.address != BPMEM_TEV_ALPHA_ENV) + { numWrites = 0; + } else if (++numWrites >= 100) // seem that if 100 consecutive BP writes are called to either of these addresses in ZTP, { // then it is safe to assume the map texture address is currently loaded into the BP memory mapTexAddress = bpmem.tex[0].texImage3[0].hex << 5; @@ -193,15 +195,19 @@ void BPWritten(const BPCmd& bp) PRIM_LOG("blendmode: en=%d, open=%d, colupd=%d, alphaupd=%d, dst=%d, src=%d, sub=%d, mode=%d", bpmem.blendmode.blendenable, bpmem.blendmode.logicopenable, bpmem.blendmode.colorupdate, bpmem.blendmode.alphaupdate, bpmem.blendmode.dstfactor, bpmem.blendmode.srcfactor, bpmem.blendmode.subtract, bpmem.blendmode.logicmode); + // Set LogicOp Blending Mode if (bp.changes & 2) SetLogicOpMode(); + // Set Dithering Mode if (bp.changes & 4) SetDitherMode(); + // Set Blending Mode if (bp.changes & 0xFF1) SetBlendMode(); + // Set Color Mask if (bp.changes & 0x18) SetColorMask(); @@ -413,32 +419,35 @@ void BPWritten(const BPCmd& bp) case BPMEM_CLEARBBOX1: case BPMEM_CLEARBBOX2: { - if(g_ActiveConfig.bUseBBox) - { - // Don't compute bounding box if this frame is being skipped! - // Wrong but valid values are better than bogus values... - if(g_bSkipCurrentFrame) - break; + if(g_ActiveConfig.bUseBBox) + { + // Don't compute bounding box if this frame is being skipped! + // Wrong but valid values are better than bogus values... + if(g_bSkipCurrentFrame) + break; - if (bp.address == BPMEM_CLEARBBOX1) { - int right = bp.newvalue >> 10; - int left = bp.newvalue & 0x3ff; + if (bp.address == BPMEM_CLEARBBOX1) + { + int right = bp.newvalue >> 10; + int left = bp.newvalue & 0x3ff; - // We should only set these if bbox is calculated properly. - PixelEngine::bbox[0] = left; - PixelEngine::bbox[1] = right; - PixelEngine::bbox_active = true; - } else { - int bottom = bp.newvalue >> 10; - int top = bp.newvalue & 0x3ff; - - // We should only set these if bbox is calculated properly. - PixelEngine::bbox[2] = top; - PixelEngine::bbox[3] = bottom; - PixelEngine::bbox_active = true; + // We should only set these if bbox is calculated properly. + PixelEngine::bbox[0] = left; + PixelEngine::bbox[1] = right; + PixelEngine::bbox_active = true; + } + else + { + int bottom = bp.newvalue >> 10; + int top = bp.newvalue & 0x3ff; + + // We should only set these if bbox is calculated properly. + PixelEngine::bbox[2] = top; + PixelEngine::bbox[3] = bottom; + PixelEngine::bbox_active = true; + } } } - } break; case BPMEM_TEXINVALIDATE: // TODO: Needs some restructuring in TextureCacheBase. @@ -446,7 +455,8 @@ void BPWritten(const BPCmd& bp) case BPMEM_ZCOMPARE: // Set the Z-Compare and EFB pixel format OnPixelFormatChange(); - if(bp.changes & 7) { + if(bp.changes & 7) + { SetBlendMode(); // dual source could be activated by changing to PIXELFMT_RGBA6_Z24 g_renderer->SetColorMask(); // alpha writing needs to be disabled if the new pixel format doesn't have an alpha channel } -- cgit v1.2.3