diff --git a/cocos/2d/CCRenderTexture.cpp b/cocos/2d/CCRenderTexture.cpp index 26bf8d1034..b2d30f348a 100644 --- a/cocos/2d/CCRenderTexture.cpp +++ b/cocos/2d/CCRenderTexture.cpp @@ -535,12 +535,9 @@ void RenderTexture::onBegin() director->setProjection(director->getProjection()); #if CC_TARGET_PLATFORM == CC_PLATFORM_WP8 - kmMat4 modifiedProjection; - kmGLGetMatrix(KM_GL_PROJECTION, &modifiedProjection); - kmMat4Multiply(&modifiedProjection, CCEGLView::sharedOpenGLView()->getReverseOrientationMatrix(), &modifiedProjection); - kmGLMatrixMode(KM_GL_PROJECTION); - kmGLLoadMatrix(&modifiedProjection); - kmGLMatrixMode(KM_GL_MODELVIEW); + Matrix modifiedProjection = director->getMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION); + modifiedProjection = CCEGLView::sharedOpenGLView()->getReverseOrientationMatrix() * modifiedProjection; + director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_PROJECTION,modifiedProjection); #endif const Size& texSize = _texture->getContentSizeInPixels(); diff --git a/cocos/2d/cocos2d_wp8.vcxproj b/cocos/2d/cocos2d_wp8.vcxproj index 82ce59377b..a932465d98 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj +++ b/cocos/2d/cocos2d_wp8.vcxproj @@ -221,316 +221,19 @@ + - - false - false - false - false - CompileAsCpp - CompileAsCpp - CompileAsCpp - CompileAsCpp - NotUsing - NotUsing - NotUsing - NotUsing - - - - - - - - - - - false - false - false - false - CompileAsCpp - CompileAsCpp - CompileAsCpp - CompileAsCpp - NotUsing - NotUsing - NotUsing - NotUsing - - - - - - - - - - - false - false - false - false - CompileAsCpp - CompileAsCpp - CompileAsCpp - CompileAsCpp - NotUsing - NotUsing - NotUsing - NotUsing - - - - - - - - - - - false - false - false - false - CompileAsCpp - CompileAsCpp - CompileAsCpp - CompileAsCpp - NotUsing - NotUsing - NotUsing - NotUsing - - - - - - - - - - - false - false - false - false - CompileAsCpp - CompileAsCpp - CompileAsCpp - CompileAsCpp - NotUsing - NotUsing - NotUsing - NotUsing - - - - - - - - - - - false - false - false - false - CompileAsCpp - CompileAsCpp - CompileAsCpp - CompileAsCpp - NotUsing - NotUsing - NotUsing - NotUsing - - - - - - - - - - - false - false - false - false - CompileAsCpp - CompileAsCpp - CompileAsCpp - CompileAsCpp - NotUsing - NotUsing - NotUsing - NotUsing - - - - - - - - - - - false - false - false - false - CompileAsCpp - CompileAsCpp - CompileAsCpp - CompileAsCpp - NotUsing - NotUsing - NotUsing - NotUsing - - - - - - - - - - - false - false - false - false - CompileAsCpp - CompileAsCpp - CompileAsCpp - CompileAsCpp - NotUsing - NotUsing - NotUsing - NotUsing - - - - - - - - - - - CompileAsCpp - CompileAsCpp - CompileAsCpp - CompileAsCpp - NotUsing - NotUsing - NotUsing - NotUsing - - - - - - - - - - - false - false - false - false - CompileAsCpp - CompileAsCpp - CompileAsCpp - CompileAsCpp - NotUsing - NotUsing - NotUsing - NotUsing - - - - - - - - - - - false - false - false - false - CompileAsCpp - CompileAsCpp - CompileAsCpp - CompileAsCpp - NotUsing - NotUsing - NotUsing - NotUsing - - - - - - - - - - - false - false - false - false - CompileAsCpp - CompileAsCpp - CompileAsCpp - CompileAsCpp - NotUsing - NotUsing - NotUsing - NotUsing - - - - - - - - - - - false - false - false - false - CompileAsCpp - CompileAsCpp - CompileAsCpp - CompileAsCpp - NotUsing - NotUsing - NotUsing - NotUsing - - - - - - - - - + + + + + + @@ -655,7 +358,6 @@ - @@ -701,7 +403,6 @@ - @@ -743,21 +444,14 @@ - - - - - - - - - - - - - - - + + + + + + + + @@ -898,7 +592,6 @@ - @@ -912,4 +605,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/cocos/2d/cocos2d_wp8.vcxproj.filters b/cocos/2d/cocos2d_wp8.vcxproj.filters index b528e23c7c..6033b06ccf 100644 --- a/cocos/2d/cocos2d_wp8.vcxproj.filters +++ b/cocos/2d/cocos2d_wp8.vcxproj.filters @@ -58,9 +58,6 @@ {5b082c5c-d396-43ca-b3b1-997d0f6247d0} - - {7751500e-ac9e-4604-a96d-670b30b7d8bd} - {163895ae-8a8e-46bf-bdf2-98bb2c1347fc} @@ -106,6 +103,9 @@ {5598fb0c-c012-45b6-8e43-447e7891b61d} + + {9bbf7050-757b-41b1-ab15-418db52c2023} + @@ -383,7 +383,6 @@ - support @@ -483,9 +482,6 @@ renderer - - renderer - renderer @@ -547,48 +543,6 @@ platform\winrt - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - platform\winrt @@ -619,6 +573,25 @@ platform\winrt + + + math + + + math + + + math + + + math + + + math + + + math + @@ -1048,9 +1021,6 @@ renderer - - renderer - renderer @@ -1118,51 +1088,6 @@ platform\winrt - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - - - kazmath - platform\winrt @@ -1208,5 +1133,52 @@ platform\winrt + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + math + + + + + math + + + math + + + math + + + math + + + math + + + math + + + math + \ No newline at end of file diff --git a/cocos/2d/platform/wp8/CCGLView.cpp b/cocos/2d/platform/wp8/CCGLView.cpp index ced5ac3a50..d390898d3a 100644 --- a/cocos/2d/platform/wp8/CCGLView.cpp +++ b/cocos/2d/platform/wp8/CCGLView.cpp @@ -397,10 +397,9 @@ void GLView::UpdateWindowSize() } } -const kmMat4* GLView::getOrientationMatrix() const +const Matrix& GLView::getOrientationMatrix() const { - const kmMat4* k = &m_orientationMatrix; - return &m_orientationMatrix; + return m_orientationMatrix; }; @@ -430,7 +429,7 @@ void GLView::UpdateOrientationMatrix() } } -cocos2d::Vector2 GLView::TransformToOrientation(Windows::Foundation::Vector2 p) +cocos2d::Point GLView::TransformToOrientation(Windows::Foundation::Point p) { cocos2d::Vector2 returnValue; diff --git a/cocos/2d/platform/wp8/CCGLView.h b/cocos/2d/platform/wp8/CCGLView.h index 0689e28802..9dc2603b11 100644 --- a/cocos/2d/platform/wp8/CCGLView.h +++ b/cocos/2d/platform/wp8/CCGLView.h @@ -62,8 +62,8 @@ public: virtual void swapBuffers(); virtual void setViewPortInPoints(float x , float y , float w , float h); virtual void setScissorInPoints(float x , float y , float w , float h); - const kmMat4* getOrientationMatrix() const; - const kmMat4* getReverseOrientationMatrix () const {return &m_reverseOrientationMatrix;}; + const Matrix& getOrientationMatrix() const; + const Matrix& getReverseOrientationMatrix () const {return m_reverseOrientationMatrix;}; Windows::Graphics::Display::DisplayOrientations getDeviceOrientation() {return m_orientation;}; @@ -147,12 +147,12 @@ private: void UpdateWindowSize(); void UpdateOrientationMatrix(); - cocos2d::Vector2 TransformToOrientation(Windows::Foundation::Vector2 point); + cocos2d::Vector2 TransformToOrientation(Windows::Foundation::Point point); cocos2d::Vector2 GetPoint(Windows::UI::Core::PointerEventArgs^ args); Windows::Foundation::Rect m_windowBounds; Windows::Foundation::EventRegistrationToken m_eventToken; - Windows::Foundation::Vector2 m_lastPoint; + Windows::Foundation::Point m_lastPoint; float m_width; float m_height; @@ -163,8 +163,8 @@ private: bool m_lastPointValid; bool m_windowClosed; bool m_windowVisible; - kmMat4 m_orientationMatrix; - kmMat4 m_reverseOrientationMatrix; + Matrix m_orientationMatrix; + Matrix m_reverseOrientationMatrix; bool m_running; diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj index e03fcc0c04..03d3db101f 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj @@ -272,6 +272,7 @@ + @@ -466,6 +467,7 @@ + diff --git a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters index f999d7fce7..b134df2fb4 100644 --- a/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters +++ b/tests/cpp-tests/proj.wp8-xaml/cpp-testsComponent/cpp-testsComponent.vcxproj.filters @@ -834,6 +834,9 @@ Classes\CurlTest + + Classes\UnitTest + @@ -1545,6 +1548,9 @@ Classes\CurlTest + + Classes\UnitTest +