From 35f83fc40a8ac7d183b84f401af55491206f7bf4 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 28 Apr 2014 11:42:54 +0800 Subject: [PATCH 1/2] fixed compile fail --- cocos/2d/CCRenderTexture.cpp | 9 +- cocos/2d/cocos2d_wp8.vcxproj | 346 ++---------------- cocos/2d/cocos2d_wp8.vcxproj.filters | 166 ++++----- cocos/2d/platform/wp8/CCGLView.cpp | 7 +- cocos/2d/platform/wp8/CCGLView.h | 12 +- .../cpp-testsComponent.vcxproj | 2 + .../cpp-testsComponent.vcxproj.filters | 6 + 7 files changed, 113 insertions(+), 435 deletions(-) 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 + From b4a9381238bac02a4c082814df38d649b48a66c4 Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Mon, 28 Apr 2014 11:55:45 +0800 Subject: [PATCH 2/2] fixed return type is not right --- cocos/2d/platform/wp8/CCGLView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/2d/platform/wp8/CCGLView.cpp b/cocos/2d/platform/wp8/CCGLView.cpp index d390898d3a..5716466c59 100644 --- a/cocos/2d/platform/wp8/CCGLView.cpp +++ b/cocos/2d/platform/wp8/CCGLView.cpp @@ -429,7 +429,7 @@ void GLView::UpdateOrientationMatrix() } } -cocos2d::Point GLView::TransformToOrientation(Windows::Foundation::Point p) +cocos2d::Vector2 GLView::TransformToOrientation(Windows::Foundation::Point p) { cocos2d::Vector2 returnValue;