Skip to content

Commit

Permalink
fx launch from other frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
weihuoya committed Aug 4, 2022
1 parent a47e3b5 commit b192096
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public interface InputObject {
private boolean mIsLandscape = false;
private boolean mInEditMode = false;
private boolean mBeingMoved = false;
private int mInEditPosX = 0;
private int mInEditPosY = 0;
private InputObject mInputBeingConfigured;
private InputOverlayPointer mOverlayPointer;
private Paint mPaint;
Expand Down Expand Up @@ -279,6 +281,8 @@ public boolean onTouchWhileEditing(MotionEvent event) {
return false;
}
mBeingMoved = false;
mInEditPosX = pointerX;
mInEditPosY = pointerY;
for (InputObject input : mInputObjects) {
if (input.getBounds().contains(pointerX, pointerY)) {
mInputBeingConfigured = input;
Expand All @@ -299,7 +303,7 @@ public boolean onTouchWhileEditing(MotionEvent event) {
case MotionEvent.ACTION_POINTER_UP:
if (mInputBeingConfigured != null) {
int id = mInputBeingConfigured.getButtonId();
if (mBeingMoved) {
if (mBeingMoved && (mInEditPosX != pointerX || mInEditPosY != pointerY)) {
saveControlPosition(id, mInputBeingConfigured.getBounds());
} else {
mInputVisibles.put(id, !mInputVisibles.get(id));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ public final class EmulationActivity extends AppCompatActivity {
private class InitTask extends AsyncTask<Context, Void, Map<Integer, Bitmap>> {
@Override
protected Map<Integer, Bitmap> doInBackground(Context... contexts) {
if (!CitraDirectory.isInitialized()) {
CitraDirectory.start(contexts[0]);
}
Settings settings = new Settings();
settings.loadSettings(mGameId);
SettingSection section = settings.getSection(Settings.SECTION_INI_CORE);
Expand Down Expand Up @@ -114,6 +111,15 @@ protected void onCreate(Bundle savedInstanceState) {
mGamePath = savedInstanceState.getString(EXTRA_GAME_PATH);
}

if (!CitraDirectory.isInitialized()) {
CitraDirectory.start(this);
}

if (mGameId == null || mGameId.isEmpty()) {
mGameId = NativeLibrary.GetAppId(mGamePath);
mGameName = NativeLibrary.GetAppTitle(mGamePath);
}

// Find or create the EmulationFragment
mEmulationFragment = (EmulationFragment)getSupportFragmentManager().findFragmentById(
R.id.fragment_emulation);
Expand Down

2 comments on commit b192096

@daeklo4
Copy link

@daeklo4 daeklo4 commented on b192096 Aug 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please optimized for alcatel 1s 2020

@daeklo4
Copy link

@daeklo4 daeklo4 commented on b192096 Aug 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mediatek processor

Please sign in to comment.