Chromium Code Reviews| Index: nacltoons/data/res/drawing.lua |
| diff --git a/nacltoons/data/res/drawing.lua b/nacltoons/data/res/drawing.lua |
| index 72b429293b924d2a7152d5af6f371cd66f850197..c768d4b1bbc31d81b53e54f0e878598d290b08ba 100644 |
| --- a/nacltoons/data/res/drawing.lua |
| +++ b/nacltoons/data/res/drawing.lua |
| @@ -58,8 +58,10 @@ drawing.handlers = {} |
| --- Create a b2Vec from a lua list containing 2 elements. |
| -- This is used to convert point data from .def files directly |
| -- to the box2dx coordinate system |
| -local function b2VecFromLua(point) |
| - return util.b2VecFromCocos(util.PointFromLua(point)) |
| +local function b2VecFromLua(luapoint) |
| + ccpoint = util.PointFromLua(luapoint) |
|
binji
2013/06/25 22:17:21
local ccpoint?
Sam Clegg
2013/06/26 00:01:25
Done.
|
| + rtn = util.b2VecFromCocos(ccpoint) |
|
binji
2013/06/25 22:17:21
local rtn?
Sam Clegg
2013/06/26 00:01:25
Done.
|
| + return rtn |
| end |
| local function CreateBrushBatch(parent) |
| @@ -265,7 +267,10 @@ function drawing.CreateShape(shape_def) |
| local body_def = b2BodyDef:new_local() |
| local body = level_obj.world:CreateBody(body_def) |
| local b2shape = b2EdgeShape:new_local() |
| - b2shape:Set(b2VecFromLua(shape_def.start), b2VecFromLua(shape_def.finish)) |
| + local start = b2VecFromLua(shape_def.start) |
| + local finish = b2VecFromLua(shape_def.finish) |
| + util.Log('Create edge from: ' .. util.VecToString(start) .. ' to: ' .. util.VecToString(finish)) |
| + b2shape:Set(start, finish) |
| body:CreateFixture(b2shape, 0) |
| return |
| elseif shape_def.type == 'image' then |
| @@ -335,8 +340,7 @@ end |
| function drawing.DrawEndPoint(node, location, color) |
| -- Add visible sprite |
| local child_sprite = CCSprite:createWithTexture(brush_tex) |
| - location = node:convertToNodeSpace(location) |
| - child_sprite:setPosition(location) |
| + child_sprite:setPosition(node:convertToNodeSpace(location)) |
| child_sprite:setColor(color) |
| node:addChild(child_sprite) |