|
@@ -28,6 +28,7 @@ import app.brest.utils.ResourceManager;
|
|
|
import app.brest.utils.SensorsManager;
|
|
|
import app.brest.utils.app.brest.game.Game;
|
|
|
import app.brest.utils.app.brest.game.Resource;
|
|
|
+import app.brest.utils.app.brest.game.Stage;
|
|
|
import app.brest.utils.geometry.GPSPoint;
|
|
|
import min3d.core.Object3d;
|
|
|
import min3d.core.Object3dContainer;
|
|
@@ -73,6 +74,11 @@ public class ARActivity extends RendererActivity
|
|
|
|
|
|
mOkButton = (Button) findViewById(R.id.button_catch);
|
|
|
mOkButton.setVisibility(View.INVISIBLE);
|
|
|
+ if(cameraPreviewLayout.getChildCount()<2)
|
|
|
+ {
|
|
|
+ cameraPreviewLayout.addView(mImageSurfaceView,0);
|
|
|
+ cameraPreviewLayout.addView(_glSurfaceView,1);
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|
|
@@ -88,9 +94,7 @@ public class ARActivity extends RendererActivity
|
|
|
|
|
|
protected void onCreateSetContentView()
|
|
|
{
|
|
|
- init();
|
|
|
- cameraPreviewLayout.addView(mImageSurfaceView,0);
|
|
|
- cameraPreviewLayout.addView(_glSurfaceView,1);
|
|
|
+ //init();
|
|
|
|
|
|
}
|
|
|
|
|
@@ -181,7 +185,8 @@ public class ARActivity extends RendererActivity
|
|
|
{
|
|
|
super.onCreate(savedInstanceState);
|
|
|
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
|
|
- mGame = (Game) getIntent().getSerializableExtra("game");
|
|
|
+ //mGame = (Game) getIntent().getSerializableExtra("game");
|
|
|
+ mGame = Game.game();
|
|
|
mGame.newSensorManager(this);
|
|
|
|
|
|
|
|
@@ -250,6 +255,7 @@ public class ARActivity extends RendererActivity
|
|
|
@Override
|
|
|
protected void onResume() {
|
|
|
super.onResume();
|
|
|
+ init();
|
|
|
mGame.onResume(this);
|
|
|
scene.clear();
|
|
|
synchronized (mLock)
|
|
@@ -267,6 +273,8 @@ public class ARActivity extends RendererActivity
|
|
|
super.onPause();
|
|
|
mGame.onPause(this);
|
|
|
scene.clear();
|
|
|
+ cameraPreviewLayout.removeViewAt(0);
|
|
|
+ cameraPreviewLayout.removeViewAt(0);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -300,14 +308,11 @@ public class ARActivity extends RendererActivity
|
|
|
|
|
|
public void onClickPickUp(View v)
|
|
|
{
|
|
|
+ Resource res = null;
|
|
|
boolean stageFinished = mGame.pickResource();
|
|
|
boolean finished = false;
|
|
|
- mGame.printNResource("Pick up");
|
|
|
+ res=mGame.getLatestResource();
|
|
|
|
|
|
- //TDOD: Nouvelle activité pour afficher la ressource
|
|
|
- /*Intent intent = new Intent(this, ResourceListActivity.class);
|
|
|
- intent.putExtra("game", mGame );
|
|
|
- startActivity(intent);
|
|
|
|
|
|
if(stageFinished)
|
|
|
{
|
|
@@ -317,18 +322,24 @@ public class ARActivity extends RendererActivity
|
|
|
if(finished)
|
|
|
{
|
|
|
|
|
|
- }*/
|
|
|
-
|
|
|
+ }
|
|
|
|
|
|
+ if(stageFinished)
|
|
|
+ {
|
|
|
+ Stage s = mGame.getCurrentStageObj();
|
|
|
+ Resource stageRes = s.getResource();
|
|
|
+ Intent intent = new Intent(this, ViewerActivity.class);
|
|
|
+ intent.putExtra("resource", stageRes );
|
|
|
+ startActivity(intent);
|
|
|
+ }
|
|
|
|
|
|
+ Intent intent = new Intent(this, ViewerActivity.class);
|
|
|
+ intent.putExtra("resource", res );
|
|
|
+ startActivity(intent);
|
|
|
+ finish();
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void logCuurentAreas()
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
public static void setLocation(GPSPoint p)
|
|
|
{
|
|
|
mLocation = p;
|