mirror of https://github.com/axmolengine/axmol.git
issue #1177:Updated some files for ios port.
This commit is contained in:
parent
5b77e6e80e
commit
af86a52f27
|
@ -0,0 +1,8 @@
|
|||
<?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>IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
|
@ -195,9 +195,15 @@ void CCEGLViewProtocol::handleTouchesBegin(int num, int ids[], float xs[], float
|
|||
}
|
||||
|
||||
CCTouch* pTouch = s_pTouches[nUnusedIndex] = new CCTouch();
|
||||
pTouch->SetTouchInfo(nUnusedIndex, (x - m_rcViewPort.origin.x) / m_fScreenScaleFactor,
|
||||
(y - m_rcViewPort.origin.y) / m_fScreenScaleFactor);
|
||||
|
||||
if (m_bNeedScale)
|
||||
{
|
||||
pTouch->SetTouchInfo(nUnusedIndex, (x - m_rcViewPort.origin.x) / m_fScreenScaleFactor,
|
||||
(y - m_rcViewPort.origin.y) / m_fScreenScaleFactor);
|
||||
}
|
||||
else
|
||||
{
|
||||
pTouch->SetTouchInfo(nUnusedIndex, x, y);
|
||||
}
|
||||
CCInteger* pInterObj = new CCInteger(nUnusedIndex);
|
||||
s_TouchesIntergerDict.setObject(pInterObj, id);
|
||||
set.addObject(pTouch);
|
||||
|
@ -233,8 +239,15 @@ void CCEGLViewProtocol::handleTouchesMove(int num, int ids[], float xs[], float
|
|||
CCTouch* pTouch = s_pTouches[pIndex->getValue()];
|
||||
if (pTouch)
|
||||
{
|
||||
pTouch->SetTouchInfo(pIndex->getValue(), (x - m_rcViewPort.origin.x) / m_fScreenScaleFactor,
|
||||
(y - m_rcViewPort.origin.y) / m_fScreenScaleFactor);
|
||||
if (m_bNeedScale)
|
||||
{
|
||||
pTouch->SetTouchInfo(pIndex->getValue(), (x - m_rcViewPort.origin.x) / m_fScreenScaleFactor,
|
||||
(y - m_rcViewPort.origin.y) / m_fScreenScaleFactor);
|
||||
}
|
||||
else
|
||||
{
|
||||
pTouch->SetTouchInfo(pIndex->getValue(), x, y);
|
||||
}
|
||||
set.addObject(pTouch);
|
||||
}
|
||||
else
|
||||
|
@ -274,8 +287,16 @@ void CCEGLViewProtocol::getSetOfTouchesEndOrCancel(CCSet& set, int num, int ids[
|
|||
{
|
||||
CCLOG("Ending touches with id: %d, x=%f, y=%f", id, x, y);
|
||||
|
||||
pTouch->SetTouchInfo(pIndex->getValue(), (x - m_rcViewPort.origin.x) / m_fScreenScaleFactor,
|
||||
(y - m_rcViewPort.origin.y) / m_fScreenScaleFactor);
|
||||
if (m_bNeedScale)
|
||||
{
|
||||
pTouch->SetTouchInfo(pIndex->getValue(), (x - m_rcViewPort.origin.x) / m_fScreenScaleFactor,
|
||||
(y - m_rcViewPort.origin.y) / m_fScreenScaleFactor);
|
||||
}
|
||||
else
|
||||
{
|
||||
pTouch->SetTouchInfo(pIndex->getValue(), x, y);
|
||||
}
|
||||
|
||||
set.addObject(pTouch);
|
||||
|
||||
// release the object
|
||||
|
|
|
@ -57,17 +57,17 @@ bool CCEGLView::isOpenGLReady()
|
|||
return [EAGLView sharedEGLView] != NULL;
|
||||
}
|
||||
|
||||
bool CCEGLView::canSetContentScaleFactor()
|
||||
{
|
||||
return [[EAGLView sharedEGLView] respondsToSelector:@selector(setContentScaleFactor:)];
|
||||
}
|
||||
bool CCEGLView::canSetContentScaleFactor()
|
||||
{
|
||||
return [[EAGLView sharedEGLView] respondsToSelector:@selector(setContentScaleFactor:)];
|
||||
}
|
||||
|
||||
void CCEGLView::setContentScaleFactor(float contentScaleFactor)
|
||||
{
|
||||
UIView * view = [EAGLView sharedEGLView];
|
||||
view.contentScaleFactor = contentScaleFactor;
|
||||
[view setNeedsLayout];
|
||||
}
|
||||
void CCEGLView::setContentScaleFactor(float contentScaleFactor)
|
||||
{
|
||||
UIView * view = [EAGLView sharedEGLView];
|
||||
view.contentScaleFactor = contentScaleFactor;
|
||||
[view setNeedsLayout];
|
||||
}
|
||||
|
||||
void CCEGLView::end()
|
||||
{
|
||||
|
|
|
@ -229,7 +229,7 @@ static EAGLView *view = 0;
|
|||
|
||||
//discardFramebufferSupported_ = [[CCConfiguration sharedConfiguration] supportsDiscardFramebuffer];
|
||||
|
||||
CHECK_GL_ERROR_DEBUG();
|
||||
CHECK_GL_ERROR();
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
f46f3ef49ab63a9336441503e20945a3e8a6d6f6
|
||||
8b5c548106a7fde2f85a35a0b0ac330b836d21ad
|
Loading…
Reference in New Issue