From fb5e68d7ee2ff958024f977457c6b0d06a9ab333 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Sat, 27 Mar 2010 02:21:09 +0000 Subject: [PATCH] zzogl-pg: Simplify a bit of the option code. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2782 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/zzogl-pg/opengl/Linux/Linux.cpp | 101 +++++++----------------- 1 file changed, 30 insertions(+), 71 deletions(-) diff --git a/plugins/zzogl-pg/opengl/Linux/Linux.cpp b/plugins/zzogl-pg/opengl/Linux/Linux.cpp index a973880abf..04a3ba7a4b 100644 --- a/plugins/zzogl-pg/opengl/Linux/Linux.cpp +++ b/plugins/zzogl-pg/opengl/Linux/Linux.cpp @@ -171,6 +171,13 @@ void OnConf_Cancel(GtkButton *button, gpointer user_data) gtk_main_quit(); } +void add_map_entry(u32 option, const char *key, const char *desc) +{ + confOpts.value = option; + confOpts.desc = desc; + mapConfOpts[key] = confOpts; +} + void CALLBACK GSconfigure() { char descbuf[255]; @@ -240,76 +247,29 @@ void CALLBACK GSconfigure() //setup the model with all our rows of option data mapConfOpts.clear(); - confOpts.value = 0x00000001; - confOpts.desc = "Tex Target checking - 00000001\nLego Racers"; - mapConfOpts["00000001"] = confOpts; - confOpts.value = 0x00000002; - confOpts.desc = "Auto reset targs - 00000002\nShadow Hearts, Samurai Warriors. Use when game is slow and toggling AA fixes it."; - mapConfOpts["00000002"] = confOpts; - confOpts.value = 0x00000010; - confOpts.desc = "No target resolves - 00000010\nStops all resolving of targets. Try this first for really slow games. Dark Cloud 1"; - mapConfOpts["00000010"] = confOpts; - confOpts.value = 0x00000020; - confOpts.desc = "Exact color testing - 00000020\nFixes overbright or shadow/black artifacts (Crash 'n Burn)."; - mapConfOpts["00000020"] = confOpts; - confOpts.value = 0x00000040; - confOpts.desc = "No color clamping - 00000040\nSpeeds up games, but might be too bright or too dim."; - mapConfOpts["00000040"] = confOpts; - confOpts.value = 0x00000100; - confOpts.desc = "Alpha Fail hack - 00000100\nFor Sonic Unleashed, Shadow the Hedgehog, Ghost in the Shell. Remove vertical stripes or other coloring artefacts. Break Persona 4 and MGS3"; - mapConfOpts["00000100"] = confOpts; - confOpts.value = 0x00000200; - confOpts.desc = "Disable depth updates - 00000200"; - mapConfOpts["00000200"] = confOpts; - confOpts.value = 0x00000400; - confOpts.desc = "Resolve Hack #1 - 00000400\nKingdom Hearts. Speeds some games."; - mapConfOpts["00000400"] = confOpts; - confOpts.value = 0x00000800; - confOpts.desc = "Resolve Hack #2 - 00000800\nShadow Hearts, Urbz. Destroy FFX"; - mapConfOpts["00000800"] = confOpts; - confOpts.value = 0x00001000; - confOpts.desc = "No target CLUT - 00001000\nResident Evil 4, or foggy scenes."; - mapConfOpts["00001000"] = confOpts; - confOpts.value = 0x00002000; - confOpts.desc = "Disable stencil buffer - 00002000\nUsually safe to do for simple scenes. Harvest Moon"; - mapConfOpts["00002000"] = confOpts; - confOpts.value = 0x00008000; - confOpts.desc = "No depth resolve - 00008000\nMight give z buffer artifacts."; - mapConfOpts["00008000"] = confOpts; - confOpts.value = 0x00010000; - confOpts.desc = "Full 16 bit resolution - 00010000\nUse when half the screen is missing."; - mapConfOpts["00010000"] = confOpts; - confOpts.value = 0x00020000; - confOpts.desc = "Resolve Hack #3 - 00020000\nNeopets"; - mapConfOpts["00020000"] = confOpts; - confOpts.value = 0x00040000; - confOpts.desc = "Fast Update - 00040000\nOkami. Speeds some games. Needs for Sonic Unleashed"; - mapConfOpts["00040000"] = confOpts; - confOpts.value = 0x00080000; - confOpts.desc = "Disable alpha testing - 00080000"; - mapConfOpts["00080000"] = confOpts; - confOpts.value = 0x00100000; - confOpts.desc = "Enable Multiple RTs - 00100000"; - mapConfOpts["00100000"] = confOpts; - confOpts.value = 0x01000000; - confOpts.desc = "Specular Highlights - 01000000\nMakes xenosaga and Okage graphics faster by removing highlights"; - mapConfOpts["01000000"] = confOpts; - confOpts.value = 0x02000000; - confOpts.desc = "Partial targets - 02000000"; - mapConfOpts["00200000"] = confOpts; - confOpts.value = 0x04000000; - confOpts.desc = "Partial depth - 04000000"; - mapConfOpts["04000000"] = confOpts; - confOpts.value = 0x10000000; - confOpts.desc = "Gust fix, made gustgame more clean and fast - 10000000"; - mapConfOpts["10000000"] = confOpts; - confOpts.value = 0x20000000; - confOpts.desc = "No logarphmic Z, could decrease number of Z-artefacts - 20000000"; - mapConfOpts["20000000"] = confOpts; - - confOpts.value = 0x00000004; - confOpts.desc = "Interlace 2X - 00000004\nFixes 2x bigger screen (Gradius 3)."; - mapConfOpts["00000004"] = confOpts; + add_map_entry(0x00000001, "00000001", "Tex Target checking - 00000001\nLego Racers"); + add_map_entry(0x00000002, "00000002", "Auto reset targs - 00000002\nShadow Hearts, Samurai Warriors. Use when game is slow and toggling AA fixes it."); + add_map_entry(0x00000010, "00000010", "No target resolves - 00000010\nStops all resolving of targets. Try this first for really slow games. Dark Cloud 1"); + add_map_entry(0x00000020, "00000020", "Exact color testing - 00000020\nFixes overbright or shadow/black artifacts (Crash 'n Burn)."); + add_map_entry(0x00000040, "00000040", "No color clamping - 00000040\nSpeeds up games, but might be too bright or too dim."); + add_map_entry(0x00000100, "00000100", "Alpha Fail hack - 00000100\nFor Sonic Unleashed, Shadow the Hedgehog, Ghost in the Shell. Remove vertical stripes or other coloring artefacts. Break Persona 4 and MGS3"); + add_map_entry(0x00000200, "00000200", "Disable depth updates - 00000200"); + add_map_entry(0x00000400, "00000400", "Resolve Hack #1 - 00000400\nKingdom Hearts. Speeds some games."); + add_map_entry(0x00000800, "00000800", "Resolve Hack #2 - 00000800\nShadow Hearts, Urbz. Destroy FFX"); + add_map_entry(0x00001000, "00001000", "No target CLUT - 00001000\nResident Evil 4, or foggy scenes."); + add_map_entry(0x00002000, "00002000", "Disable stencil buffer - 00002000\nUsually safe to do for simple scenes. Harvest Moon"); + add_map_entry(0x00008000, "00008000", "No depth resolve - 00008000\nMight give z buffer artifacts."); + add_map_entry(0x00010000, "00010000", "Full 16 bit resolution - 00010000\nUse when half the screen is missing."); + add_map_entry(0x00020000, "00020000", "Resolve Hack #3 - 00020000\nNeopets"); + add_map_entry(0x00040000, "00040000", "Fast Update - 00040000\nOkami. Speeds some games. Needs for Sonic Unleashed"); + add_map_entry(0x00080000, "00080000", "Disable alpha testing - 00080000"); + add_map_entry(0x00100000, "00100000", "Enable Multiple RTs - 00100000"); + add_map_entry(0x01000000, "01000000", "Specular Highlights - 01000000\nMakes Xenosaga and Okage graphics faster by removing highlights"); + add_map_entry(0x02000000, "02000000", "Partial targets - 02000000"); + add_map_entry(0x04000000, "04000000", "Partial depth - 04000000"); + add_map_entry(0x10000000, "10000000", "Gust fix, made gustgame more clean and fast - 10000000"); + add_map_entry(0x20000000, "20000000", "No logarithmic Z, could decrease number of Z-artefacts - 20000000"); + add_map_entry(0x00000004, "00000004", "Interlace 2X - 00000004\nFixes 2x bigger screen (Gradius 3)."); for(map::iterator it = mapConfOpts.begin(); it != mapConfOpts.end(); ++it) { @@ -340,7 +300,6 @@ void OnToggle_advopts(GtkCellRendererToggle *cell, gchar *path, gpointer user_da gtk_tree_model_get(GTK_TREE_MODEL(user_data), &treeiter, 0, &val, -1); val = !val; gtk_list_store_set(GTK_LIST_STORE(user_data), &treeiter, 0, val, -1); - } void OnAbout_Ok(GtkButton *button, gpointer user_data)