From 21fada2e5312ba1b63144042980ebe01e9f91198 Mon Sep 17 00:00:00 2001 From: "gregory.hainaut@gmail.com" Date: Sun, 12 Sep 2010 10:54:42 +0000 Subject: [PATCH] zzogl-pg: remove negative AA. Save some cpu cycles. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3756 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/zzogl-pg/opengl/ZZKeyboard.cpp | 25 -------------------- plugins/zzogl-pg/opengl/ZZLog.h | 1 - plugins/zzogl-pg/opengl/ZZoglFlush.cpp | 1 - plugins/zzogl-pg/opengl/targets.h | 12 +++------- plugins/zzogl-pg/opengl/zerogs.cpp | 32 -------------------------- plugins/zzogl-pg/opengl/zerogs.h | 1 - 6 files changed, 3 insertions(+), 69 deletions(-) diff --git a/plugins/zzogl-pg/opengl/ZZKeyboard.cpp b/plugins/zzogl-pg/opengl/ZZKeyboard.cpp index 146c17b545..f10f304c59 100644 --- a/plugins/zzogl-pg/opengl/ZZKeyboard.cpp +++ b/plugins/zzogl-pg/opengl/ZZKeyboard.cpp @@ -111,31 +111,6 @@ void ProcessWireFrame() ZZLog::WriteToScreen(strtitle); } -void ProcessNegAASetting(bool reverse) -{ - FUNCLOG - - char strtitle[256]; - - if (reverse) - { - conf.negaa--; // -1 - if (conf.negaa > 2) conf.negaa = 2; // u8 in unsigned, so negative value is 255. - sprintf(strtitle, "down resolution - %s", s_naa[conf.negaa]); - ZeroGS::SetNegAA(conf.negaa); - } - else - { - conf.negaa++; - if (conf.negaa > 2) conf.negaa = 0; - sprintf(strtitle, "down resolution - %s", s_naa[conf.negaa]); - ZeroGS::SetNegAA(conf.negaa); - } - - ZZLog::WriteToScreen(strtitle); - SaveConfig(); -} - typedef struct GameHackStruct { const char HackName[40]; diff --git a/plugins/zzogl-pg/opengl/ZZLog.h b/plugins/zzogl-pg/opengl/ZZLog.h index 443e71435b..e5db14ea16 100644 --- a/plugins/zzogl-pg/opengl/ZZLog.h +++ b/plugins/zzogl-pg/opengl/ZZLog.h @@ -161,7 +161,6 @@ namespace ZeroGS { extern void AddMessage(const char* pstr, u32 ms); extern void SetAA(int mode); -extern void SetNegAA(int mode); extern bool Create(int width, int height); extern void Destroy(bool bD3D); extern void StartCapture(); diff --git a/plugins/zzogl-pg/opengl/ZZoglFlush.cpp b/plugins/zzogl-pg/opengl/ZZoglFlush.cpp index 90677657bd..abe20f4b39 100644 --- a/plugins/zzogl-pg/opengl/ZZoglFlush.cpp +++ b/plugins/zzogl-pg/opengl/ZZoglFlush.cpp @@ -200,7 +200,6 @@ VB vb[2]; float fiTexWidth[2], fiTexHeight[2]; // current tex width and height u8 s_AAx = 0, s_AAy = 0; // if AAy is set, then AAx has to be set -u8 s_AAz = 0, s_AAw = 0; // if AAy is set, then AAx has to be set int icurctx = -1; diff --git a/plugins/zzogl-pg/opengl/targets.h b/plugins/zzogl-pg/opengl/targets.h index 79eee4292d..a25e681e73 100644 --- a/plugins/zzogl-pg/opengl/targets.h +++ b/plugins/zzogl-pg/opengl/targets.h @@ -199,24 +199,18 @@ extern CRenderTargetMngr s_RTs, s_DepthRTs; extern CBitwiseTextureMngr s_BitwiseTextures; extern CMemoryTargetMngr g_MemTargs; -extern u8 s_AAx, s_AAy, s_AAz, s_AAw; +extern u8 s_AAx, s_AAy; // Real rendered width, depends on AA and AAneg. inline int RW(int tbw) { - if (s_AAx >= s_AAz) - return (tbw << (s_AAx - s_AAz)); - else - return (tbw >> (s_AAz - s_AAx)); + return (tbw << s_AAx); } // Real rendered height, depends on AA and AAneg. inline int RH(int tbh) { - if (s_AAy >= s_AAw) - return (tbh << (s_AAy - s_AAw)); - else - return (tbh >> (s_AAw - s_AAy)); + return (tbh << s_AAy); } /* inline void CreateTargetsList(int start, int end, list& listTargs) { diff --git a/plugins/zzogl-pg/opengl/zerogs.cpp b/plugins/zzogl-pg/opengl/zerogs.cpp index a41ce511a2..405bdd8779 100644 --- a/plugins/zzogl-pg/opengl/zerogs.cpp +++ b/plugins/zzogl-pg/opengl/zerogs.cpp @@ -404,38 +404,6 @@ void ZeroGS::ChangeDeviceSize(int nNewWidth, int nNewHeight) assert(vb[0].pBufferData != NULL && vb[1].pBufferData != NULL); } - -void ZeroGS::SetNegAA(int mode) -{ - FUNCLOG - // need to flush all targets - s_RTs.ResolveAll(); - s_RTs.Destroy(); - s_DepthRTs.ResolveAll(); - s_DepthRTs.Destroy(); - - s_AAz = s_AAw = 0; // This is code for x0, x2, x4, x8 and x16 anti-aliasing. - - if (mode > 0) - { - s_AAz = (mode + 1) / 2; // ( 1, 0 ) ; ( 1, 1 ) -- it's used as binary shift, so x << s_AAz, y << s_AAw - s_AAw = mode / 2; - } - - memset(s_nResolveCounts, 0, sizeof(s_nResolveCounts)); - - s_nLastResolveReset = 0; - - vb[0].prndr = NULL; - vb[0].pdepth = NULL; - vb[0].bNeedFrameCheck = 1; - vb[0].bNeedZCheck = 1; - vb[1].prndr = NULL; - vb[1].pdepth = NULL; - vb[1].bNeedFrameCheck = 1; - vb[1].bNeedZCheck = 1; -} - void ZeroGS::SetAA(int mode) { FUNCLOG diff --git a/plugins/zzogl-pg/opengl/zerogs.h b/plugins/zzogl-pg/opengl/zerogs.h index e9d995462f..f8fcd2366c 100644 --- a/plugins/zzogl-pg/opengl/zerogs.h +++ b/plugins/zzogl-pg/opengl/zerogs.h @@ -420,7 +420,6 @@ void ChangeWindowSize(int nNewWidth, int nNewHeight); void SetChangeDeviceSize(int nNewWidth, int nNewHeight); void ChangeDeviceSize(int nNewWidth, int nNewHeight); void SetAA(int mode); -void SetNegAA(int mode); void SetCRC(int crc); void ReloadEffects();