Skip to content
Permalink
Browse files

Front: Added zoom option in emulation profile

  • Loading branch information
Gillou68310
Gillou68310 committed Oct 20, 2015
1 parent 20adeb2 commit 2a496cfa3c9a10493110492d36b798234f68b569
@@ -382,6 +382,22 @@
</string-array>

<string name="r4300Emulator_default" translatable="false">2</string>

<!-- Display zoom -->
<string-array name="displayZoom_entries" translatable="false">
<item>@string/displayZoom_entry100</item>
<item>@string/displayZoom_entry105</item>
<item>@string/displayZoom_entry110</item>
<item>@string/displayZoom_entry115</item>
</string-array>
<string-array name="displayZoom_values" translatable="false">
<item>100</item>
<item>105</item>
<item>110</item>
<item>115</item>
</string-array>

<string name="displayZoom_default" translatable="false">100</string>

<!-- Navigation Mode -->
<string-array name="navigationMode_entries" translatable="false">
@@ -355,6 +355,12 @@
<string name="r4300Emulator_entryPureInterpreter">Pure interpreter</string>
<string name="r4300Emulator_entryCachedInterpreter">Cached interpreter</string>
<string name="r4300Emulator_entryDynarec">Dynamic recompiler (dynarec)</string>

<string name="displayZoom_title">Zoom</string>
<string name="displayZoom_entry100">100%</string>
<string name="displayZoom_entry105">105%</string>
<string name="displayZoom_entry110">110%</string>
<string name="displayZoom_entry115">115%</string>

<string name="audioPlugin_title">Audio plugin</string>
<string name="audioPlugin_entryNone">None (audio disabled)</string>
@@ -18,6 +18,13 @@
mupen64:minimumValue="1"
mupen64:stepSize="1"
mupen64:units="%" />
<paulscode.android.mupen64plusae.preference.CompatibleListPreference
android:defaultValue="@string/displayZoom_default"
android:entries="@array/displayZoom_entries"
android:entryValues="@array/displayZoom_values"
android:key="displayZoom"
android:summary="@string/selectedValue"
android:title="@string/displayZoom_title" />
<paulscode.android.mupen64plusae.preference.CompatibleListPreference
android:defaultValue="@string/videoPlugin_default"
android:entries="@array/videoPlugin_entries"
@@ -250,8 +250,8 @@ public void onCreateEnd( Bundle savedInstanceState )
// Update the GameSurface size
mSurface.getHolder().setFixedSize( mGamePrefs.videoRenderWidth, mGamePrefs.videoRenderHeight );
FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) mSurface.getLayoutParams();
params.width = mGlobalPrefs.videoSurfaceWidth;
params.height = mGlobalPrefs.videoSurfaceHeight;
params.width = Math.round ( (float) mGlobalPrefs.videoSurfaceWidth * ( (float) mGamePrefs.videoSurfaceZoom / 100.f ) );
params.height = Math.round ( (float) mGlobalPrefs.videoSurfaceHeight * ( (float) mGamePrefs.videoSurfaceZoom / 100.f ) );
params.gravity = mGlobalPrefs.displayPosition | Gravity.CENTER_HORIZONTAL;
mSurface.setLayoutParams( params );

@@ -177,6 +177,9 @@
/** The height of the OpenGL rendering context, in pixels. */
public final int videoRenderHeight;

/** The zoom value applied to the viewing surface, in percent. */
public final int videoSurfaceZoom;

/** Game CRC */
public final String crc;

@@ -268,6 +271,8 @@ public GamePrefs( Context context, String romMd5, String crc, String headerName,
videoRenderWidth = Math.round( ( float ) ( globalPrefs.videoSurfaceWidth * resolution ) / 100.f );
videoRenderHeight = Math.round( ( float ) ( globalPrefs.videoSurfaceHeight * resolution ) / 100.f );

videoSurfaceZoom = getSafeInt( emulationProfile, "displayZoom", 100 );

// Touchscreen prefs
isTouchscreenEnabled = touchscreenProfile != null;

0 comments on commit 2a496cf

Please sign in to comment.
You can’t perform that action at this time.