Fix bug in ServerHostname found by MSVC's debug allocator. Sneak in a comment.

This commit is contained in:
Henrik Rydgard 2013-04-14 09:56:16 +02:00
parent c8238a1a05
commit af06611691
3 changed files with 5 additions and 2 deletions

View File

@ -87,9 +87,10 @@ namespace Reporting
std::string host = ServerHost();
size_t length = ServerHostnameLength();
lastHostname = host.substr(0, length);
if (length == lastHostname.npos)
return lastHostname.c_str();
lastHostname = host.substr(0, length);
return lastHostname.c_str();
}

View File

@ -907,6 +907,8 @@ u32 TransformDrawEngine::ComputeHash() {
if (!drawCalls[i].inds) {
fullhash += CityHash32((const char *)drawCalls[i].verts, vertexSize * drawCalls[i].vertexCount);
} else {
// This could get seriously expensive with sparse indices. Need to combine hashing ranges the same way
// we do when drawing.
fullhash += CityHash32((const char *)drawCalls[i].verts + vertexSize * drawCalls[i].indexLowerBound,
vertexSize * (drawCalls[i].indexUpperBound - drawCalls[i].indexLowerBound));
int indexSize = (dec_->VertexType() & GE_VTYPE_IDX_MASK) == GE_VTYPE_IDX_16BIT ? 2 : 1;

2
native

@ -1 +1 @@
Subproject commit 9b709c21704c433ea809a9e3ed710fc8714e6034
Subproject commit 961e400e1f07ae313cc8ef13e1669b2a549c8899