本文整理汇总了C++中LLTimer::getElapsedTimeF32方法的典型用法代码示例。如果您正苦于以下问题:C++ LLTimer::getElapsedTimeF32方法的具体用法?C++ LLTimer::getElapsedTimeF32怎么用?C++ LLTimer::getElapsedTimeF32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLTimer
的用法示例。
在下文中一共展示了LLTimer::getElapsedTimeF32方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: temp
void object::test<5>()
{
set_test_name("bad type");
LLSD request;
request["uri"] = uri;
request["method"] = "getdict";
request["reply"] = "reply";
(void)request["params"];
// Set up a timeout filter so we don't spin forever waiting.
LLEventTimeout watchdog;
// Connect the timeout filter to the reply pump.
LLTempBoundListener temp(
pumps.obtain("reply").
listen("watchdog", boost::bind(&LLEventTimeout::post, boost::ref(watchdog), _1)));
// Now connect our target listener to the timeout filter.
watchdog.listen("captureReply", boost::bind(&data::captureReply, this, _1));
// Kick off the request...
reply.clear();
pumps.obtain("LLXMLRPCTransaction").post(request);
// Set the timer
F32 timeout(10);
watchdog.eventAfter(timeout, LLSD().insert("timeout", 0));
// and pump "mainloop" until we get something, whether from
// LLXMLRPCListener or from the watchdog filter.
LLTimer timer;
F32 start = timer.getElapsedTimeF32();
LLEventPump& mainloop(pumps.obtain("mainloop"));
while (reply.isUndefined())
{
mainloop.post(LLSD());
}
ensure("timeout works", (timer.getElapsedTimeF32() - start) < (timeout + 1));
ensure_equals(reply["status"].asString(), "BadType");
ensure_contains("bad type", reply["responses"]["nested_dict"].asString(), "bad XMLRPC type");
}
示例2: timeout
/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
{
slmGetTimer.stop();
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
llinfos << " SLM GET status: " << status << llendl;
llinfos << " SLM GET reason: " << reason << llendl;
llinfos << " SLM GET content: " << content.asString() << llendl;
llinfos << " SLM GET timer: " << slmGetTimer.getElapsedTimeF32() << llendl;
}
if ((status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR) ||
(status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT))
{
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
llinfos << " SLM GET clearing marketplace cookie due to authentication failure or timeout (" << status << " / " << reason << ")." << llendl;
}
sMarketplaceCookie.clear();
}
sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_PROCESSING);
sImportGetPending = false;
sImportResultStatus = status;
sImportResults = content;
}
示例3: if
/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
{
slmGetTimer.stop();
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
llinfos << " SLM GET status: " << status << llendl;
llinfos << " SLM GET reason: " << reason << llendl;
llinfos << " SLM GET content: " << content.asString() << llendl;
llinfos << " SLM GET timer: " << slmGetTimer.getElapsedTimeF32() << llendl;
}
// MAINT-2452 : Do not clear the cookie on IMPORT_DONE_WITH_ERRORS : Happens when trying to import objects with wrong permissions
// ACME-1221 : Do not clear the cookie on IMPORT_NOT_FOUND : Happens for newly created Merchant accounts that are initially empty
if ((status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST) &&
(status != MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS) &&
(status != MarketplaceErrorCodes::IMPORT_NOT_FOUND))
{
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
llinfos << " SLM GET clearing marketplace cookie due to client or server error (" << status << " / " << reason << ")." << llendl;
}
sMarketplaceCookie.clear();
}
else if (gSavedSettings.getBOOL("InventoryOutboxLogging") && (status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST))
{
llinfos << " SLM GET : Got error status = " << status << ", but marketplace cookie not cleared." << llendl;
}
sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_PROCESSING);
sImportGetPending = false;
sImportResultStatus = status;
sImportResults = content;
}
示例4: if
/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
{
slmGetTimer.stop();
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
llinfos << " SLM GET status: " << status << llendl;
llinfos << " SLM GET reason: " << reason << llendl;
llinfos << " SLM GET content: " << content.asString() << llendl;
llinfos << " SLM GET timer: " << slmGetTimer.getElapsedTimeF32() << llendl;
}
// MAINT-2452 : Do not clear the cookie on IMPORT_DONE_WITH_ERRORS
if ((status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST) &&
(status != MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS))
{
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
llinfos << " SLM GET clearing marketplace cookie due to client or server error (" << status << " / " << reason << ")." << llendl;
}
sMarketplaceCookie.clear();
}
else if (gSavedSettings.getBOOL("InventoryOutboxLogging") && (status == MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS))
{
llinfos << " SLM GET : Got IMPORT_DONE_WITH_ERRORS, marketplace cookie not cleared." << llendl;
}
sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_PROCESSING);
sImportGetPending = false;
sImportResultStatus = status;
sImportResults = content;
}
示例5: pump_loop
F32 pump_loop(LLPumpIO* pump, F32 seconds)
{
LLTimer timer;
timer.setTimerExpirySec(seconds);
while(!timer.hasExpired())
{
LLFrameTimer::updateFrameTime();
pump->pump();
pump->callback();
}
return timer.getElapsedTimeF32();
}
示例6: draw
void LLProgressBar::draw()
{
static LLTimer timer;
F32 alpha = getDrawContext().mAlpha;
LLColor4 image_bar_color = mColorBackground.get();
image_bar_color.setAlpha(alpha);
mImageBar->draw(getLocalRect(), image_bar_color);
alpha *= 0.5f + 0.5f*0.5f*(1.f + (F32)sin(3.f*timer.getElapsedTimeF32()));
LLColor4 bar_color = mColorBar.get();
bar_color.mV[VALPHA] *= alpha; // modulate alpha
LLRect progress_rect = getLocalRect();
progress_rect.mRight = llround(getRect().getWidth() * (mPercentDone / 100.f));
mImageFill->draw(progress_rect, bar_color);
}
示例7: purgeTextureFilesTimeSliced
void LLTextureCache::purgeTextureFilesTimeSliced(BOOL force_all)
{
LLMutexLock lock(&mHeaderMutex);
F32 delay_between_passes = 1.0f; // seconds
F32 max_time_per_pass = 0.1f; // seconds
if (!force_all && mTimeLastFileDelete.getElapsedTimeF32() <= delay_between_passes)
{
return;
}
LLTimer timer;
S32 howmany = 0;
if (mFilesToDelete.size() > 0)
{
llinfos << "TEXTURE CACHE: " << mFilesToDelete.size() << " files scheduled for deletion" << llendl;
}
for (LLTextureCache::filename_list_t::iterator iter = mFilesToDelete.begin(); iter!=mFilesToDelete.end(); )
{
LLTextureCache::filename_list_t::iterator iter2 = iter++;
ll_apr_file_remove(*iter2, NULL);
mFilesToDelete.erase(iter2);
howmany++;
if (!force_all && timer.getElapsedTimeF32() > max_time_per_pass)
{
break;
}
}
if (!mFilesToDelete.empty())
{
llinfos << "TEXTURE CACHE: "<< howmany << " files deleted ("
<< mFilesToDelete.size() << " files left for next pass)"
<< llendl;
}
mTimeLastFileDelete.reset();
}
示例8: draw
void LLProgressBar::draw()
{
static LLTimer timer;
LLUIImagePtr shadow_imagep = LLUI::getUIImage("rounded_square_soft.tga");
LLUIImagePtr bar_fg_imagep = LLUI::getUIImage("progressbar_fill.tga");
LLUIImagePtr bar_bg_imagep = LLUI::getUIImage("progressbar_track.tga");
LLUIImagePtr bar_imagep = LLUI::getUIImage("rounded_square.tga");
LLColor4 background_color = LLUI::sColorsGroup->getColor("LoginProgressBarBgColor");
bar_bg_imagep->draw(getLocalRect(),
background_color);
F32 alpha = 0.5f + 0.5f*0.5f*(1.f + (F32)sin(3.f*timer.getElapsedTimeF32()));
LLColor4 bar_color = LLUI::sColorsGroup->getColor("LoginProgressBarFgColor");
bar_color.mV[3] = alpha;
LLRect progress_rect = getLocalRect();
progress_rect.mRight = llround(getRect().getWidth() * (mPercentDone / 100.f));
bar_fg_imagep->draw(progress_rect);
}
示例9:
/*virtual*/ void completed(U32 status, const std::string& reason, const LLSD& content)
{
slmPostTimer.stop();
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
llinfos << " SLM POST status: " << status << llendl;
llinfos << " SLM POST reason: " << reason << llendl;
llinfos << " SLM POST content: " << content.asString() << llendl;
llinfos << " SLM POST timer: " << slmPostTimer.getElapsedTimeF32() << llendl;
}
// MAINT-2301 : we determined we can safely ignore that error in that context
if (status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT)
{
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
llinfos << " SLM POST : Ignoring time out status and treating it as success" << llendl;
}
status = MarketplaceErrorCodes::IMPORT_DONE;
}
if (status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST)
{
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
llinfos << " SLM POST clearing marketplace cookie due to client or server error" << llendl;
}
sMarketplaceCookie.clear();
}
sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_DONE);
sImportPostPending = false;
sImportResultStatus = status;
sImportId = content;
}
示例10: sendPacket
BOOL LLPacketRing::sendPacket(int h_socket, char * send_buffer, S32 buf_size, LLHost host)
{
//<edit>
LLMessageLog::log(LLHost(16777343, gMessageSystem->getListenPort()), host, (U8*)send_buffer, buf_size);
//</edit>
BOOL status = TRUE;
if (!mUseOutThrottle)
{
return doSendPacket(h_socket, send_buffer, buf_size, host );
}
else
{
mActualBitsOut += buf_size * 8;
LLPacketBuffer *packetp = NULL;
// See if we've got enough throttle to send a packet.
while (!mOutThrottle.checkOverflow(0.f))
{
// While we have enough bandwidth, send a packet from the queue or the current packet
S32 packet_size = 0;
if (!mSendQueue.empty())
{
// Send a packet off of the queue
LLPacketBuffer *packetp = mSendQueue.front();
mSendQueue.pop();
mOutBufferLength -= packetp->getSize();
packet_size = packetp->getSize();
status = doSendPacket(h_socket, packetp->getData(), packet_size, packetp->getHost());
delete packetp;
// Update the throttle
mOutThrottle.throttleOverflow(packet_size * 8.f);
}
else
{
// If the queue's empty, we can just send this packet right away.
status = doSendPacket(h_socket, send_buffer, buf_size, host );
packet_size = buf_size;
// Update the throttle
mOutThrottle.throttleOverflow(packet_size * 8.f);
// This was the packet we're sending now, there are no other packets
// that we need to send
return status;
}
}
// We haven't sent the incoming packet, add it to the queue
if (mOutBufferLength + buf_size > mMaxBufferLength)
{
// Nuke this packet, we overflowed the buffer.
// Toss it.
llwarns << "Throwing away outbound packet, overflowing buffer" << llendl;
}
else
{
static LLTimer queue_timer;
if ((mOutBufferLength > 4192) && queue_timer.getElapsedTimeF32() > 1.f)
{
// Add it to the queue
llinfos << "Outbound packet queue " << mOutBufferLength << " bytes" << llendl;
queue_timer.reset();
}
packetp = new LLPacketBuffer(host, send_buffer, buf_size);
mOutBufferLength += packetp->getSize();
mSendQueue.push(packetp);
}
}
return status;
}
示例11: decodeData
//.........这里部分代码省略.........
break;
case 4:
htonmemcpy(&tsize, &buffer[decode_pos], MVT_U32, 4);
break;
default:
llerrs << "Attempting to read variable field with unknown size of " << data_size << llendl;
break;
}
}
decode_pos += data_size;
cur_data_block->addData(mvci.getName(), &buffer[decode_pos], tsize, mvci.getType());
decode_pos += tsize;
}
else
{
// fixed!
// so, copy data pointer and set data size to fixed size
if ((decode_pos + mvci.getSize()) > mReceiveSize)
{
logRanOffEndOfPacket(sender, decode_pos, mvci.getSize());
// default to 0s.
U32 size = mvci.getSize();
std::vector<U8> data(size);
if (size) memset(&(data[0]), 0, size);
cur_data_block->addData(mvci.getName(), &(data[0]),
size, mvci.getType());
}
else
{
cur_data_block->addData(mvci.getName(),
&buffer[decode_pos],
mvci.getSize(),
mvci.getType());
}
decode_pos += mvci.getSize();
}
}
}
}
if (mCurrentRMessageData->mMemberBlocks.empty()
&& !mCurrentRMessageTemplate->mMemberBlocks.empty())
{
lldebugs << "Empty message '" << mCurrentRMessageTemplate->mName << "' (no blocks)" << llendl;
return FALSE;
}
{
static LLTimer decode_timer;
if(LLMessageReader::getTimeDecodes() || gMessageSystem->getTimingCallback())
{
decode_timer.reset();
}
{
LLFastTimer t(LLFastTimer::FTM_PROCESS_MESSAGES);
if( !mCurrentRMessageTemplate->callHandlerFunc(gMessageSystem) )
{
llwarns << "Message from " << sender << " with no handler function received: " << mCurrentRMessageTemplate->mName << llendl;
}
}
if(LLMessageReader::getTimeDecodes() || gMessageSystem->getTimingCallback())
{
F32 decode_time = decode_timer.getElapsedTimeF32();
if (gMessageSystem->getTimingCallback())
{
(gMessageSystem->getTimingCallback())(mCurrentRMessageTemplate->mName,
decode_time,
gMessageSystem->getTimingCallbackData());
}
if (LLMessageReader::getTimeDecodes())
{
mCurrentRMessageTemplate->mDecodeTimeThisFrame += decode_time;
mCurrentRMessageTemplate->mTotalDecoded++;
mCurrentRMessageTemplate->mTotalDecodeTime += decode_time;
if( mCurrentRMessageTemplate->mMaxDecodeTimePerMsg < decode_time )
{
mCurrentRMessageTemplate->mMaxDecodeTimePerMsg = decode_time;
}
if(decode_time > LLMessageReader::getTimeDecodesSpamThreshold())
{
lldebugs << "--------- Message " << mCurrentRMessageTemplate->mName << " decode took " << decode_time << " seconds. (" <<
mCurrentRMessageTemplate->mMaxDecodeTimePerMsg << " max, " <<
(mCurrentRMessageTemplate->mTotalDecodeTime / mCurrentRMessageTemplate->mTotalDecoded) << " avg)" << llendl;
}
}
}
}
return TRUE;
}
示例12: gpu_benchmark
//.........这里部分代码省略.........
LLStrider<LLVector2> tc;
buff->getVertexStrider(v);
v[0].set(-1,1,0);
v[1].set(-1,-3,0);
v[2].set(3,1,0);
buff->flush();
gBenchmarkProgram.bind();
bool busted_finish = false;
buff->setBuffer(LLVertexBuffer::MAP_VERTEX);
glFinish();
for (S32 c = -1; c < samples; ++c)
{
LLTimer timer;
timer.start();
for (U32 i = 0; i < count; ++i)
{
dest[i].bindTarget();
gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, source[i]);
buff->drawArrays(LLRender::TRIANGLES, 0, 3);
dest[i].flush();
}
//wait for current batch of copies to finish
if (busted_finish)
{
//read a pixel off the last target since some drivers seem to ignore glFinish
dest[count-1].bindTarget();
U32 pixel = 0;
glReadPixels(0,0,1,1,GL_RGBA, GL_UNSIGNED_BYTE, &pixel);
dest[count-1].flush();
}
else
{
glFinish();
}
F32 time = timer.getElapsedTimeF32();
if (c >= 0) // <-- ignore the first sample as it tends to be artificially slow
{
//store result in gigabytes per second
F32 gb = (F32) ((F64) (res*res*8*count))/(1000000000);
F32 gbps = gb/time;
if (!gGLManager.mHasTimerQuery && !busted_finish && gbps > 128.f)
{ //unrealistically high bandwidth for a card without timer queries, glFinish is probably ignored
busted_finish = true;
LL_WARNS() << "GPU Benchmark detected GL driver with broken glFinish implementation." << LL_ENDL;
}
else
{
results.push_back(gbps);
}
}
}
gBenchmarkProgram.unbind();
if (gGLManager.mHasTimerQuery)
{
LLGLSLShader::finishProfile(false);
}
LLImageGL::deleteTextures(count, source);
std::sort(results.begin(), results.end());
F32 gbps = results[results.size()/2];
LL_INFOS() << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to CPU timers" << LL_ENDL;
#if LL_DARWIN
if (gbps > 512.f)
{
LL_WARNS() << "Memory bandwidth is improbably high and likely incorrect; discarding result." << LL_ENDL;
//OSX is probably lying, discard result
gbps = -1.f;
}
#endif
F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f;
F32 seconds = ms/1000.f;
F64 samples_drawn = res*res*count*samples;
F32 samples_sec = (samples_drawn/1000000000.0)/seconds;
gbps = samples_sec*8;
LL_INFOS() << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to ARB_timer_query" << LL_ENDL;
return gbps;
}
示例13: decodeAllImages
void LLViewerImageList::decodeAllImages(F32 max_time)
{
LLTimer timer;
if(gNoRender) return;
// Update texture stats and priorities
std::vector<LLPointer<LLViewerImage> > image_list;
for (image_priority_list_t::iterator iter = mImageList.begin();
iter != mImageList.end(); )
{
LLViewerImage* imagep = *iter++;
image_list.push_back(imagep);
imagep->mInImageList = FALSE;
}
mImageList.clear();
for (std::vector<LLPointer<LLViewerImage> >::iterator iter = image_list.begin();
iter != image_list.end(); ++iter)
{
LLViewerImage* imagep = *iter;
imagep->processTextureStats();
F32 decode_priority = imagep->calcDecodePriority();
imagep->setDecodePriority(decode_priority);
mImageList.insert(imagep);
imagep->mInImageList = TRUE;
}
image_list.clear();
// Update fetch (decode)
for (image_priority_list_t::iterator iter = mImageList.begin();
iter != mImageList.end(); )
{
LLViewerImage* imagep = *iter++;
imagep->updateFetch();
}
// Run threads
S32 fetch_pending = 0;
while (1)
{
LLAppViewer::instance()->getTextureCache()->update(1); // unpauses the texture cache thread
LLAppViewer::instance()->getImageDecodeThread()->update(1); // unpauses the image thread
fetch_pending = LLAppViewer::instance()->getTextureFetch()->update(1); // unpauses the texture fetch thread
if (fetch_pending == 0 || timer.getElapsedTimeF32() > max_time)
{
break;
}
}
// Update fetch again
for (image_priority_list_t::iterator iter = mImageList.begin();
iter != mImageList.end(); )
{
LLViewerImage* imagep = *iter++;
imagep->updateFetch();
}
max_time -= timer.getElapsedTimeF32();
max_time = llmax(max_time, .001f);
F32 create_time = updateImagesCreateTextures(max_time);
LL_DEBUGS("ViewerImages") << "decodeAllImages() took " << timer.getElapsedTimeF32() << " seconds. "
<< " fetch_pending " << fetch_pending
<< " create_time " << create_time
<< LL_ENDL;
}
示例14: error
bool LLXMLRPCTransaction::Impl::process()
{
switch(mStatus)
{
case LLXMLRPCTransaction::StatusComplete:
case LLXMLRPCTransaction::StatusCURLError:
case LLXMLRPCTransaction::StatusXMLRPCError:
case LLXMLRPCTransaction::StatusOtherError:
{
return true;
}
case LLXMLRPCTransaction::StatusNotStarted:
{
setStatus(LLXMLRPCTransaction::StatusStarted);
break;
}
default:
{
// continue onward
}
}
const F32 MAX_PROCESSING_TIME = 0.05f;
LLTimer timer;
int count;
while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform(mCurlMulti, &count))
{
if (timer.getElapsedTimeF32() >= MAX_PROCESSING_TIME)
{
return false;
}
}
while(CURLMsg* curl_msg = curl_multi_info_read(mCurlMulti, &count))
{
if (CURLMSG_DONE == curl_msg->msg)
{
if (curl_msg->data.result != CURLE_OK)
{
setCurlStatus(curl_msg->data.result);
llwarns << "LLXMLRPCTransaction CURL error "
<< mCurlCode << ": " << mCurlErrorBuffer << llendl;
llwarns << "LLXMLRPCTransaction request URI: "
<< mURI << llendl;
return true;
}
setStatus(LLXMLRPCTransaction::StatusComplete);
mResponse = XMLRPC_REQUEST_FromXML(
mResponseText.data(), mResponseText.size(), NULL);
bool hasError = false;
bool hasFault = false;
int faultCode = 0;
std::string faultString;
LLXMLRPCValue error(XMLRPC_RequestGetError(mResponse));
if (error.isValid())
{
hasError = true;
faultCode = error["faultCode"].asInt();
faultString = error["faultString"].asString();
}
else if (XMLRPC_ResponseIsFault(mResponse))
{
hasFault = true;
faultCode = XMLRPC_GetResponseFaultCode(mResponse);
faultString = XMLRPC_GetResponseFaultString(mResponse);
}
if (hasError || hasFault)
{
setStatus(LLXMLRPCTransaction::StatusXMLRPCError);
llwarns << "LLXMLRPCTransaction XMLRPC "
<< (hasError ? "error " : "fault ")
<< faultCode << ": "
<< faultString << llendl;
llwarns << "LLXMLRPCTransaction request URI: "
<< mURI << llendl;
}
return true;
}
}
return false;
}
示例15: draw
void LLProgressView::draw()
{
static LLTimer timer;
if (gNoRender)
{
return;
}
// Make sure the progress view always fills the entire window.
S32 width = gViewerWindow->getWindowWidth();
S32 height = gViewerWindow->getWindowHeight();
if( (width != getRect().getWidth()) || (height != getRect().getHeight()) )
{
reshape( width, height );
}
// Paint bitmap if we've got one
glPushMatrix();
if (gStartImageGL)
{
LLGLSUIDefault gls_ui;
LLViewerImage::bindTexture(gStartImageGL);
gGL.color4f(1.f, 1.f, 1.f, mFadeTimer.getStarted() ? clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, FADE_IN_TIME, 1.f, 0.f) : 1.f);
F32 image_aspect = (F32)gStartImageWidth / (F32)gStartImageHeight;
F32 view_aspect = (F32)width / (F32)height;
// stretch image to maintain aspect ratio
if (image_aspect > view_aspect)
{
glTranslatef(-0.5f * (image_aspect / view_aspect - 1.f) * width, 0.f, 0.f);
glScalef(image_aspect / view_aspect, 1.f, 1.f);
}
else
{
glTranslatef(0.f, -0.5f * (view_aspect / image_aspect - 1.f) * height, 0.f);
glScalef(1.f, view_aspect / image_aspect, 1.f);
}
gl_rect_2d_simple_tex( getRect().getWidth(), getRect().getHeight() );
gStartImageGL->unbindTexture(0, GL_TEXTURE_2D);
}
else
{
LLGLSNoTexture gls_no_texture;
gGL.color4f(0.f, 0.f, 0.f, 1.f);
gl_rect_2d(getRect());
}
glPopMatrix();
// Handle fade-in animation
if (mFadeTimer.getStarted())
{
LLView::draw();
if (mFadeTimer.getElapsedTimeF32() > FADE_IN_TIME)
{
gFocusMgr.removeTopCtrlWithoutCallback(this);
LLView::setVisible(FALSE);
gStartImageGL = NULL;
}
return;
}
S32 line_x = getRect().getWidth() / 2;
S32 line_one_y = getRect().getHeight() / 2 + 64;
const S32 LINE_SPACING = 25;
S32 line_two_y = line_one_y - LINE_SPACING;
const LLFontGL* font = LLFontGL::sSansSerif;
LLUIImagePtr shadow_imagep = LLUI::getUIImage("rounded_square_soft.tga");
LLUIImagePtr bar_fg_imagep = LLUI::getUIImage("progressbar_fill.tga");
LLUIImagePtr bar_bg_imagep = LLUI::getUIImage("progressbar_track.tga");
LLUIImagePtr bar_imagep = LLUI::getUIImage("rounded_square.tga");
LLColor4 background_color = gColors.getColor("LoginProgressBarBgColor");
F32 alpha = 0.5f + 0.5f*0.5f*(1.f + (F32)sin(3.f*timer.getElapsedTimeF32()));
// background_color.mV[3] = background_color.mV[3]*alpha;
std::string top_line = LLAppViewer::instance()->getSecondLifeTitle();
S32 bar_bottom = line_two_y - 30;
S32 bar_height = 18;
S32 bar_width = getRect().getWidth() * 2 / 3;
S32 bar_left = (getRect().getWidth() / 2) - (bar_width / 2);
// translucent outline box
S32 background_box_left = ( ( ( getRect().getWidth() / 2 ) - ( bar_width / 2 ) ) / 4 ) * 3;
S32 background_box_top = ( getRect().getHeight() / 2 ) + LINE_SPACING * 5;
S32 background_box_right = getRect().getWidth() - background_box_left;
S32 background_box_bottom = ( getRect().getHeight() / 2 ) - LINE_SPACING * 5;
S32 background_box_width = background_box_right - background_box_left + 1;
S32 background_box_height = background_box_top - background_box_bottom + 1;
// shadow_imagep->draw( background_box_left + 2,
// background_box_bottom - 2,
// background_box_width,
// background_box_height,
// gColors.getColor( "LoginProgressBoxShadowColor" ) );
// bar_outline_imagep->draw( background_box_left,
// background_box_bottom,
// background_box_width,
//.........这里部分代码省略.........