Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into megamerge
Browse files Browse the repository at this point in the history
  • Loading branch information
Qosmio1\Antoine committed May 14, 2018
2 parents 61b5118 + 1a26009 commit 3478ddb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Classes/Engine/Source/CJsonParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void CJsonParser::BuildBehaviorTreeFromFile(CNode* a_pRoot, const std::string& a
RefJsonNode rMacros = m_oDocument["app"]["macros"];
CMacroManager::Instance()->ParseJSON(rMacros, m_sBasePath);
}
#ifdef LUDOMUSE_EDITOR
#ifndef LUDOMUSE_EDITOR
//ParseJsonRoot(m_oDocument["app"], a_pRoot);
if (m_oDocument["app"].HasMember("debug"))
{
Expand Down
8 changes: 4 additions & 4 deletions Classes/Engine/Source/CKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1074,12 +1074,12 @@ bool CKernel::OnTouchBegan(Touch* a_pTouch, Event* a_pEvent)
m_mTouchBeganVisitors.erase(a_pTouch->getID());
}
M_STATS_SCREEN.nbInteractions++;
CTouchBeganVisitor oVisistor(a_pTouch, a_pEvent, this);
oVisistor.Traverse(m_pCurrentScene);
CTouchBeganVisitor oVisitor(a_pTouch, a_pEvent, this);
oVisitor.Traverse(m_pCurrentScene);

m_mTouchBeganVisitors.insert(std::pair<int, CTouchBeganVisitor>(a_pTouch->getID(), oVisistor));
m_mTouchBeganVisitors.insert(std::pair<int, CTouchBeganVisitor>(a_pTouch->getID(), oVisitor));
#else
// m_mTouchBeganVisitors.insert(std::pair<int, CTouchBeganVisitor>(a_pTouch->getID(), oVisistor));
// m_mTouchBeganVisitors.insert(std::pair<int, CTouchBeganVisitor>(a_pTouch->getID(), oVisitor));
qDebug("OnTouchBegan");
// this->m_oVisitor->SetEvent(a_pEvent);
// this->m_oVisitor->SetTouch(a_pTouch);
Expand Down
3 changes: 2 additions & 1 deletion Classes/Engine/Source/CMenuNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ std::string CMenuNode::GetText()

void CMenuNode::Show(bool a_bVisible)
{
m_pCocosEntity->setVisible(true);
if (m_pCocosEntity)
m_pCocosEntity->setVisible(true);
CEntityNode::Show();
}
#ifdef LUDOMUSE_EDITOR
Expand Down
17 changes: 13 additions & 4 deletions proj.android-studio/app/src/org/cocos2dx/cpp/CameraActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Matrix;
import android.os.Debug;
import android.util.FloatMath;
import android.hardware.Camera;
import android.view.SurfaceHolder;
Expand Down Expand Up @@ -97,7 +98,15 @@ public void onCreate(Bundle savedInstanceState) {
public void onClick(View v) {
// TODO Auto-generated method stub
// finishActivity(1);
camera.takePicture(null, null, photoCallback);
try
{
camera.takePicture(null, null, photoCallback);
}
catch (RuntimeException e)
{
Log.w("LudoMusePicture", "Exception occured while trying to take picture. Maybe camera is not yet initialized ? : " );
e.printStackTrace();
}
// finish();
}
});
Expand Down Expand Up @@ -168,7 +177,7 @@ public void surfaceCreated(SurfaceHolder holder) {
try {
camera.setPreviewDisplay(previewHolder);
} catch (Throwable t) {
Log.e("PreviewDemo-surfaceCallback",
Log.e("LudoMusePicture",
"Exception in setPreviewDisplay()", t);
Toast.makeText(CameraActivity.this, t.getMessage(), Toast.LENGTH_LONG)
.show();
Expand Down Expand Up @@ -231,15 +240,15 @@ protected String doInBackground(byte[]...jpeg) {
File folder = new File(Environment.getExternalStorageDirectory(), "Cern");
if (!folder.exists()) {
if(!folder.mkdirs()){
Log.d("MyCameraApp", "failed to create directory");
Log.d("LudoMusePicture", "failed to create directory");
}
}
try {
FileOutputStream fos = new FileOutputStream(folder.getPath());
fos.write(jpeg[0]);
fos.close();
} catch (java.io.IOException e) {
Log.e("PictureDemo", "Exception in photoCallback", e);
Log.e("LudoMusePicture", "Exception in photoCallback", e);
}
return (null);
}
Expand Down

0 comments on commit 3478ddb

Please sign in to comment.