Fix getColor, add/get position

This commit is contained in:
Henrique Santiago 2013-01-30 19:08:43 -02:00
parent da050a5630
commit ca9c33ff54
2 changed files with 18 additions and 4 deletions

View File

@ -35,9 +35,17 @@ end
function InputMessage:getColor() function InputMessage:getColor()
local color = {} local color = {}
color.r = msg:getU8() color.r = self:getU8()
color.g = msg:getU8() color.g = self:getU8()
color.b = msg:getU8() color.b = self:getU8()
color.a = msg:getU8() color.a = self:getU8()
return color return color
end end
function InputMessage:getPosition()
local position = {}
position.x = self:getU16()
position.y = self:getU16()
position.z = self:getU8()
return position
end

View File

@ -61,3 +61,9 @@ function OutputMessage:addColor(color)
self:addU8(color.b) self:addU8(color.b)
self:addU8(color.a) self:addU8(color.a)
end end
function OutputMessage:addPosition(position)
self:addU16(position.x)
self:addU16(position.y)
self:addU8(position.z)
end