summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStelios Tsampas <loathingkernel@gmail.com>2018-12-24 19:11:06 +0200
committerStelios Tsampas <loathingkernel@gmail.com>2018-12-24 19:11:06 +0200
commit91320854449bb88cdcec8c6bf89af859372e1ff5 (patch)
tree4179652ae3e2d8c0e73f4d41776f958922765c49
parent7ce3857e14aa0e6e00c52b918661933a2b2ecc39 (diff)
Add Line Hack Mode selection box for Linux UI
-rw-r--r--plugins/peopsxgl/cfg.c6
-rw-r--r--plugins/peopsxgl/gpucfg/main.c33
-rw-r--r--plugins/peopsxgl/gpucfg/peopsxgl.ui51
3 files changed, 81 insertions, 9 deletions
diff --git a/plugins/peopsxgl/cfg.c b/plugins/peopsxgl/cfg.c
index e43fa116..0535c5ea 100644
--- a/plugins/peopsxgl/cfg.c
+++ b/plugins/peopsxgl/cfg.c
@@ -111,6 +111,11 @@ void ReadConfigFile()
if(iFrameReadType==4) bFullVRam=TRUE;
else bFullVRam=FALSE;
+ strcpy(t,"\nLineHackMode");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
+ if(p) iLineHackMode=atoi(p+len);
+ if(iLineHackMode<0) iLineHackMode=0;
+ if(iLineHackMode>2) iLineHackMode=2;
+
strcpy(t,"\nTexFilter");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
if(p) iFilterType=atoi(p+len);
if(iFilterType<0) iFilterType=0;
@@ -239,6 +244,7 @@ void ReadConfig(void) // read config (linux fil
bUseFixes=FALSE;
iFrameTexType=1;
iFrameReadType=0;
+ iLineHackMode=0;
bUse15bitMdec=FALSE;
iShowFPS=0;
bGteAccuracy=0;
diff --git a/plugins/peopsxgl/gpucfg/main.c b/plugins/peopsxgl/gpucfg/main.c
index b29c85fb..bfa1c330 100644
--- a/plugins/peopsxgl/gpucfg/main.c
+++ b/plugins/peopsxgl/gpucfg/main.c
@@ -33,6 +33,7 @@ GtkWidget *window,
*cbxOffscreen,
*cbxFBTex,
*cbxFBAccess,
+ *cbxLineHackMode,
*chkMaskDetect,
*chkOpaquePass,
*chkAdvancedBlend,
@@ -98,7 +99,7 @@ void on_btnSave_clicked( GObject *object, gpointer user_data ) {
// Print data to the config file
fprintf( out, "\nResX = %i", gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( spinXSize ) ) );
- fprintf( out, "\nResY = %i", gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( spinYSize ) ) );
+ fprintf( out, "\nResY = %i", gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( spinYSize ) ) );
fprintf( out, "\nKeepRatio = %i", gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( chkKeepRatio ) ) );
fprintf( out, "\nForceRatio43 = %i", gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( chkForceRatio43 ) ) );
fprintf( out, "\nDithering = %i", gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( chkDithering ) ) );
@@ -106,7 +107,7 @@ void on_btnSave_clicked( GObject *object, gpointer user_data ) {
fprintf( out, "\nTexQuality = %i", gtk_combo_box_get_active( GTK_COMBO_BOX( cbxTexQuality ) ) );
fprintf( out, "\nTexFilter = %i", gtk_combo_box_get_active( GTK_COMBO_BOX( cbxTexFiltering ) ) );
fprintf( out, "\nHiResTextures = %i", gtk_combo_box_get_active( GTK_COMBO_BOX( cbxHiResTex ) ) );
- fprintf( out, "\nVRamSize = %i", gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( spinVRam ) ) );
+ fprintf( out, "\nVRamSize = %i", gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( spinVRam ) ) );
fprintf( out, "\nShowFPS = %i", gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( chkShowFPS ) ) );
fprintf( out, "\nUseFrameLimit = %i", gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( chkUseFPSLimit ) ) );
fprintf( out, "\nFPSDetection = %i", gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( radFPSLimitAuto ) ) );
@@ -115,6 +116,7 @@ void on_btnSave_clicked( GObject *object, gpointer user_data ) {
fprintf( out, "\nOffscreenDrawing = %i", gtk_combo_box_get_active( GTK_COMBO_BOX( cbxOffscreen ) ) );
fprintf( out, "\nFrameTextures = %i", gtk_combo_box_get_active( GTK_COMBO_BOX( cbxFBTex ) ) );
fprintf( out, "\nFrameAccess = %i", gtk_combo_box_get_active( GTK_COMBO_BOX( cbxFBAccess ) ) );
+ fprintf( out, "\nLineHackMode = %i", gtk_combo_box_get_active( GTK_COMBO_BOX( cbxLineHackMode ) ) );
fprintf( out, "\nMaskDetect = %i", gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( chkMaskDetect ) ) );
fprintf( out, "\nOpaquePass = %i", gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( chkOpaquePass ) ) );
fprintf( out, "\nAdvancedBlend = %i", gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( chkAdvancedBlend ) ) );
@@ -157,6 +159,7 @@ void on_btnFast_clicked( GObject *object, gpointer user_data ) {
gtk_combo_box_set_active( GTK_COMBO_BOX( cbxOffscreen ), 1 );
gtk_combo_box_set_active( GTK_COMBO_BOX( cbxFBTex ), 1 );
gtk_combo_box_set_active( GTK_COMBO_BOX( cbxFBAccess ), 0 );
+ gtk_combo_box_set_active( GTK_COMBO_BOX( cbxLineHackMode ), 0 );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( chkMaskDetect ), 0 );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( chkOpaquePass ), 1 );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( chkAdvancedBlend ), 0 );
@@ -190,6 +193,7 @@ void on_btnBeautiful_clicked( GObject *object, gpointer user_data ) {
gtk_combo_box_set_active( GTK_COMBO_BOX( cbxOffscreen ), 3 );
gtk_combo_box_set_active( GTK_COMBO_BOX( cbxFBTex ), 2 );
gtk_combo_box_set_active( GTK_COMBO_BOX( cbxFBAccess ), 0 );
+ gtk_combo_box_set_active( GTK_COMBO_BOX( cbxLineHackMode ), 0 );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( chkMaskDetect ), 1 );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( chkOpaquePass ), 1 );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( chkAdvancedBlend ), 1 );
@@ -200,8 +204,8 @@ void on_btnBeautiful_clicked( GObject *object, gpointer user_data ) {
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( chkLineMode ), 0 );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( chkAntiAlias ), 0 );
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( chkOGLExtensions ), 1 );
- gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( chkScreenSmoothing ), 0 );
- gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( chkGteAccuracy ), 0 );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( chkScreenSmoothing ), 0 );
+ gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( chkGteAccuracy ), 0 );
}
// Callbacks used to toggle the sensitivity of some parts of the GUI
@@ -305,7 +309,8 @@ int main( int argc, char **argv ) {
cbxOffscreen = GTK_WIDGET( gtk_builder_get_object( builder, "cbxOffscreen" ) );
cbxFBTex = GTK_WIDGET( gtk_builder_get_object( builder, "cbxFBTex" ) );
cbxFBAccess = GTK_WIDGET( gtk_builder_get_object( builder, "cbxFBAccess" ) );
- chkMaskDetect = GTK_WIDGET( gtk_builder_get_object( builder, "chkMaskDetect" ) );
+ cbxLineHackMode = GTK_WIDGET( gtk_builder_get_object( builder, "cbxLineHackMode" ) );
+ chkMaskDetect = GTK_WIDGET( gtk_builder_get_object( builder, "chkMaskDetect" ) );
chkOpaquePass = GTK_WIDGET( gtk_builder_get_object( builder, "chkOpaquePass" ) );
chkAdvancedBlend = GTK_WIDGET( gtk_builder_get_object( builder, "chkAdvancedBlend" ) );
chkScanLines = GTK_WIDGET( gtk_builder_get_object( builder, "chkScanLines" ) );
@@ -541,8 +546,8 @@ int main( int argc, char **argv ) {
}
}
gtk_combo_box_set_active( GTK_COMBO_BOX( cbxOffscreen ), val );
-
- val = 1;
+
+ val = 1;
if ( pB ) {
strcpy( t, "\nFrameTextures" );
p = strstr( pB, t );
@@ -553,7 +558,7 @@ int main( int argc, char **argv ) {
}
}
gtk_combo_box_set_active( GTK_COMBO_BOX( cbxFBTex ), val );
-
+
val = 0;
if ( pB ) {
strcpy( t, "\nFrameAccess" );
@@ -566,6 +571,18 @@ int main( int argc, char **argv ) {
}
gtk_combo_box_set_active( GTK_COMBO_BOX( cbxFBAccess ), val );
+ val = 0;
+ if ( pB ) {
+ strcpy( t, "\nLineHackMode" );
+ p = strstr( pB, t );
+ if ( p ) {
+ p = strstr( p, "=" );
+ len = 1;
+ val = atoi( p + len );
+ }
+ }
+ gtk_combo_box_set_active( GTK_COMBO_BOX( cbxLineHackMode ), val );
+
val = 0;
if ( pB ) {
strcpy( t, "\nMaskDetect" );
diff --git a/plugins/peopsxgl/gpucfg/peopsxgl.ui b/plugins/peopsxgl/gpucfg/peopsxgl.ui
index c53a9852..b6cf143e 100644
--- a/plugins/peopsxgl/gpucfg/peopsxgl.ui
+++ b/plugins/peopsxgl/gpucfg/peopsxgl.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.19.0 -->
+<!-- Generated with glade 3.22.1 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkAdjustment" id="f">
@@ -144,6 +144,23 @@
</row>
</data>
</object>
+ <object class="GtkListStore" id="liststore7">
+ <columns>
+ <!-- column-name item -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">Disabled</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Default (Doom, Hexen, Soul Blade)</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Aggressive (Dark Forces, Duke Nukem)</col>
+ </row>
+ </data>
+ </object>
<object class="GtkAdjustment" id="s">
<property name="lower">-1</property>
<property name="upper">255</property>
@@ -172,6 +189,9 @@
<property name="resizable">False</property>
<property name="window_position">center</property>
<property name="type_hint">normal</property>
+ <child>
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox3">
<property name="visible">True</property>
@@ -818,6 +838,35 @@
<property name="top_attach">2</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="label17">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Line Hack Mode:</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="cbxLineHackMode">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="model">liststore7</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderertext7"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">3</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>