diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-09-26 15:10:02 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-09-26 15:10:02 +0300 |
commit | 061d4b420206c67fb346d75fb6bcaf4aa8147ca8 (patch) | |
tree | 3f17c19e529baf3a6ae13479b7805fbe5cdf46ba /src/content_cao.cpp | |
parent | b9e680d06cf56b7c8b41a6b5626a3b94304adf42 (diff) | |
parent | 2ecd53ce09d8f20a06b057c24924a010fa2eefde (diff) | |
download | minetest-061d4b420206c67fb346d75fb6bcaf4aa8147ca8.tar.gz minetest-061d4b420206c67fb346d75fb6bcaf4aa8147ca8.tar.bz2 minetest-061d4b420206c67fb346d75fb6bcaf4aa8147ca8.zip |
Merge branch 'view_bobbing_and_vielded_tool'
Diffstat (limited to 'src/content_cao.cpp')
-rw-r--r-- | src/content_cao.cpp | 68 |
1 files changed, 4 insertions, 64 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp index dfeaea85a..b6543061a 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -224,22 +224,7 @@ void ItemCAO::updateLight(u8 light_at_pos) u8 li = decode_light(light_at_pos); video::SColor color(255,li,li,li); - - scene::IMesh *mesh = m_node->getMesh(); - if(mesh == NULL) - return; - - u16 mc = mesh->getMeshBufferCount(); - for(u16 j=0; j<mc; j++) - { - scene::IMeshBuffer *buf = mesh->getMeshBuffer(j); - video::S3DVertex *vertices = (video::S3DVertex*)buf->getVertices(); - u16 vc = buf->getVertexCount(); - for(u16 i=0; i<vc; i++) - { - vertices[i].Color = color; - } - } + setMeshVerticesColor(m_node->getMesh(), color); } v3s16 ItemCAO::getLightPosition() @@ -430,22 +415,7 @@ void RatCAO::updateLight(u8 light_at_pos) u8 li = decode_light(light_at_pos); video::SColor color(255,li,li,li); - - scene::IMesh *mesh = m_node->getMesh(); - if(mesh == NULL) - return; - - u16 mc = mesh->getMeshBufferCount(); - for(u16 j=0; j<mc; j++) - { - scene::IMeshBuffer *buf = mesh->getMeshBuffer(j); - video::S3DVertex *vertices = (video::S3DVertex*)buf->getVertices(); - u16 vc = buf->getVertexCount(); - for(u16 i=0; i<vc; i++) - { - vertices[i].Color = color; - } - } + setMeshVerticesColor(m_node->getMesh(), color); } v3s16 RatCAO::getLightPosition() @@ -601,22 +571,7 @@ void Oerkki1CAO::updateLight(u8 light_at_pos) u8 li = decode_light(light_at_pos); video::SColor color(255,li,li,li); - - scene::IMesh *mesh = m_node->getMesh(); - if(mesh == NULL) - return; - - u16 mc = mesh->getMeshBufferCount(); - for(u16 j=0; j<mc; j++) - { - scene::IMeshBuffer *buf = mesh->getMeshBuffer(j); - video::S3DVertex *vertices = (video::S3DVertex*)buf->getVertices(); - u16 vc = buf->getVertexCount(); - for(u16 i=0; i<vc; i++) - { - vertices[i].Color = color; - } - } + setMeshVerticesColor(m_node->getMesh(), color); } v3s16 Oerkki1CAO::getLightPosition() @@ -833,22 +788,7 @@ void FireflyCAO::updateLight(u8 light_at_pos) u8 li = 255; video::SColor color(255,li,li,li); - - scene::IMesh *mesh = m_node->getMesh(); - if(mesh == NULL) - return; - - u16 mc = mesh->getMeshBufferCount(); - for(u16 j=0; j<mc; j++) - { - scene::IMeshBuffer *buf = mesh->getMeshBuffer(j); - video::S3DVertex *vertices = (video::S3DVertex*)buf->getVertices(); - u16 vc = buf->getVertexCount(); - for(u16 i=0; i<vc; i++) - { - vertices[i].Color = color; - } - } + setMeshVerticesColor(m_node->getMesh(), color); } v3s16 FireflyCAO::getLightPosition() |