瀏覽代碼

debug: fewer lines of code in DrawBox().

legacy
Sam Hocevar sam 12 年之前
父節點
當前提交
b29519602a
共有 1 個文件被更改,包括 8 次插入14 次删除
  1. +8
    -14
      src/debug/lines.cpp

+ 8
- 14
src/debug/lines.cpp 查看文件

@@ -32,20 +32,14 @@ void Debug::DrawBox(vec3 a, vec3 b, vec4 color)
v[i].z = i & 4 ? a.z : b.z;
}

Scene::GetDefault()->AddLine(v[0], v[1], color);
Scene::GetDefault()->AddLine(v[1], v[3], color);
Scene::GetDefault()->AddLine(v[3], v[2], color);
Scene::GetDefault()->AddLine(v[2], v[0], color);

Scene::GetDefault()->AddLine(v[4], v[5], color);
Scene::GetDefault()->AddLine(v[5], v[7], color);
Scene::GetDefault()->AddLine(v[7], v[6], color);
Scene::GetDefault()->AddLine(v[6], v[4], color);

Scene::GetDefault()->AddLine(v[0], v[4], color);
Scene::GetDefault()->AddLine(v[1], v[5], color);
Scene::GetDefault()->AddLine(v[2], v[6], color);
Scene::GetDefault()->AddLine(v[3], v[7], color);
for (int i = 0; i < 4; i++)
{
int j = ((i & 1) << 1) | ((i >> 1) ^ 1);

Scene::GetDefault()->AddLine(v[i], v[i + 4], color);
Scene::GetDefault()->AddLine(v[i], v[j], color);
Scene::GetDefault()->AddLine(v[i + 4], v[j + 4], color);
}
}

} /* namespace lol */


Loading…
取消
儲存