Merge pull request #261 from NoblesseOblige/master
Added support for immersive mode on KitKat devices [Rehash]
This commit is contained in:
commit
d68e72b37b
|
@ -34,6 +34,7 @@
|
||||||
//HOST_OS
|
//HOST_OS
|
||||||
#define OS_WINDOWS 0x10000001
|
#define OS_WINDOWS 0x10000001
|
||||||
#define OS_LINUX 0x10000002
|
#define OS_LINUX 0x10000002
|
||||||
|
#define OS_DARWIN 0x10000003
|
||||||
|
|
||||||
//HOST_CPU
|
//HOST_CPU
|
||||||
#define CPU_X86 0x20000001
|
#define CPU_X86 0x20000001
|
||||||
|
@ -69,6 +70,10 @@
|
||||||
#define HOST_OS OS_LINUX
|
#define HOST_OS OS_LINUX
|
||||||
#define HOST_CPU CPU_X86
|
#define HOST_CPU CPU_X86
|
||||||
#define BUILD_COMPILER COMPILER_GCC
|
#define BUILD_COMPILER COMPILER_GCC
|
||||||
|
#elif TARGET_IPHONE
|
||||||
|
#define HOST_OS OS_DARWIN
|
||||||
|
#define HOST_CPU CPU_ARM
|
||||||
|
#define BUILD_COMPILER COMPILER_GCC
|
||||||
#else
|
#else
|
||||||
#error Invalid Target: TARGET_* not defined
|
#error Invalid Target: TARGET_* not defined
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.reicast.emulator;
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.Intent;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
@ -13,6 +14,7 @@ import android.view.ViewGroup.LayoutParams;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView.ScaleType;
|
import android.widget.ImageView.ScaleType;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.PopupWindow;
|
import android.widget.PopupWindow;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
@ -20,11 +22,10 @@ import android.widget.Toast;
|
||||||
public class EditVJoyActivity extends Activity {
|
public class EditVJoyActivity extends Activity {
|
||||||
GL2JNIView mView;
|
GL2JNIView mView;
|
||||||
GL2JNIViewV6 mView6;
|
GL2JNIViewV6 mView6;
|
||||||
OnScreenMenu menu;
|
|
||||||
PopupWindow popUp;
|
PopupWindow popUp;
|
||||||
LayoutParams params;
|
LayoutParams params;
|
||||||
|
|
||||||
public static float[][] vjoy_d_cached;
|
private float[][] vjoy_d_cached;
|
||||||
|
|
||||||
View addbut(int x, OnClickListener ocl) {
|
View addbut(int x, OnClickListener ocl) {
|
||||||
ImageButton but = new ImageButton(this);
|
ImageButton but = new ImageButton(this);
|
||||||
|
@ -40,9 +41,7 @@ public class EditVJoyActivity extends Activity {
|
||||||
protected void onCreate(Bundle icicle) {
|
protected void onCreate(Bundle icicle) {
|
||||||
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||||
|
|
||||||
menu = new OnScreenMenu(this);
|
popUp = createVJoyPopup();
|
||||||
menu.setGLView(mView, mView6);
|
|
||||||
popUp = menu.createVjoyPopup();
|
|
||||||
|
|
||||||
// Call parent onCreate()
|
// Call parent onCreate()
|
||||||
super.onCreate(icicle);
|
super.onCreate(icicle);
|
||||||
|
@ -96,6 +95,50 @@ public class EditVJoyActivity extends Activity {
|
||||||
mView.onResume();
|
mView.onResume();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PopupWindow createVJoyPopup() {
|
||||||
|
final PopupWindow popUp = new PopupWindow(this);
|
||||||
|
int p = OnScreenMenu.getPixelsFromDp(60, this);
|
||||||
|
params = new LayoutParams(p, p);
|
||||||
|
|
||||||
|
LinearLayout hlay = new LinearLayout(this);
|
||||||
|
|
||||||
|
hlay.setOrientation(LinearLayout.HORIZONTAL);
|
||||||
|
|
||||||
|
hlay.addView(addbut(R.drawable.apply, new OnClickListener() {
|
||||||
|
public void onClick(View v) {
|
||||||
|
Intent inte = new Intent(EditVJoyActivity.this, MainActivity.class);
|
||||||
|
startActivity(inte);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}), params);
|
||||||
|
|
||||||
|
hlay.addView(addbut(R.drawable.reset, new OnClickListener() {
|
||||||
|
public void onClick(View v) {
|
||||||
|
// Reset VJoy positions and scale
|
||||||
|
if (MainActivity.force_gpu) {
|
||||||
|
mView6.resetCustomVjoyValues();
|
||||||
|
} else {
|
||||||
|
mView.resetCustomVjoyValues();
|
||||||
|
}
|
||||||
|
popUp.dismiss();
|
||||||
|
}
|
||||||
|
}), params);
|
||||||
|
|
||||||
|
hlay.addView(addbut(R.drawable.close, new OnClickListener() {
|
||||||
|
public void onClick(View v) {
|
||||||
|
if (MainActivity.force_gpu) {
|
||||||
|
mView6.restoreCustomVjoyValues(vjoy_d_cached);
|
||||||
|
} else {
|
||||||
|
mView.restoreCustomVjoyValues(vjoy_d_cached);
|
||||||
|
}
|
||||||
|
popUp.dismiss();
|
||||||
|
}
|
||||||
|
}), params);
|
||||||
|
|
||||||
|
popUp.setContentView(hlay);
|
||||||
|
return popUp;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
||||||
if (keyCode == KeyEvent.KEYCODE_MENU
|
if (keyCode == KeyEvent.KEYCODE_MENU
|
||||||
|
@ -108,7 +151,6 @@ public class EditVJoyActivity extends Activity {
|
||||||
}
|
}
|
||||||
popUp.update(LayoutParams.WRAP_CONTENT,
|
popUp.update(LayoutParams.WRAP_CONTENT,
|
||||||
LayoutParams.WRAP_CONTENT);
|
LayoutParams.WRAP_CONTENT);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
popUp.dismiss();
|
popUp.dismiss();
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,8 +53,7 @@ public class GL2JNIActivity extends Activity {
|
||||||
|
|
||||||
prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
ConfigureFragment.getCurrentConfiguration(prefs);
|
ConfigureFragment.getCurrentConfiguration(prefs);
|
||||||
menu = new OnScreenMenu(this, prefs);
|
menu = new OnScreenMenu(GL2JNIActivity.this, prefs);
|
||||||
menu.setGLView(mView, mView6);
|
|
||||||
popUp = menu.createPopup();
|
popUp = menu.createPopup();
|
||||||
/*
|
/*
|
||||||
* try { //int rID =
|
* try { //int rID =
|
||||||
|
|
|
@ -26,6 +26,7 @@ import android.util.Log;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.ScaleGestureDetector;
|
import android.view.ScaleGestureDetector;
|
||||||
import android.view.ScaleGestureDetector.SimpleOnScaleGestureListener;
|
import android.view.ScaleGestureDetector.SimpleOnScaleGestureListener;
|
||||||
|
import android.view.View.OnSystemUiVisibilityChangeListener;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
|
|
||||||
|
@ -217,6 +218,19 @@ class GL2JNIView extends GLSurfaceView
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.editVjoyMode = editVjoyMode;
|
this.editVjoyMode = editVjoyMode;
|
||||||
setKeepScreenOn(true);
|
setKeepScreenOn(true);
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
|
setOnSystemUiVisibilityChangeListener (new OnSystemUiVisibilityChangeListener() {
|
||||||
|
public void onSystemUiVisibilityChange(int visibility) {
|
||||||
|
if ((visibility & SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
|
||||||
|
GL2JNIView.this.setSystemUiVisibility(
|
||||||
|
SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||||
|
| SYSTEM_UI_FLAG_FULLSCREEN
|
||||||
|
| SYSTEM_UI_FLAG_HIDE_NAVIGATION);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
vib=(Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
|
vib=(Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
|
||||||
|
|
||||||
|
|
|
@ -212,6 +212,19 @@ class GL2JNIViewV6 extends GLSurfaceView
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.editVjoyMode = editVjoyMode;
|
this.editVjoyMode = editVjoyMode;
|
||||||
setKeepScreenOn(true);
|
setKeepScreenOn(true);
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
|
setOnSystemUiVisibilityChangeListener (new OnSystemUiVisibilityChangeListener() {
|
||||||
|
public void onSystemUiVisibilityChange(int visibility) {
|
||||||
|
if ((visibility & SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
|
||||||
|
GL2JNIViewV6.this.setSystemUiVisibility(
|
||||||
|
SYSTEM_UI_FLAG_IMMERSIVE_STICKY
|
||||||
|
| SYSTEM_UI_FLAG_FULLSCREEN
|
||||||
|
| SYSTEM_UI_FLAG_HIDE_NAVIGATION);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
vib=(Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
|
vib=(Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
|
||||||
|
|
||||||
|
|
|
@ -7,51 +7,41 @@ import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.view.Gravity;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup.LayoutParams;
|
import android.view.ViewGroup.LayoutParams;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
|
import android.widget.ImageView.ScaleType;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.PopupWindow;
|
import android.widget.PopupWindow;
|
||||||
import android.widget.ImageView.ScaleType;
|
|
||||||
|
|
||||||
public class OnScreenMenu {
|
public class OnScreenMenu {
|
||||||
|
|
||||||
private GL2JNIActivity mContext;
|
private GL2JNIActivity mContext;
|
||||||
private EditVJoyActivity vContext;
|
|
||||||
private SharedPreferences prefs;
|
private SharedPreferences prefs;
|
||||||
LayoutParams params;
|
LayoutParams params;
|
||||||
private int frameskip;
|
private int frameskip;
|
||||||
private boolean widescreen;
|
private boolean widescreen;
|
||||||
private boolean limitframes;
|
private boolean limitframes;
|
||||||
|
|
||||||
GL2JNIView mView;
|
|
||||||
GL2JNIViewV6 mView6;
|
|
||||||
|
|
||||||
private File sdcard = Environment.getExternalStorageDirectory();
|
private File sdcard = Environment.getExternalStorageDirectory();
|
||||||
private String home_directory = sdcard + "/dc";
|
private String home_directory = sdcard + "/dc";
|
||||||
|
|
||||||
public OnScreenMenu(GL2JNIActivity mContext, SharedPreferences prefs) {
|
public OnScreenMenu(Context mContext, SharedPreferences prefs) {
|
||||||
this.mContext = mContext;
|
if (mContext instanceof GL2JNIActivity) {
|
||||||
this.prefs = prefs;
|
this.mContext = (GL2JNIActivity) mContext;
|
||||||
home_directory = prefs.getString("home_directory", home_directory);
|
}
|
||||||
widescreen = ConfigureFragment.widescreen;
|
if (prefs != null) {
|
||||||
frameskip = ConfigureFragment.frameskip;
|
this.prefs = prefs;
|
||||||
|
home_directory = prefs.getString("home_directory", home_directory);
|
||||||
|
widescreen = ConfigureFragment.widescreen;
|
||||||
|
frameskip = ConfigureFragment.frameskip;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public OnScreenMenu(EditVJoyActivity vContext) {
|
|
||||||
this.vContext = vContext;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGLView(GL2JNIView mView, GL2JNIViewV6 mView6) {
|
|
||||||
this.mView = mView;
|
|
||||||
this.mView6 = mView6;
|
|
||||||
}
|
|
||||||
|
|
||||||
PopupWindow createPopup() {
|
PopupWindow createPopup() {
|
||||||
final PopupWindow popUp = new PopupWindow(mContext);
|
final PopupWindow popUp = new PopupWindow(mContext);
|
||||||
|
|
||||||
int p = getPixelsFromDp(60, mContext);
|
int p = getPixelsFromDp(60, mContext);
|
||||||
params = new LayoutParams(p, p);
|
params = new LayoutParams(p, p);
|
||||||
|
|
||||||
|
@ -61,47 +51,47 @@ public class OnScreenMenu {
|
||||||
|
|
||||||
hlay.addView(addbut(R.drawable.close, new OnClickListener() {
|
hlay.addView(addbut(R.drawable.close, new OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Intent inte = new Intent(mContext,
|
Intent inte = new Intent(mContext, MainActivity.class);
|
||||||
MainActivity.class);
|
|
||||||
mContext.startActivity(inte);
|
mContext.startActivity(inte);
|
||||||
((Activity) mContext).finish();
|
((Activity) mContext).finish();
|
||||||
}
|
}
|
||||||
}), params);
|
}), params);
|
||||||
|
|
||||||
if(prefs.getBoolean("debug_profling_tools", false)){
|
if (prefs.getBoolean("debug_profling_tools", false)) {
|
||||||
|
|
||||||
hlay.addView(addbut(R.drawable.clear_cache, new OnClickListener() {
|
hlay.addView(addbut(R.drawable.clear_cache, new OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
JNIdc.send(0, 0); //Killing texture cache
|
JNIdc.send(0, 0); // Killing texture cache
|
||||||
popUp.dismiss();
|
popUp.dismiss();
|
||||||
}
|
}
|
||||||
}), params);
|
}), params);
|
||||||
|
|
||||||
hlay.addView(addbut(R.drawable.profiler, new OnClickListener() {
|
hlay.addView(addbut(R.drawable.profiler, new OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
JNIdc.send(1, 3000); //sample_Start(param);
|
JNIdc.send(1, 3000); // sample_Start(param);
|
||||||
popUp.dismiss();
|
popUp.dismiss();
|
||||||
}
|
}
|
||||||
}), params);
|
}), params);
|
||||||
|
|
||||||
hlay.addView(addbut(R.drawable.profiler, new OnClickListener() {
|
hlay.addView(addbut(R.drawable.profiler, new OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
JNIdc.send(1, 0); //sample_Start(param);
|
JNIdc.send(1, 0); // sample_Start(param);
|
||||||
popUp.dismiss();
|
popUp.dismiss();
|
||||||
}
|
}
|
||||||
}), params);
|
}), params);
|
||||||
|
|
||||||
// hlay.addView(addbut(R.drawable.disk_unknown, new OnClickListener() {
|
// hlay.addView(addbut(R.drawable.disk_unknown, new
|
||||||
// public void onClick(View v) {
|
// OnClickListener() {
|
||||||
// JNIdc.send(0, 1); //settings.pvr.ta_skip
|
// public void onClick(View v) {
|
||||||
// popUp.dismiss();
|
// JNIdc.send(0, 1); //settings.pvr.ta_skip
|
||||||
// }
|
// popUp.dismiss();
|
||||||
// }), params);
|
// }
|
||||||
|
// }), params);
|
||||||
|
|
||||||
hlay.addView(addbut(R.drawable.print_stats, new OnClickListener() {
|
hlay.addView(addbut(R.drawable.print_stats, new OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
JNIdc.send(0, 2);
|
JNIdc.send(0, 2);
|
||||||
popUp.dismiss(); //print_stats=true;
|
popUp.dismiss(); // print_stats=true;
|
||||||
}
|
}
|
||||||
}), params);
|
}), params);
|
||||||
}
|
}
|
||||||
|
@ -111,7 +101,7 @@ public class OnScreenMenu {
|
||||||
popUp.dismiss();
|
popUp.dismiss();
|
||||||
}
|
}
|
||||||
}), params);
|
}), params);
|
||||||
|
|
||||||
hlay.addView(addbut(R.drawable.config, new OnClickListener() {
|
hlay.addView(addbut(R.drawable.config, new OnClickListener() {
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
displayConfigPopup(popUp);
|
displayConfigPopup(popUp);
|
||||||
|
@ -123,51 +113,9 @@ public class OnScreenMenu {
|
||||||
popUp.setContentView(hlay);
|
popUp.setContentView(hlay);
|
||||||
return popUp;
|
return popUp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PopupWindow createVjoyPopup() {
|
|
||||||
final PopupWindow popUp = new PopupWindow(vContext);
|
|
||||||
int p = getPixelsFromDp(60, vContext);
|
|
||||||
params = new LayoutParams(p, p);
|
|
||||||
|
|
||||||
LinearLayout hlay = new LinearLayout(vContext);
|
|
||||||
|
|
||||||
hlay.setOrientation(LinearLayout.HORIZONTAL);
|
|
||||||
|
|
||||||
hlay.addView(addbut(R.drawable.apply, new OnClickListener() {
|
|
||||||
public void onClick(View v) {
|
|
||||||
Intent inte = new Intent(vContext, MainActivity.class);
|
|
||||||
vContext.startActivity(inte);
|
|
||||||
((Activity) vContext).finish();
|
|
||||||
}
|
|
||||||
}), params);
|
|
||||||
|
|
||||||
hlay.addView(addbut(R.drawable.reset, new OnClickListener() {
|
|
||||||
public void onClick(View v) {
|
|
||||||
// Reset VJoy positions and scale
|
|
||||||
if (MainActivity.force_gpu) {
|
|
||||||
mView6.resetCustomVjoyValues();
|
|
||||||
} else {
|
|
||||||
mView.resetCustomVjoyValues();
|
|
||||||
}
|
|
||||||
popUp.dismiss();
|
|
||||||
}
|
|
||||||
}), params);
|
|
||||||
|
|
||||||
hlay.addView(addbut(R.drawable.close, new OnClickListener() {
|
|
||||||
public void onClick(View v) {
|
|
||||||
if (MainActivity.force_gpu) {
|
|
||||||
mView6.restoreCustomVjoyValues(EditVJoyActivity.vjoy_d_cached);
|
|
||||||
} else {
|
|
||||||
mView.restoreCustomVjoyValues(EditVJoyActivity.vjoy_d_cached);
|
|
||||||
}
|
|
||||||
popUp.dismiss();
|
|
||||||
}
|
|
||||||
}), params);
|
|
||||||
|
|
||||||
popUp.setContentView(hlay);
|
|
||||||
return popUp;
|
|
||||||
}
|
|
||||||
|
|
||||||
void displayConfigPopup(final PopupWindow popUp) {
|
void displayConfigPopup(final PopupWindow popUp) {
|
||||||
final PopupWindow popUpConfig = new PopupWindow(mContext);
|
final PopupWindow popUpConfig = new PopupWindow(mContext);
|
||||||
|
|
||||||
|
@ -208,42 +156,45 @@ public class OnScreenMenu {
|
||||||
JNIdc.frameskip(frameskip);
|
JNIdc.frameskip(frameskip);
|
||||||
popUpConfig.dismiss();
|
popUpConfig.dismiss();
|
||||||
displayConfigPopup(popUp);
|
displayConfigPopup(popUp);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
hlay.addView(frames_up, params);
|
hlay.addView(frames_up, params);
|
||||||
if (frameskip >= 5) {
|
if (frameskip >= 5) {
|
||||||
frames_up.setEnabled(false);
|
frames_up.setEnabled(false);
|
||||||
}
|
}
|
||||||
View frames_down = addbut(R.drawable.frames_down, new OnClickListener() {
|
View frames_down = addbut(R.drawable.frames_down,
|
||||||
public void onClick(View v) {
|
new OnClickListener() {
|
||||||
frameskip--;
|
public void onClick(View v) {
|
||||||
JNIdc.frameskip(frameskip);
|
frameskip--;
|
||||||
popUpConfig.dismiss();
|
JNIdc.frameskip(frameskip);
|
||||||
displayConfigPopup(popUp);
|
popUpConfig.dismiss();
|
||||||
}
|
displayConfigPopup(popUp);
|
||||||
});
|
}
|
||||||
|
});
|
||||||
hlay.addView(frames_down, params);
|
hlay.addView(frames_down, params);
|
||||||
if (frameskip <= 0) {
|
if (frameskip <= 0) {
|
||||||
frames_down.setEnabled(false);
|
frames_down.setEnabled(false);
|
||||||
}
|
}
|
||||||
View framelimit;
|
View framelimit;
|
||||||
if (!limitframes) {
|
if (!limitframes) {
|
||||||
framelimit = addbut(R.drawable.frames_limit_on, new OnClickListener() {
|
framelimit = addbut(R.drawable.frames_limit_on,
|
||||||
public void onClick(View v) {
|
new OnClickListener() {
|
||||||
JNIdc.limitfps(1);
|
public void onClick(View v) {
|
||||||
popUpConfig.dismiss();
|
JNIdc.limitfps(1);
|
||||||
limitframes = true;
|
popUpConfig.dismiss();
|
||||||
}
|
limitframes = true;
|
||||||
});
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
framelimit = addbut(R.drawable.frames_limit_off, new OnClickListener() {
|
framelimit = addbut(R.drawable.frames_limit_off,
|
||||||
public void onClick(View v) {
|
new OnClickListener() {
|
||||||
JNIdc.limitfps(0);
|
public void onClick(View v) {
|
||||||
popUpConfig.dismiss();
|
JNIdc.limitfps(0);
|
||||||
limitframes = false;
|
popUpConfig.dismiss();
|
||||||
}
|
limitframes = false;
|
||||||
});
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
hlay.addView(framelimit, params);
|
hlay.addView(framelimit, params);
|
||||||
hlay.addView(addbut(R.drawable.up, new OnClickListener() {
|
hlay.addView(addbut(R.drawable.up, new OnClickListener() {
|
||||||
|
@ -256,7 +207,7 @@ public class OnScreenMenu {
|
||||||
popUpConfig.setContentView(hlay);
|
popUpConfig.setContentView(hlay);
|
||||||
mContext.displayConfig(popUpConfig);
|
mContext.displayConfig(popUpConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getPixelsFromDp(float dps, Context context) {
|
public static int getPixelsFromDp(float dps, Context context) {
|
||||||
return (int) (dps * context.getResources().getDisplayMetrics().density + 0.5f);
|
return (int) (dps * context.getResources().getDisplayMetrics().density + 0.5f);
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
7
shell/iphone/emulator/emulator.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
shell/iphone/emulator/emulator.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "self:emulator.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
|
@ -0,0 +1,41 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
|
||||||
|
<false/>
|
||||||
|
<key>IDESourceControlProjectIdentifier</key>
|
||||||
|
<string>0ADED465-2701-46B9-837C-7F074C54E485</string>
|
||||||
|
<key>IDESourceControlProjectName</key>
|
||||||
|
<string>emulator</string>
|
||||||
|
<key>IDESourceControlProjectOriginsDictionary</key>
|
||||||
|
<dict>
|
||||||
|
<key>D4D8CD0F-9B51-4D20-AD1F-11FBABE03262</key>
|
||||||
|
<string>ssh://github.com/LoungeKatt/reicast-emulator.git</string>
|
||||||
|
</dict>
|
||||||
|
<key>IDESourceControlProjectPath</key>
|
||||||
|
<string>shell/iphone/emulator/emulator.xcodeproj/project.xcworkspace</string>
|
||||||
|
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
|
||||||
|
<dict>
|
||||||
|
<key>D4D8CD0F-9B51-4D20-AD1F-11FBABE03262</key>
|
||||||
|
<string>../../../../..</string>
|
||||||
|
</dict>
|
||||||
|
<key>IDESourceControlProjectURL</key>
|
||||||
|
<string>ssh://github.com/LoungeKatt/reicast-emulator.git</string>
|
||||||
|
<key>IDESourceControlProjectVersion</key>
|
||||||
|
<integer>110</integer>
|
||||||
|
<key>IDESourceControlProjectWCCIdentifier</key>
|
||||||
|
<string>D4D8CD0F-9B51-4D20-AD1F-11FBABE03262</string>
|
||||||
|
<key>IDESourceControlProjectWCConfigurations</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
|
||||||
|
<string>public.vcs.git</string>
|
||||||
|
<key>IDESourceControlWCCIdentifierKey</key>
|
||||||
|
<string>D4D8CD0F-9B51-4D20-AD1F-11FBABE03262</string>
|
||||||
|
<key>IDESourceControlWCCName</key>
|
||||||
|
<string>DreamcastEmu</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
Binary file not shown.
|
@ -0,0 +1,96 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "0500"
|
||||||
|
version = "1.3">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "YES"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
<BuildActionEntries>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "87078A8218A47FE90034C7A0"
|
||||||
|
BuildableName = "emulator.app"
|
||||||
|
BlueprintName = "emulator"
|
||||||
|
ReferencedContainer = "container:emulator.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
</BuildActionEntries>
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
buildConfiguration = "Debug">
|
||||||
|
<Testables>
|
||||||
|
<TestableReference
|
||||||
|
skipped = "NO">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "87078AAE18A47FE90034C7A0"
|
||||||
|
BuildableName = "emulatorTests.xctest"
|
||||||
|
BlueprintName = "emulatorTests"
|
||||||
|
ReferencedContainer = "container:emulator.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</TestableReference>
|
||||||
|
</Testables>
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "87078A8218A47FE90034C7A0"
|
||||||
|
BuildableName = "emulator.app"
|
||||||
|
BlueprintName = "emulator"
|
||||||
|
ReferencedContainer = "container:emulator.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
launchStyle = "0"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
allowLocationSimulation = "YES">
|
||||||
|
<BuildableProductRunnable>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "87078A8218A47FE90034C7A0"
|
||||||
|
BuildableName = "emulator.app"
|
||||||
|
BlueprintName = "emulator"
|
||||||
|
ReferencedContainer = "container:emulator.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
<AdditionalOptions>
|
||||||
|
</AdditionalOptions>
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
debugDocumentVersioning = "YES">
|
||||||
|
<BuildableProductRunnable>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "87078A8218A47FE90034C7A0"
|
||||||
|
BuildableName = "emulator.app"
|
||||||
|
BlueprintName = "emulator"
|
||||||
|
ReferencedContainer = "container:emulator.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "Debug">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
|
@ -0,0 +1,27 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>SchemeUserState</key>
|
||||||
|
<dict>
|
||||||
|
<key>emulator.xcscheme</key>
|
||||||
|
<dict>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>SuppressBuildableAutocreation</key>
|
||||||
|
<dict>
|
||||||
|
<key>87078A8218A47FE90034C7A0</key>
|
||||||
|
<dict>
|
||||||
|
<key>primary</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
<key>87078AAE18A47FE90034C7A0</key>
|
||||||
|
<dict>
|
||||||
|
<key>primary</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
|
@ -0,0 +1,15 @@
|
||||||
|
//
|
||||||
|
// AppDelegate.h
|
||||||
|
// emulator
|
||||||
|
//
|
||||||
|
// Created by Lounge Katt on 2/6/14.
|
||||||
|
// Copyright (c) 2014 Lounge Katt. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
@interface AppDelegate : UIResponder <UIApplicationDelegate>
|
||||||
|
|
||||||
|
@property (strong, nonatomic) UIWindow *window;
|
||||||
|
|
||||||
|
@end
|
|
@ -0,0 +1,46 @@
|
||||||
|
//
|
||||||
|
// AppDelegate.m
|
||||||
|
// emulator
|
||||||
|
//
|
||||||
|
// Created by Lounge Katt on 2/6/14.
|
||||||
|
// Copyright (c) 2014 Lounge Katt. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "AppDelegate.h"
|
||||||
|
|
||||||
|
@implementation AppDelegate
|
||||||
|
|
||||||
|
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||||
|
{
|
||||||
|
// Override point for customization after application launch.
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)applicationWillResignActive:(UIApplication *)application
|
||||||
|
{
|
||||||
|
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||||
|
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)applicationDidEnterBackground:(UIApplication *)application
|
||||||
|
{
|
||||||
|
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||||
|
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)applicationWillEnterForeground:(UIApplication *)application
|
||||||
|
{
|
||||||
|
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)applicationDidBecomeActive:(UIApplication *)application
|
||||||
|
{
|
||||||
|
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)applicationWillTerminate:(UIApplication *)application
|
||||||
|
{
|
||||||
|
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4451" systemVersion="13A461" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="BV1-FR-VrT">
|
||||||
|
<dependencies>
|
||||||
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3676"/>
|
||||||
|
</dependencies>
|
||||||
|
<scenes>
|
||||||
|
<!--class Prefix:identifier View Controller-->
|
||||||
|
<scene sceneID="tXr-a1-R10">
|
||||||
|
<objects>
|
||||||
|
<glkViewController preferredFramesPerSecond="30" id="BV1-FR-VrT" customClass="ViewController" sceneMemberID="viewController">
|
||||||
|
<glkView key="view" contentMode="scaleToFill" id="3se-qz-xqx">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||||
|
</glkView>
|
||||||
|
</glkViewController>
|
||||||
|
<placeholder placeholderIdentifier="IBFirstResponder" id="SZV-WD-TEh" sceneMemberID="firstResponder"/>
|
||||||
|
</objects>
|
||||||
|
</scene>
|
||||||
|
</scenes>
|
||||||
|
<simulatedMetricsContainer key="defaultSimulatedMetrics">
|
||||||
|
<nil key="statusBar"/>
|
||||||
|
<simulatedOrientationMetrics key="orientation"/>
|
||||||
|
<simulatedScreenMetrics key="destination"/>
|
||||||
|
</simulatedMetricsContainer>
|
||||||
|
</document>
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4451" systemVersion="13A461" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="LVB-YS-i5n">
|
||||||
|
<dependencies>
|
||||||
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3676"/>
|
||||||
|
</dependencies>
|
||||||
|
<scenes>
|
||||||
|
<!--class Prefix:identifier View Controller-->
|
||||||
|
<scene sceneID="CtS-rA-C9T">
|
||||||
|
<objects>
|
||||||
|
<glkViewController preferredFramesPerSecond="30" id="LVB-YS-i5n" customClass="ViewController" sceneMemberID="viewController">
|
||||||
|
<glkView key="view" contentMode="scaleToFill" id="bdc-N1-crn">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||||
|
</glkView>
|
||||||
|
</glkViewController>
|
||||||
|
<placeholder placeholderIdentifier="IBFirstResponder" id="btX-cZ-eVz" sceneMemberID="firstResponder"/>
|
||||||
|
</objects>
|
||||||
|
</scene>
|
||||||
|
</scenes>
|
||||||
|
<simulatedMetricsContainer key="defaultSimulatedMetrics">
|
||||||
|
<nil key="statusBar"/>
|
||||||
|
<simulatedOrientationMetrics key="orientation"/>
|
||||||
|
<simulatedScreenMetrics key="destination" type="retina4"/>
|
||||||
|
</simulatedMetricsContainer>
|
||||||
|
</document>
|
|
@ -0,0 +1,53 @@
|
||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"size" : "29x29",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"size" : "40x40",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"size" : "60x60",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"size" : "29x29",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"size" : "29x29",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"size" : "40x40",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"size" : "40x40",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"size" : "76x76",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"size" : "76x76",
|
||||||
|
"scale" : "2x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"orientation" : "portrait",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"extent" : "full-screen",
|
||||||
|
"minimum-system-version" : "7.0",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"orientation" : "portrait",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"subtype" : "retina4",
|
||||||
|
"extent" : "full-screen",
|
||||||
|
"minimum-system-version" : "7.0",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"orientation" : "portrait",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"extent" : "full-screen",
|
||||||
|
"minimum-system-version" : "7.0",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"orientation" : "landscape",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"extent" : "full-screen",
|
||||||
|
"minimum-system-version" : "7.0",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"orientation" : "portrait",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"extent" : "full-screen",
|
||||||
|
"minimum-system-version" : "7.0",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"orientation" : "landscape",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"extent" : "full-screen",
|
||||||
|
"minimum-system-version" : "7.0",
|
||||||
|
"scale" : "2x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
//
|
||||||
|
// Shader.fsh
|
||||||
|
// emulator
|
||||||
|
//
|
||||||
|
// Created by Lounge Katt on 2/6/14.
|
||||||
|
// Copyright (c) 2014 Lounge Katt. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
varying lowp vec4 colorVarying;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
gl_FragColor = colorVarying;
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
//
|
||||||
|
// Shader.vsh
|
||||||
|
// emulator
|
||||||
|
//
|
||||||
|
// Created by Lounge Katt on 2/6/14.
|
||||||
|
// Copyright (c) 2014 Lounge Katt. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
attribute vec4 position;
|
||||||
|
attribute vec3 normal;
|
||||||
|
|
||||||
|
varying lowp vec4 colorVarying;
|
||||||
|
|
||||||
|
uniform mat4 modelViewProjectionMatrix;
|
||||||
|
uniform mat3 normalMatrix;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
vec3 eyeNormal = normalize(normalMatrix * normal);
|
||||||
|
vec3 lightPosition = vec3(0.0, 0.0, 1.0);
|
||||||
|
vec4 diffuseColor = vec4(0.4, 0.4, 1.0, 1.0);
|
||||||
|
|
||||||
|
float nDotVP = max(0.0, dot(eyeNormal, normalize(lightPosition)));
|
||||||
|
|
||||||
|
colorVarying = diffuseColor * nDotVP;
|
||||||
|
|
||||||
|
gl_Position = modelViewProjectionMatrix * position;
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
//
|
||||||
|
// ViewController.h
|
||||||
|
// emulator
|
||||||
|
//
|
||||||
|
// Created by Lounge Katt on 2/6/14.
|
||||||
|
// Copyright (c) 2014 Lounge Katt. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
#import <GLKit/GLKit.h>
|
||||||
|
|
||||||
|
@interface ViewController : GLKViewController
|
||||||
|
|
||||||
|
@end
|
|
@ -0,0 +1,378 @@
|
||||||
|
//
|
||||||
|
// ViewController.m
|
||||||
|
// emulator
|
||||||
|
//
|
||||||
|
// Created by Lounge Katt on 2/6/14.
|
||||||
|
// Copyright (c) 2014 Lounge Katt. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "ViewController.h"
|
||||||
|
|
||||||
|
#define BUFFER_OFFSET(i) ((char *)NULL + (i))
|
||||||
|
|
||||||
|
// Uniform index.
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
UNIFORM_MODELVIEWPROJECTION_MATRIX,
|
||||||
|
UNIFORM_NORMAL_MATRIX,
|
||||||
|
NUM_UNIFORMS
|
||||||
|
};
|
||||||
|
GLint uniforms[NUM_UNIFORMS];
|
||||||
|
|
||||||
|
// Attribute index.
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
ATTRIB_VERTEX,
|
||||||
|
ATTRIB_NORMAL,
|
||||||
|
NUM_ATTRIBUTES
|
||||||
|
};
|
||||||
|
|
||||||
|
GLfloat gCubeVertexData[216] =
|
||||||
|
{
|
||||||
|
// Data layout for each line below is:
|
||||||
|
// positionX, positionY, positionZ, normalX, normalY, normalZ,
|
||||||
|
0.5f, -0.5f, -0.5f, 1.0f, 0.0f, 0.0f,
|
||||||
|
0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f,
|
||||||
|
0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f,
|
||||||
|
0.5f, -0.5f, 0.5f, 1.0f, 0.0f, 0.0f,
|
||||||
|
0.5f, 0.5f, -0.5f, 1.0f, 0.0f, 0.0f,
|
||||||
|
0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.0f,
|
||||||
|
|
||||||
|
0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f,
|
||||||
|
-0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f,
|
||||||
|
0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f,
|
||||||
|
0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f,
|
||||||
|
-0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f,
|
||||||
|
-0.5f, 0.5f, 0.5f, 0.0f, 1.0f, 0.0f,
|
||||||
|
|
||||||
|
-0.5f, 0.5f, -0.5f, -1.0f, 0.0f, 0.0f,
|
||||||
|
-0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f,
|
||||||
|
-0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f,
|
||||||
|
-0.5f, 0.5f, 0.5f, -1.0f, 0.0f, 0.0f,
|
||||||
|
-0.5f, -0.5f, -0.5f, -1.0f, 0.0f, 0.0f,
|
||||||
|
-0.5f, -0.5f, 0.5f, -1.0f, 0.0f, 0.0f,
|
||||||
|
|
||||||
|
-0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f,
|
||||||
|
0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f,
|
||||||
|
-0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f,
|
||||||
|
-0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f,
|
||||||
|
0.5f, -0.5f, -0.5f, 0.0f, -1.0f, 0.0f,
|
||||||
|
0.5f, -0.5f, 0.5f, 0.0f, -1.0f, 0.0f,
|
||||||
|
|
||||||
|
0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
|
||||||
|
-0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
|
||||||
|
0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
|
||||||
|
0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
|
||||||
|
-0.5f, 0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
|
||||||
|
-0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f,
|
||||||
|
|
||||||
|
0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
|
||||||
|
-0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
|
||||||
|
0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
|
||||||
|
0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
|
||||||
|
-0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f,
|
||||||
|
-0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f
|
||||||
|
};
|
||||||
|
|
||||||
|
@interface ViewController () {
|
||||||
|
GLuint _program;
|
||||||
|
|
||||||
|
GLKMatrix4 _modelViewProjectionMatrix;
|
||||||
|
GLKMatrix3 _normalMatrix;
|
||||||
|
float _rotation;
|
||||||
|
|
||||||
|
GLuint _vertexArray;
|
||||||
|
GLuint _vertexBuffer;
|
||||||
|
}
|
||||||
|
@property (strong, nonatomic) EAGLContext *context;
|
||||||
|
@property (strong, nonatomic) GLKBaseEffect *effect;
|
||||||
|
|
||||||
|
- (void)setupGL;
|
||||||
|
- (void)tearDownGL;
|
||||||
|
|
||||||
|
- (BOOL)loadShaders;
|
||||||
|
- (BOOL)compileShader:(GLuint *)shader type:(GLenum)type file:(NSString *)file;
|
||||||
|
- (BOOL)linkProgram:(GLuint)prog;
|
||||||
|
- (BOOL)validateProgram:(GLuint)prog;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation ViewController
|
||||||
|
|
||||||
|
- (void)viewDidLoad
|
||||||
|
{
|
||||||
|
[super viewDidLoad];
|
||||||
|
|
||||||
|
self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
|
||||||
|
|
||||||
|
if (!self.context) {
|
||||||
|
NSLog(@"Failed to create ES context");
|
||||||
|
}
|
||||||
|
|
||||||
|
GLKView *view = (GLKView *)self.view;
|
||||||
|
view.context = self.context;
|
||||||
|
view.drawableDepthFormat = GLKViewDrawableDepthFormat24;
|
||||||
|
|
||||||
|
[self setupGL];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)dealloc
|
||||||
|
{
|
||||||
|
[self tearDownGL];
|
||||||
|
|
||||||
|
if ([EAGLContext currentContext] == self.context) {
|
||||||
|
[EAGLContext setCurrentContext:nil];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)didReceiveMemoryWarning
|
||||||
|
{
|
||||||
|
[super didReceiveMemoryWarning];
|
||||||
|
|
||||||
|
if ([self isViewLoaded] && ([[self view] window] == nil)) {
|
||||||
|
self.view = nil;
|
||||||
|
|
||||||
|
[self tearDownGL];
|
||||||
|
|
||||||
|
if ([EAGLContext currentContext] == self.context) {
|
||||||
|
[EAGLContext setCurrentContext:nil];
|
||||||
|
}
|
||||||
|
self.context = nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dispose of any resources that can be recreated.
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)setupGL
|
||||||
|
{
|
||||||
|
[EAGLContext setCurrentContext:self.context];
|
||||||
|
|
||||||
|
[self loadShaders];
|
||||||
|
|
||||||
|
self.effect = [[GLKBaseEffect alloc] init];
|
||||||
|
self.effect.light0.enabled = GL_TRUE;
|
||||||
|
self.effect.light0.diffuseColor = GLKVector4Make(1.0f, 0.4f, 0.4f, 1.0f);
|
||||||
|
|
||||||
|
glEnable(GL_DEPTH_TEST);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)tearDownGL
|
||||||
|
{
|
||||||
|
[EAGLContext setCurrentContext:self.context];
|
||||||
|
|
||||||
|
glDeleteBuffers(1, &_vertexBuffer);
|
||||||
|
glDeleteVertexArraysOES(1, &_vertexArray);
|
||||||
|
|
||||||
|
self.effect = nil;
|
||||||
|
|
||||||
|
if (_program) {
|
||||||
|
glDeleteProgram(_program);
|
||||||
|
_program = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - GLKView and GLKViewController delegate methods
|
||||||
|
|
||||||
|
- (void)update
|
||||||
|
{
|
||||||
|
float aspect = fabsf(self.view.bounds.size.width / self.view.bounds.size.height);
|
||||||
|
GLKMatrix4 projectionMatrix = GLKMatrix4MakePerspective(GLKMathDegreesToRadians(65.0f), aspect, 0.1f, 100.0f);
|
||||||
|
|
||||||
|
self.effect.transform.projectionMatrix = projectionMatrix;
|
||||||
|
|
||||||
|
GLKMatrix4 baseModelViewMatrix = GLKMatrix4MakeTranslation(0.0f, 0.0f, -4.0f);
|
||||||
|
baseModelViewMatrix = GLKMatrix4Rotate(baseModelViewMatrix, _rotation, 0.0f, 1.0f, 0.0f);
|
||||||
|
|
||||||
|
// Compute the model view matrix for the object rendered with GLKit
|
||||||
|
GLKMatrix4 modelViewMatrix = GLKMatrix4MakeTranslation(0.0f, 0.0f, -1.5f);
|
||||||
|
modelViewMatrix = GLKMatrix4Rotate(modelViewMatrix, _rotation, 1.0f, 1.0f, 1.0f);
|
||||||
|
modelViewMatrix = GLKMatrix4Multiply(baseModelViewMatrix, modelViewMatrix);
|
||||||
|
|
||||||
|
self.effect.transform.modelviewMatrix = modelViewMatrix;
|
||||||
|
|
||||||
|
// Compute the model view matrix for the object rendered with ES2
|
||||||
|
modelViewMatrix = GLKMatrix4MakeTranslation(0.0f, 0.0f, 1.5f);
|
||||||
|
modelViewMatrix = GLKMatrix4Rotate(modelViewMatrix, _rotation, 1.0f, 1.0f, 1.0f);
|
||||||
|
modelViewMatrix = GLKMatrix4Multiply(baseModelViewMatrix, modelViewMatrix);
|
||||||
|
|
||||||
|
_normalMatrix = GLKMatrix3InvertAndTranspose(GLKMatrix4GetMatrix3(modelViewMatrix), NULL);
|
||||||
|
|
||||||
|
_modelViewProjectionMatrix = GLKMatrix4Multiply(projectionMatrix, modelViewMatrix);
|
||||||
|
|
||||||
|
_rotation += self.timeSinceLastUpdate * 0.5f;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect
|
||||||
|
{
|
||||||
|
glClearColor(0.65f, 0.65f, 0.65f, 1.0f);
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
|
glBindVertexArrayOES(_vertexArray);
|
||||||
|
|
||||||
|
// Render the object with GLKit
|
||||||
|
[self.effect prepareToDraw];
|
||||||
|
|
||||||
|
glDrawArrays(GL_TRIANGLES, 0, 36);
|
||||||
|
|
||||||
|
// Render the object again with ES2
|
||||||
|
glUseProgram(_program);
|
||||||
|
|
||||||
|
glUniformMatrix4fv(uniforms[UNIFORM_MODELVIEWPROJECTION_MATRIX], 1, 0, _modelViewProjectionMatrix.m);
|
||||||
|
glUniformMatrix3fv(uniforms[UNIFORM_NORMAL_MATRIX], 1, 0, _normalMatrix.m);
|
||||||
|
|
||||||
|
glDrawArrays(GL_TRIANGLES, 0, 36);
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma mark - OpenGL ES 2 shader compilation
|
||||||
|
|
||||||
|
- (BOOL)loadShaders
|
||||||
|
{
|
||||||
|
GLuint vertShader, fragShader;
|
||||||
|
NSString *vertShaderPathname, *fragShaderPathname;
|
||||||
|
|
||||||
|
// Create shader program.
|
||||||
|
_program = glCreateProgram();
|
||||||
|
|
||||||
|
// Create and compile vertex shader.
|
||||||
|
vertShaderPathname = [[NSBundle mainBundle] pathForResource:@"Shader" ofType:@"vsh"];
|
||||||
|
if (![self compileShader:&vertShader type:GL_VERTEX_SHADER file:vertShaderPathname]) {
|
||||||
|
NSLog(@"Failed to compile vertex shader");
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create and compile fragment shader.
|
||||||
|
fragShaderPathname = [[NSBundle mainBundle] pathForResource:@"Shader" ofType:@"fsh"];
|
||||||
|
if (![self compileShader:&fragShader type:GL_FRAGMENT_SHADER file:fragShaderPathname]) {
|
||||||
|
NSLog(@"Failed to compile fragment shader");
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Attach vertex shader to program.
|
||||||
|
glAttachShader(_program, vertShader);
|
||||||
|
|
||||||
|
// Attach fragment shader to program.
|
||||||
|
glAttachShader(_program, fragShader);
|
||||||
|
|
||||||
|
// Bind attribute locations.
|
||||||
|
// This needs to be done prior to linking.
|
||||||
|
glBindAttribLocation(_program, GLKVertexAttribPosition, "position");
|
||||||
|
glBindAttribLocation(_program, GLKVertexAttribNormal, "normal");
|
||||||
|
|
||||||
|
// Link program.
|
||||||
|
if (![self linkProgram:_program]) {
|
||||||
|
NSLog(@"Failed to link program: %d", _program);
|
||||||
|
|
||||||
|
if (vertShader) {
|
||||||
|
glDeleteShader(vertShader);
|
||||||
|
vertShader = 0;
|
||||||
|
}
|
||||||
|
if (fragShader) {
|
||||||
|
glDeleteShader(fragShader);
|
||||||
|
fragShader = 0;
|
||||||
|
}
|
||||||
|
if (_program) {
|
||||||
|
glDeleteProgram(_program);
|
||||||
|
_program = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get uniform locations.
|
||||||
|
uniforms[UNIFORM_MODELVIEWPROJECTION_MATRIX] = glGetUniformLocation(_program, "modelViewProjectionMatrix");
|
||||||
|
uniforms[UNIFORM_NORMAL_MATRIX] = glGetUniformLocation(_program, "normalMatrix");
|
||||||
|
|
||||||
|
// Release vertex and fragment shaders.
|
||||||
|
if (vertShader) {
|
||||||
|
glDetachShader(_program, vertShader);
|
||||||
|
glDeleteShader(vertShader);
|
||||||
|
}
|
||||||
|
if (fragShader) {
|
||||||
|
glDetachShader(_program, fragShader);
|
||||||
|
glDeleteShader(fragShader);
|
||||||
|
}
|
||||||
|
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)compileShader:(GLuint *)shader type:(GLenum)type file:(NSString *)file
|
||||||
|
{
|
||||||
|
GLint status;
|
||||||
|
const GLchar *source;
|
||||||
|
|
||||||
|
source = (GLchar *)[[NSString stringWithContentsOfFile:file encoding:NSUTF8StringEncoding error:nil] UTF8String];
|
||||||
|
if (!source) {
|
||||||
|
NSLog(@"Failed to load vertex shader");
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
*shader = glCreateShader(type);
|
||||||
|
glShaderSource(*shader, 1, &source, NULL);
|
||||||
|
glCompileShader(*shader);
|
||||||
|
|
||||||
|
#if defined(DEBUG)
|
||||||
|
GLint logLength;
|
||||||
|
glGetShaderiv(*shader, GL_INFO_LOG_LENGTH, &logLength);
|
||||||
|
if (logLength > 0) {
|
||||||
|
GLchar *log = (GLchar *)malloc(logLength);
|
||||||
|
glGetShaderInfoLog(*shader, logLength, &logLength, log);
|
||||||
|
NSLog(@"Shader compile log:\n%s", log);
|
||||||
|
free(log);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
glGetShaderiv(*shader, GL_COMPILE_STATUS, &status);
|
||||||
|
if (status == 0) {
|
||||||
|
glDeleteShader(*shader);
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)linkProgram:(GLuint)prog
|
||||||
|
{
|
||||||
|
GLint status;
|
||||||
|
glLinkProgram(prog);
|
||||||
|
|
||||||
|
#if defined(DEBUG)
|
||||||
|
GLint logLength;
|
||||||
|
glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &logLength);
|
||||||
|
if (logLength > 0) {
|
||||||
|
GLchar *log = (GLchar *)malloc(logLength);
|
||||||
|
glGetProgramInfoLog(prog, logLength, &logLength, log);
|
||||||
|
NSLog(@"Program link log:\n%s", log);
|
||||||
|
free(log);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
glGetProgramiv(prog, GL_LINK_STATUS, &status);
|
||||||
|
if (status == 0) {
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL)validateProgram:(GLuint)prog
|
||||||
|
{
|
||||||
|
GLint logLength, status;
|
||||||
|
|
||||||
|
glValidateProgram(prog);
|
||||||
|
glGetProgramiv(prog, GL_INFO_LOG_LENGTH, &logLength);
|
||||||
|
if (logLength > 0) {
|
||||||
|
GLchar *log = (GLchar *)malloc(logLength);
|
||||||
|
glGetProgramInfoLog(prog, logLength, &logLength, log);
|
||||||
|
NSLog(@"Program validate log:\n%s", log);
|
||||||
|
free(log);
|
||||||
|
}
|
||||||
|
|
||||||
|
glGetProgramiv(prog, GL_VALIDATE_STATUS, &status);
|
||||||
|
if (status == 0) {
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
|
@ -0,0 +1,51 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>en</string>
|
||||||
|
<key>CFBundleDisplayName</key>
|
||||||
|
<string>${PRODUCT_NAME}</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>com.reicast.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>${PRODUCT_NAME}</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
<true/>
|
||||||
|
<key>UIMainStoryboardFile</key>
|
||||||
|
<string>Main_iPhone</string>
|
||||||
|
<key>UIMainStoryboardFile~ipad</key>
|
||||||
|
<string>Main_iPad</string>
|
||||||
|
<key>UIRequiredDeviceCapabilities</key>
|
||||||
|
<array>
|
||||||
|
<string>armv7</string>
|
||||||
|
</array>
|
||||||
|
<key>UIStatusBarHidden</key>
|
||||||
|
<true/>
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
|
@ -0,0 +1,16 @@
|
||||||
|
//
|
||||||
|
// Prefix header
|
||||||
|
//
|
||||||
|
// The contents of this file are implicitly included at the beginning of every source file.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Availability.h>
|
||||||
|
|
||||||
|
#ifndef __IPHONE_5_0
|
||||||
|
#warning "This project uses features only available in iOS SDK 5.0 and later."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __OBJC__
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#endif
|
|
@ -0,0 +1,2 @@
|
||||||
|
/* Localized versions of Info.plist keys */
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
//
|
||||||
|
// main.m
|
||||||
|
// emulator
|
||||||
|
//
|
||||||
|
// Created by Lounge Katt on 2/6/14.
|
||||||
|
// Copyright (c) 2014 Lounge Katt. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
#import "AppDelegate.h"
|
||||||
|
|
||||||
|
int main(int argc, char * argv[])
|
||||||
|
{
|
||||||
|
@autoreleasepool {
|
||||||
|
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>en</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>${EXECUTABLE_NAME}</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>com.reicast.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>BNDL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
|
@ -0,0 +1,34 @@
|
||||||
|
//
|
||||||
|
// emulatorTests.m
|
||||||
|
// emulatorTests
|
||||||
|
//
|
||||||
|
// Created by Lounge Katt on 2/6/14.
|
||||||
|
// Copyright (c) 2014 Lounge Katt. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <XCTest/XCTest.h>
|
||||||
|
|
||||||
|
@interface emulatorTests : XCTestCase
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
@implementation emulatorTests
|
||||||
|
|
||||||
|
- (void)setUp
|
||||||
|
{
|
||||||
|
[super setUp];
|
||||||
|
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)tearDown
|
||||||
|
{
|
||||||
|
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||||
|
[super tearDown];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)testExample
|
||||||
|
{
|
||||||
|
XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
|
@ -0,0 +1,2 @@
|
||||||
|
/* Localized versions of Info.plist keys */
|
||||||
|
|
Loading…
Reference in New Issue