use correct type to initialize an array

This commit is contained in:
minggo 2013-07-28 23:23:35 +08:00
parent f7fd7a8af5
commit 92f9ed743a
1 changed files with 7 additions and 7 deletions

View File

@ -1,12 +1,12 @@
#include "MutiTouchTest.h"
static Color3B s_TouchColors[CC_MAX_TOUCHES] = {
Color3B::YELLOW,
Color3B::BLUE,
Color3B::GREEN,
Color3B::RED,
Color3B::MAGENTA
static const Color3B* s_TouchColors[CC_MAX_TOUCHES] = {
&Color3B::YELLOW,
&Color3B::BLUE,
&Color3B::GREEN,
&Color3B::RED,
&Color3B::MAGENTA
};
class TouchPoint : public Node
@ -79,7 +79,7 @@ void MutiTouchTestLayer::ccTouchesBegan(Set *touches, Event *event)
Point location = touch->getLocation();
touchPoint->setTouchPos(location);
touchPoint->setTouchColor(s_TouchColors[touch->getID()]);
touchPoint->setTouchColor(*s_TouchColors[touch->getID()]);
addChild(touchPoint);
s_dic.setObject(touchPoint, touch->getID());