Merge pull request #31 from Gawaboumga/master

Some changes

Former-commit-id: f4ef15537da8edef3881def68dce39f6455f9b94
This commit is contained in:
Lynix
2014-09-03 13:47:39 +02:00
6 changed files with 92 additions and 9 deletions

View File

@@ -37,10 +37,10 @@ unsigned int NzLightManager::ComputeClosestLights(const NzVector3f& position, fl
light.score = std::numeric_limits<unsigned int>::max(); // Nous jouons au Golf
}
for (unsigned int i = 0; i < m_lights.size(); ++i)
for (auto it = m_lights.begin(); it != m_lights.end(); ++it)
{
const NzLight** lights = m_lights[i].first;
unsigned int lightCount = m_lights[i].second;
const NzLight** lights = it->first;
unsigned int lightCount = it->second;
for (unsigned int j = 0; j < lightCount; ++j)
{

View File

@@ -468,7 +468,7 @@ NzVector2ui NzTexture::GetSize() const
if (!m_impl)
{
NazaraError("Texture must be valid");
return 0;
return NzVector2ui(0, 0);
}
#endif

View File

@@ -189,11 +189,9 @@ namespace
void MoveTriangleToEnd(int tri)
{
auto it = std::find(tri_indices.begin(), tri_indices.end(), tri);
int t_ind = (it != tri_indices.end()) ? std::distance(tri_indices.begin(), it) : -1;
NazaraAssert(it != tri_indices.end(), "Triangle not found");
NazaraAssert(t_ind >= 0, "Triangle not found");
tri_indices.erase(tri_indices.begin() + t_ind, tri_indices.begin() + t_ind + 1);
tri_indices.erase(it);
tri_indices.push_back(tri);
}
};

View File

@@ -146,7 +146,7 @@ unsigned int NzUtility::ComponentCount[nzComponentType_Max+1] =
static_assert(nzComponentType_Max+1 == 14, "Component count array is incomplete");
unsigned int NzUtility::ComponentStride[nzComponentType_Max+1] =
std::size_t NzUtility::ComponentStride[nzComponentType_Max+1] =
{
4*sizeof(nzUInt8), // nzComponentType_Color
1*sizeof(double), // nzComponentType_Double1