Changeset 2511


Ignore:
Timestamp:
Feb 26, 2013, 7:18:05 PM (6 years ago)
Author:
sam
Message:

debug: fewer lines of code in DrawBox().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/debug/lines.cpp

    r2500 r2511  
    3333    }
    3434
    35     Scene::GetDefault()->AddLine(v[0], v[1], color);
    36     Scene::GetDefault()->AddLine(v[1], v[3], color);
    37     Scene::GetDefault()->AddLine(v[3], v[2], color);
    38     Scene::GetDefault()->AddLine(v[2], v[0], color);
     35    for (int i = 0; i < 4; i++)
     36    {
     37        int j = ((i & 1) << 1) | ((i >> 1) ^ 1);
    3938
    40     Scene::GetDefault()->AddLine(v[4], v[5], color);
    41     Scene::GetDefault()->AddLine(v[5], v[7], color);
    42     Scene::GetDefault()->AddLine(v[7], v[6], color);
    43     Scene::GetDefault()->AddLine(v[6], v[4], color);
    44 
    45     Scene::GetDefault()->AddLine(v[0], v[4], color);
    46     Scene::GetDefault()->AddLine(v[1], v[5], color);
    47     Scene::GetDefault()->AddLine(v[2], v[6], color);
    48     Scene::GetDefault()->AddLine(v[3], v[7], color);
     39        Scene::GetDefault()->AddLine(v[i], v[i + 4], color);
     40        Scene::GetDefault()->AddLine(v[i], v[j], color);
     41        Scene::GetDefault()->AddLine(v[i + 4], v[j + 4], color);
     42    }
    4943}
    5044
Note: See TracChangeset for help on using the changeset viewer.