Skip to content

Commit

Permalink
front: No longer allowing selection of unsupported GLideN64 built in
Browse files Browse the repository at this point in the history
profiles. Profiles are unsupported if they fail the OpenGL ES version
check.
  • Loading branch information
fzurita committed Feb 14, 2016
1 parent 3faf1c1 commit 0be7228
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
Expand Up @@ -23,6 +23,7 @@
import org.mupen64plusae.v3.alpha.R;

import paulscode.android.mupen64plusae.ActivityHelper;
import paulscode.android.mupen64plusae.persistent.AppData;
import paulscode.android.mupen64plusae.persistent.ConfigFile;
import paulscode.android.mupen64plusae.persistent.GlobalPrefs;

Expand Down Expand Up @@ -63,4 +64,22 @@ protected int getWindowTitleResource()
{
return R.string.ManageEmulationProfilesActivity_title;
}

@Override
protected void refreshList()
{
super.refreshList();

String openGlVersion = AppData.getOpenGlEsVersion(this);

if(openGlVersion.equals("2.0"))
{
RemoveProfile("GlideN64-GLES-3.0");
RemoveProfile("GlideN64-GLES-3.1");
}
else if(openGlVersion.equals("3.0"))
{
RemoveProfile("GlideN64-GLES-3.1");
}
}
}
Expand Up @@ -45,6 +45,7 @@
import android.support.v4.app.FragmentManager;
import android.support.v7.preference.PreferenceManager;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
Expand Down Expand Up @@ -438,7 +439,7 @@ private String getBuiltinVisibilityKey()
return "builtinsVisible" + getClass().getSimpleName();
}

private void refreshList()
protected void refreshList()
{
// Get the profiles to be shown to the user
mProfileList.clear();
Expand Down Expand Up @@ -504,4 +505,10 @@ public View getView( int position, View convertView, ViewGroup parent )
return view;
}
}

protected void RemoveProfile(String profileName)
{
Profile profile = new Profile(true, profileName, null);
boolean test = mProfileList.remove(profile);
}
}
9 changes: 9 additions & 0 deletions src/paulscode/android/mupen64plusae/profile/Profile.java
Expand Up @@ -260,4 +260,13 @@ public int compareTo( Profile another )
{
return this.name.compareToIgnoreCase( another.name );
}

@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}

return this.name.compareToIgnoreCase( ((Profile)obj).name ) == 0;
}
}

0 comments on commit 0be7228

Please sign in to comment.