/[pcsx2_0.9.7]/branch/debug/0.X/0.9.X/0.9.7/ramdump-lateset/plugins/zzogl-pg/opengl/ZZKeyboard.cpp
ViewVC logotype

Contents of /branch/debug/0.X/0.9.X/0.9.7/ramdump-lateset/plugins/zzogl-pg/opengl/ZZKeyboard.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 314 - (show annotations) (download)
Sun Dec 26 18:56:19 2010 UTC (9 years, 2 months ago) by william
File size: 4098 byte(s)
** merged upstream r4049 (re-integration of GregMiscellaneous branch)
** applied patched to GigTranser.cpp in ZZOgl from r4140 to change 'static int count = 0;' to 'static int path1_count = 0;')
1 /* ZZ Open GL graphics plugin
2 * Copyright (c)2009-2010 zeydlitz@gmail.com, arcum42@gmail.com
3 * Based on Zerofrog's ZeroGS KOSMOS (c)2005-2008
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
18 */
19
20 // keyboard functions
21
22 #include "Util.h"
23 #include "GS.h"
24 #include "ZZoglShaders.h"
25 #include "Profile.h"
26 #include "GLWin.h"
27
28 extern int CurrentSavestate, g_GSMultiThreaded, g_nPixelShaderVer;
29 extern char *libraryName;
30 extern const unsigned char zgsversion;
31 extern unsigned char zgsrevision, zgsbuild, zgsminor;
32
33 extern bool SaveStateExists;
34
35 const char* s_aa[5] = { "AA none |", "AA 2x |", "AA 4x |", "AA 8x |", "AA 16x |" };
36 const char* pbilinear[] = { "off", "normal", "forced" };
37
38 extern void SetAA(int mode);
39
40 void ProcessBilinear()
41 {
42 FUNCLOG
43 char strtitle[256];
44
45 if (g_nPixelShaderVer == SHADER_REDUCED)
46 {
47 conf.bilinear = 0;
48 sprintf(strtitle, "reduced shaders don't support bilinear filtering");
49 }
50 else
51 {
52 conf.bilinear = (conf.bilinear + 1) % 3;
53 sprintf(strtitle, "bilinear filtering - %s", pbilinear[conf.bilinear]);
54 }
55 ZZLog::WriteToScreen(strtitle);
56 SaveConfig();
57 }
58
59 void ProcessInterlace()
60 {
61 FUNCLOG
62
63 char strtitle[256];
64 conf.interlace++;
65
66 if (conf.interlace > 2) conf.interlace = 0;
67
68 if (conf.interlace < 2)
69 sprintf(strtitle, "interlace on - mode %d", conf.interlace);
70 else
71 sprintf(strtitle, "interlace off");
72
73 ZZLog::WriteToScreen(strtitle);
74 SaveConfig();
75 }
76
77 void ProcessAASetting(bool reverse)
78 {
79 FUNCLOG
80
81 char strtitle[256];
82
83 if (reverse)
84 conf.decAA();
85 else
86 conf.incAA();
87
88 sprintf(strtitle, "anti-aliasing - %s", s_aa[conf.aa]);
89 SetAA(conf.aa);
90 ZZLog::WriteToScreen(strtitle);
91
92 SaveConfig();
93 }
94
95 void ProcessFPS()
96 {
97 FUNCLOG
98 g_bDisplayFPS ^= 1;
99 ZZLog::Debug_Log("Toggled FPS.");
100 }
101
102 void ProcessWireFrame()
103 {
104 FUNCLOG
105 char strtitle[256];
106
107 conf.zz_options.wireframe = !conf.zz_options.wireframe;
108 glPolygonMode(GL_FRONT_AND_BACK, (conf.wireframe()) ? GL_LINE : GL_FILL);
109 sprintf(strtitle, "wireframe rendering - %s", (conf.wireframe()) ? "on" : "off");
110 ZZLog::WriteToScreen(strtitle);
111 }
112
113 void ProcessHackSetting(bool reverse)
114 {
115 FUNCLOG
116
117 int hack = CurrentHack;
118
119 if (reverse)
120 {
121 hack--;
122
123 if (hack < 0) hack = HACK_NUMBER - 1;
124 }
125 else
126 {
127 hack++;
128
129 if (hack >= HACK_NUMBER) hack = 0;
130 }
131 ChangeCurrentHack(hack);
132
133 SaveConfig();
134 }
135
136 void ProcessSaveState()
137 {
138 FUNCLOG
139 char strtitle[256];
140 sprintf(strtitle, "Saving in savestate %d", CurrentSavestate);
141 SaveStateExists = true;
142 if (CurrentHack != 0) DisplayHack(CurrentHack);
143 }
144
145 void OnFKey(int key, int shift)
146 {
147 switch(key)
148 {
149 //case 1:
150 // ProcessSaveState();
151 // break;
152 case 5:
153 if (shift)
154 ProcessBilinear();
155 else
156 ProcessInterlace();
157 break;
158 case 6:
159 if (shift)
160 ProcessAASetting(true);
161 else
162 ProcessAASetting(false);
163 break;
164 case 7:
165 if (!shift)
166 ProcessFPS();
167 else
168 ProcessWireFrame();
169 break;
170 case 9:
171 if (shift)
172 ProcessHackSetting(true);
173 else
174 ProcessHackSetting(false);
175 break;
176 default:
177 break;
178 }
179 }
180
181 void WriteAA()
182 {
183 if (conf.aa != 0)
184 {
185 char strtitle[64];
186 sprintf(strtitle, "anti-aliasing - %s", s_aa[conf.aa]);
187 ZZLog::WriteToScreen(strtitle, 1000);
188 }
189 }
190
191 void WriteBilinear()
192 {
193 switch (conf.bilinear)
194 {
195 case 2:
196 ZZLog::WriteToScreen("bilinear filtering - forced", 1000);
197 break;
198
199 case 1:
200 ZZLog::WriteToScreen("bilinear filtering - normal", 1000);
201 break;
202
203 default:
204 break;
205 }
206 }

  ViewVC Help
Powered by ViewVC 1.1.22