Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Commit d9f8187

Browse files
Merge pull request #1429 from reicast/ac/ui_cleanup
Android/UI: UI cleanup (themes, views, scaling, etc)
2 parents d436c30 + caf78e9 commit d9f8187

File tree

11 files changed

+41
-29
lines changed

11 files changed

+41
-29
lines changed

core/nullDC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,10 @@ void LoadSettings()
319319
// Configured on a per-game basis
320320
settings.dynarec.safemode = 0;
321321
settings.rend.ModifierVolumes = 1;
322-
#endif
323322

324323
settings.pvr.HashLogFile = cfgLoadStr("testing", "ta.HashLogFile", "");
325324
settings.pvr.HashCheckFile = cfgLoadStr("testing", "ta.HashCheckFile", "");
325+
#endif
326326

327327
#if SUPPORT_DISPMANX
328328
settings.dispmanx.Width = cfgLoadInt("dispmanx","width",640);

shell/android-studio/reicast/src/main/java/com/reicast/emulator/Emulator.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class Emulator extends Application {
1919
public static final String pref_limitfps = "limit_fps";
2020
public static final String pref_nosound = "sound_disabled";
2121
public static final String pref_mipmaps = "use_mipmaps";
22-
public static final String pref_widescreen = "stretch_view";
22+
public static final String pref_resolution = "resolution";
2323
public static final String pref_frameskip = "frame_skip";
2424
public static final String pref_pvrrender = "pvr_render";
2525
public static final String pref_syncedrender = "synced_render";
@@ -39,6 +39,7 @@ public class Emulator extends Application {
3939
public static boolean nosound = false;
4040
public static boolean mipmaps = true;
4141
public static boolean widescreen = false;
42+
public static boolean crtview = false;
4243
public static boolean subdivide = false;
4344
public static int frameskip = 0;
4445
public static boolean pvrrender = false;
@@ -60,7 +61,8 @@ public void getConfigurationPrefs(SharedPreferences mPrefs) {
6061
Emulator.limitfps = mPrefs.getBoolean(pref_limitfps, limitfps);
6162
Emulator.nosound = mPrefs.getBoolean(pref_nosound, nosound);
6263
Emulator.mipmaps = mPrefs.getBoolean(pref_mipmaps, mipmaps);
63-
Emulator.widescreen = mPrefs.getBoolean(pref_widescreen, widescreen);
64+
Emulator.widescreen = mPrefs.getInt(pref_resolution, 0) == 2;
65+
Emulator.crtview = mPrefs.getInt(pref_resolution, 0) == 1;
6466
Emulator.frameskip = mPrefs.getInt(pref_frameskip, frameskip);
6567
Emulator.pvrrender = mPrefs.getBoolean(pref_pvrrender, pvrrender);
6668
Emulator.syncedrender = mPrefs.getBoolean(pref_syncedrender, syncedrender);

shell/android-studio/reicast/src/main/java/com/reicast/emulator/config/OptionsFragment.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -365,15 +365,8 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
365365
mipmap_opt.setChecked(mPrefs.getBoolean(Emulator.pref_mipmaps, Emulator.mipmaps));
366366
mipmap_opt.setOnCheckedChangeListener(mipmaps_option);
367367

368-
OnCheckedChangeListener full_screen = new OnCheckedChangeListener() {
369-
370-
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
371-
mPrefs.edit().putBoolean(Emulator.pref_widescreen, isChecked).apply();
372-
}
373-
};
374-
CompoundButton stretch_view = (CompoundButton) getView().findViewById(R.id.stretch_option);
375-
stretch_view.setChecked(mPrefs.getBoolean(Emulator.pref_widescreen, Emulator.widescreen));
376-
stretch_view.setOnCheckedChangeListener(full_screen);
368+
setSpinner(R.array.resolution, R.id.resolution_spinner,
369+
Emulator.pref_resolution, 0, false);
377370

378371
int frameskip = mPrefs.getInt(Emulator.pref_frameskip, Emulator.frameskip);
379372

@@ -695,7 +688,7 @@ private void resetEmuSettings() {
695688
mPrefs.edit().remove(Emulator.pref_broadcast).apply();
696689
mPrefs.edit().remove(Emulator.pref_limitfps).apply();
697690
mPrefs.edit().remove(Emulator.pref_mipmaps).apply();
698-
mPrefs.edit().remove(Emulator.pref_widescreen).apply();
691+
mPrefs.edit().remove(Emulator.pref_resolution).apply();
699692
mPrefs.edit().remove(Emulator.pref_frameskip).apply();
700693
mPrefs.edit().remove(Emulator.pref_pvrrender).apply();
701694
mPrefs.edit().remove(Emulator.pref_syncedrender).apply();
@@ -715,6 +708,7 @@ private void resetEmuSettings() {
715708
Emulator.limitfps = true;
716709
Emulator.mipmaps = true;
717710
Emulator.widescreen = false;
711+
Emulator.crtview = false;
718712
Emulator.frameskip = 0;
719713
Emulator.pvrrender = false;
720714
Emulator.syncedrender = false;

shell/android-studio/reicast/src/main/java/com/reicast/emulator/emu/GL2JNIView.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,8 @@ public void onSurfaceChanged(GL10 gl,int width,int height)
524524
gl.glViewport(0, 0, width, height);
525525
if (Emulator.widescreen) {
526526
JNIdc.rendinit(width, height);
527+
} else if (Emulator.crtview) {
528+
JNIdc.rendinit(640, 480);
527529
} else {
528530
JNIdc.rendinit(height * (4 / 3), height);
529531
}
@@ -638,7 +640,7 @@ void showMessage(final String msg) {
638640
handler.post(new Runnable() {
639641
public void run() {
640642
Log.d(context.getPackageName(), msg);
641-
Toast.makeText(context.getApplicationContext(), msg, Toast.LENGTH_SHORT).show();
643+
Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
642644
}
643645
});
644646
}

shell/android-studio/reicast/src/main/res/layout-v14/configure_fragment.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,13 @@
307307
android:gravity="center_vertical" >
308308

309309
<TextView
310-
android:id="@+id/stretch_text"
310+
android:id="@+id/resolution_text"
311311
android:layout_width="wrap_content"
312312
android:layout_height="wrap_content"
313313
android:layout_weight="0.5"
314314
android:ems="10"
315315
android:gravity="center_vertical|left"
316-
android:text="@string/select_stretch" />
316+
android:text="@string/select_resolution" />
317317

318318
<LinearLayout
319319
android:layout_width="wrap_content"
@@ -322,11 +322,12 @@
322322
android:gravity="right"
323323
android:orientation="vertical" >
324324

325-
<Switch
326-
android:id="@+id/stretch_option"
325+
<Spinner
326+
android:id="@+id/resolution_spinner"
327327
android:layout_width="wrap_content"
328-
android:layout_height="wrap_content"
329-
android:focusable="true" />
328+
android:layout_height="0dp"
329+
android:layout_weight="1"
330+
android:ems="10" />
330331
</LinearLayout>
331332
</TableRow>
332333

shell/android-studio/reicast/src/main/res/layout/configure_fragment.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,13 +307,13 @@
307307
android:gravity="center_vertical" >
308308

309309
<TextView
310-
android:id="@+id/stretch_text"
310+
android:id="@+id/resolution_text"
311311
android:layout_width="wrap_content"
312312
android:layout_height="wrap_content"
313313
android:layout_weight="0.5"
314314
android:ems="10"
315315
android:gravity="center_vertical|left"
316-
android:text="@string/select_stretch" />
316+
android:text="@string/select_resolution" />
317317

318318
<LinearLayout
319319
android:layout_width="wrap_content"
@@ -322,11 +322,12 @@
322322
android:gravity="right"
323323
android:orientation="vertical" >
324324

325-
<Checkbox
326-
android:id="@+id/stretch_option"
325+
<Spinner
326+
android:id="@+id/resolution_spinner"
327327
android:layout_width="wrap_content"
328-
android:layout_height="wrap_content"
329-
android:focusable="true" />
328+
android:layout_height="0dp"
329+
android:layout_weight="1"
330+
android:ems="10" />
330331
</LinearLayout>
331332
</TableRow>
332333

shell/android-studio/reicast/src/main/res/menu-v23/activity_main.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,8 @@
3434
android:id="@+id/about_menu"
3535
android:icon="@drawable/ic_info_outline"
3636
android:title="@string/about" />
37+
<item
38+
android:id="@+id/version_spacer"
39+
android:title=""/>
3740

3841
</menu>

shell/android-studio/reicast/src/main/res/menu/activity_main.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,7 @@
2525
<item android:title="@string/about"
2626
android:id="@+id/about_menu"
2727
android:icon="@mipmap/menu_question" />
28+
<item
29+
android:id="@+id/version_spacer"
30+
android:title=""/>
2831
</menu>

shell/android-studio/reicast/src/main/res/values/colors.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
<color name="colorBluePrimary">#226696</color>
1111
<color name="colorBluePrimaryDark">#164f6e</color>
12-
<color name="colorBlueAccent">#e040fb</color>
13-
<color name="colorBlueAccentDark">#9c27b0</color>
12+
<color name="colorBlueAccent">#ffca28</color>
13+
<color name="colorBlueAccentDark">#ffb74d</color>
1414
<color name="colorBlueText">#e0e0e0</color>
1515
<color name="colorBlueTint">#072540</color>
1616

shell/android-studio/reicast/src/main/res/values/donottranslate.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@
7777
<item>Purupuru</item>
7878
</string-array>
7979

80+
<string-array name="resolution">
81+
<item>Standard</item>
82+
<item>CRT (640x480)</item>
83+
<item>Widescreen</item>
84+
</string-array>
85+
8086
<string-array name="right_stick">
8187
<item>None</item>
8288
<item>L / R</item>

0 commit comments

Comments
 (0)