Permalink
Browse files

CCTouchDispatcher: Fixed a class cast exception caused by inconsisten…

…t management of the touch delegates.

CCTouchDispatcher: Fixed a class cast exception caused by inconsistent
management of the touch delegates.
  • Loading branch information...
1 parent 2c41aa1 commit 1f070f1c4d28450152118c95018514ae3326710b @totallyevil totallyevil committed Oct 23, 2012
View
@@ -6,6 +6,7 @@
CCNode: Renamed unsheduleAllSelectors to unscheduleAllSelectors
CCNode: Renamed sheduleUpdate to scheduleUpdate
DirectorTest: fixed the touch test logic and printing of the touched location.
+ CCTouchDispatcher: Fixed a class cast exception caused by inconsistent management of the touch delegates.
cocos2d-x for xna 0.1.3 Sep.28 2012
@@ -1,55 +1,55 @@
-/****************************************************************************
-Copyright (c) 2010-2012 cocos2d-x.org
-Copyright (c) 2009 Valentin Milea
+/****************************************************************************
+Copyright (c) 2010-2012 cocos2d-x.org
+Copyright (c) 2009 Valentin Milea
Copyright (c) 2011-2012 openxlive.com
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-****************************************************************************/
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace cocos2d
-{
- /// <summary>
- /// It forwardes each event to the delegate.
- /// </summary>
- public class CCStandardTouchHandler : CCTouchHandler
- {
- /// <summary>
- /// initializes a TouchHandler with a delegate and a priority
- /// </summary>
- public virtual bool initWithDelegate(ICCTouchDelegate pDelegate, int nPriority)
- {
- return base.initWithDelegate(pDelegate, nPriority);
- }
-
- /// <summary>
- /// allocates a TouchHandler with a delegate and a priority
- /// </summary>
- public static CCStandardTouchHandler handlerWithDelegate(ICCTouchDelegate pDelegate, int nPriority)
- {
- CCStandardTouchHandler pHandler = new CCStandardTouchHandler();
- pHandler.initWithDelegate(pDelegate, nPriority);
- return pHandler;
- }
- }
-}
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+****************************************************************************/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace cocos2d
+{
+ /// <summary>
+ /// It forwardes each event to the delegate.
+ /// </summary>
+ public class CCStandardTouchHandler : CCTouchHandler
+ {
+ /// <summary>
+ /// initializes a TouchHandler with a delegate and a priority
+ /// </summary>
+ public virtual bool initWithDelegate(ICCStandardTouchDelegate pDelegate, int nPriority)
+ {
+ return base.initWithDelegate(pDelegate, nPriority);
+ }
+
+ /// <summary>
+ /// allocates a TouchHandler with a delegate and a priority
+ /// </summary>
+ public static CCStandardTouchHandler handlerWithDelegate(ICCStandardTouchDelegate pDelegate, int nPriority)
+ {
+ CCStandardTouchHandler pHandler = new CCStandardTouchHandler();
+ pHandler.initWithDelegate(pDelegate, nPriority);
+ return pHandler;
+ }
+ }
+}
@@ -1,83 +1,83 @@
-/****************************************************************************
-Copyright (c) 2010-2012 cocos2d-x.org
-Copyright (c) 2009 Valentin Milea
+/****************************************************************************
+Copyright (c) 2010-2012 cocos2d-x.org
+Copyright (c) 2009 Valentin Milea
Copyright (c) 2011-2012 openxlive.com
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-****************************************************************************/
-
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
-namespace cocos2d
-{
- public class CCTargetedTouchHandler : CCTouchHandler
- {
- /// <summary>
- /// whether or not the touches are swallowed
- /// </summary>
- public bool IsSwallowsTouches
- {
- get { return m_bSwallowsTouches; }
- set { m_bSwallowsTouches = value; }
- }
-
- /// <summary>
- /// MutableSet that contains the claimed touches
- /// </summary>
- public List<CCTouch> ClaimedTouches
- {
- get
- {
- return m_pClaimedTouches;
- }
- }
-
- /// <summary>
- /// initializes a TargetedTouchHandler with a delegate, a priority and whether or not it swallows touches or not
- /// </summary>
- public bool initWithDelegate(ICCTouchDelegate pDelegate, int nPriority, bool bSwallow)
- {
- if (base.initWithDelegate(pDelegate, nPriority))
- {
- m_pClaimedTouches = new List<CCTouch>();
- m_bSwallowsTouches = bSwallow;
-
- return true;
- }
-
- return false;
- }
-
- /// <summary>
- /// allocates a TargetedTouchHandler with a delegate, a priority and whether or not it swallows touches or not
- /// </summary>
- public static CCTargetedTouchHandler handlerWithDelegate(ICCTouchDelegate pDelegate, int nPriority, bool bSwallow)
- {
- CCTargetedTouchHandler pHandler = new CCTargetedTouchHandler();
- pHandler.initWithDelegate(pDelegate, nPriority, bSwallow);
- return pHandler;
- }
-
- protected bool m_bSwallowsTouches;
- protected List<CCTouch> m_pClaimedTouches;
- }
-}
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+****************************************************************************/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace cocos2d
+{
+ public class CCTargetedTouchHandler : CCTouchHandler
+ {
+ /// <summary>
+ /// whether or not the touches are swallowed
+ /// </summary>
+ public bool IsSwallowsTouches
+ {
+ get { return m_bSwallowsTouches; }
+ set { m_bSwallowsTouches = value; }
+ }
+
+ /// <summary>
+ /// MutableSet that contains the claimed touches
+ /// </summary>
+ public List<CCTouch> ClaimedTouches
+ {
+ get
+ {
+ return m_pClaimedTouches;
+ }
+ }
+
+ /// <summary>
+ /// initializes a TargetedTouchHandler with a delegate, a priority and whether or not it swallows touches or not
+ /// </summary>
+ public bool initWithDelegate(ICCTargetedTouchDelegate pDelegate, int nPriority, bool bSwallow)
+ {
+ if (base.initWithDelegate(pDelegate, nPriority))
+ {
+ m_pClaimedTouches = new List<CCTouch>();
+ m_bSwallowsTouches = bSwallow;
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /// <summary>
+ /// allocates a TargetedTouchHandler with a delegate, a priority and whether or not it swallows touches or not
+ /// </summary>
+ public static CCTargetedTouchHandler handlerWithDelegate(ICCTargetedTouchDelegate pDelegate, int nPriority, bool bSwallow)
+ {
+ CCTargetedTouchHandler pHandler = new CCTargetedTouchHandler();
+ pHandler.initWithDelegate(pDelegate, nPriority, bSwallow);
+ return pHandler;
+ }
+
+ protected bool m_bSwallowsTouches;
+ protected List<CCTouch> m_pClaimedTouches;
+ }
+}
Oops, something went wrong.

0 comments on commit 1f070f1

Please sign in to comment.