All pastes #833786 Raw Edit

th0br0

public cpp v1 · immutable
#833786 ·published 2007-12-27 17:16 UTC
rendered paste body
void Qw::drawPlayersEsp() {        sdWorldToScreenConverter converter(gLocal->playerView.GetCurrentView());        idWStr localplname = va(L"%s", (gLocal->GetLocalPlayer()->userInfo.rawName).c_str()); // RETRIEVE TO LOCAL PLAYER NAME AND STOR IT IN A idWStr (since we will need that later on)        for (int count = 0; count < gLocal->numClients; count++) {                idPlayer *player = gLocal->GetClient(count);                if (!player || player->fl.hidden)                        continue;                LOG_DEBUG("t " << gLocal);                idVec2 position;                converter.Transform(player->firstPersonViewOrigin, position);                LOG_DEBUG("end");                //if ((position.z <= 0) || (position.z >= 1))                //      continue;                //LOG_DEBUG("drawPlayersEsp(): player: " << count << " x:" << position.x << " y:" << position.y);                //float aspectRatio = deviceContext->GetAspectRatioCorrection();                deviceContext->SetColor(1, 1, 1, 1);                idWStr s = va(L"%s", (player->userInfo.rawName).c_str()); // Get the other Player's name and store it in an idWStr since we will need it for DrawText(...);                if(s.Cmp(localplname.c_str())){ // COMPARE the local playername and the other one... if they match, don't draw the name                deviceContext->DrawText(s.c_str(), sdBounds2D(position.x, position.y, 0, 0), DTF_CENTER);                //deviceContext->DrawText(L"someone", sdBounds2D(position.x, position.y, 0, 0), DTF_CENTER);                }        }}