本文整理汇总了C++中Progress函数的典型用法代码示例。如果您正苦于以下问题:C++ Progress函数的具体用法?C++ Progress怎么用?C++ Progress使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Progress函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: MakeKeyMaterial
PERROR MakeKeyMaterial( FRAME *frame, UBYTE *passphrase, struct PPTBase *PPTBase )
{
ROWPTR cp, tmprow;
WORD row;
struct ExecBase *SysBase = PPTBase->lb_Sys;
SHA_INFO sha = {0};
PERROR res = PERR_OK;
sha_init( &sha );
InitProgress(frame,"Building key...", 0, frame->pix->height );
/*
* First, use the passphrase for the key.
*/
if( strlen(passphrase) > 0 ) sha_update( &sha, passphrase, strlen(passphrase) );
if( tmprow = AllocVec( frame->pix->bytes_per_row, 0L ) ) {
for( row = 0; row < frame->pix->height; row++ ) {
WORD col;
cp = GetPixelRow( frame, row );
if( Progress( frame, row ) ) {
res = PERR_BREAK;
break;
}
for( col = 0; col < frame->pix->bytes_per_row; col++ ) {
/* Use only significant bytes */
tmprow[col] = cp[col] & 0xFE;
}
sha_update( &sha, tmprow, frame->pix->bytes_per_row );
}
// Use the passphrase again (why?)
if( strlen(passphrase) > 0 ) sha_update( &sha, passphrase, strlen(passphrase) );
FinishProgress( frame );
sha_final( &sha );
memcpy( key, &sha.digest[0], SHA_DIGESTSIZE );
D(sha_print( &sha ) );
FreeVec( tmprow );
} else {
SetErrorCode( frame, PERR_OUTOFMEMORY );
res = PERR_OUTOFMEMORY;
}
return res;
}
开发者ID:jalkanen,项目名称:ppt,代码行数:56,代码来源:stegano.c
示例2: QDialog
EditTagDialog::EditTagDialog(Application* app, QWidget* parent)
: QDialog(parent),
ui_(new Ui_EditTagDialog),
app_(app),
album_cover_choice_controller_(new AlbumCoverChoiceController(this)),
loading_(false),
ignore_edits_(false),
tag_fetcher_(new TagFetcher(this)),
cover_art_id_(0),
cover_art_is_set_(false),
results_dialog_(new TrackSelectionDialog(this))
{
cover_options_.default_output_image_ =
AlbumCoverLoader::ScaleAndPad(cover_options_, QImage(":nocover.png"));
connect(app_->album_cover_loader(), SIGNAL(ImageLoaded(quint64,QImage,QImage)),
SLOT(ArtLoaded(quint64,QImage,QImage)));
connect(tag_fetcher_, SIGNAL(ResultAvailable(Song, SongList)),
results_dialog_, SLOT(FetchTagFinished(Song, SongList)),
Qt::QueuedConnection);
connect(tag_fetcher_, SIGNAL(Progress(Song,QString)),
results_dialog_, SLOT(FetchTagProgress(Song,QString)));
connect(results_dialog_, SIGNAL(SongChosen(Song, Song)),
SLOT(FetchTagSongChosen(Song, Song)));
connect(results_dialog_, SIGNAL(finished(int)), tag_fetcher_, SLOT(Cancel()));
album_cover_choice_controller_->SetApplication(app_);
ui_->setupUi(this);
ui_->splitter->setSizes(QList<int>() << 200 << width() - 200);
ui_->loading_label->hide();
// An editable field is one that has a label as a buddy. The label is
// important because it gets turned bold when the field is changed.
foreach (QLabel* label, findChildren<QLabel*>()) {
QWidget* widget = label->buddy();
if (widget) {
// Store information about the field
fields_ << FieldData(label, widget, widget->objectName());
// Connect the Reset signal
if (dynamic_cast<ExtendedEditor*>(widget)) {
connect(widget, SIGNAL(Reset()), SLOT(ResetField()));
}
// Connect the edited signal
if (qobject_cast<QLineEdit*>(widget)) {
connect(widget, SIGNAL(textChanged(QString)), SLOT(FieldValueEdited()));
} else if (qobject_cast<QPlainTextEdit*>(widget)) {
connect(widget, SIGNAL(textChanged()), SLOT(FieldValueEdited()));
} else if (qobject_cast<QSpinBox*>(widget)) {
connect(widget, SIGNAL(valueChanged(int)), SLOT(FieldValueEdited()));
}
}
}
开发者ID:admiral0,项目名称:clementine,代码行数:56,代码来源:edittagdialog.cpp
示例3:
void CGameGraphBuilder::fill_distances (const float &start, const float &amount)
{
Progress (start);
m_distances.resize (graph().vertices().size());
{
DISTANCES::iterator I = m_distances.begin();
DISTANCES::iterator E = m_distances.end();
for ( ; I != E; I++) {
(*I).resize (level_graph().header().vertex_count());
xr_vector<u32>::iterator i = (*I).begin();
xr_vector<u32>::iterator e = (*I).end();
for ( ; i != e; i++)
*i = u32(-1);
}
}
Progress (start + amount);
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:19,代码来源:game_graph_builder.cpp
示例4: Progress
void Cf3Replay::Record()
{
(*m_iPointer).pressed[m_nPointer]=(*m_iPointer).pushed[m_nPointer]=0;
for (int i=0; i<8; i++) {
if (f3Input.GetKeyPressed(i+1)) (*m_iPointer).pressed [m_nPointer] |= (1<<i);
if (f3Input.GetKeyPushed(i+1)) (*m_iPointer).pushed [m_nPointer] |= (1<<i);
}
Progress();
m_nSize++;
}
开发者ID:mifumi323,项目名称:funya3_old,代码行数:10,代码来源:f3Replay.cpp
示例5: MainScreenSize
bool OGL_LoadScreen::Start()
{
// load the image
FileSpecifier File;
if (path.size() == 0) return use = false;
if (!File.SetNameWithPath(path.c_str())) return use = false;
if (!image.LoadFromFile(File, ImageLoader_Colors, 0)) return use = false;
if (!blitter.Load(image)) return use = false;
int screenWidth, screenHeight;
MainScreenSize(screenWidth, screenHeight);
bound_screen();
// the true width/height
int imageWidth = static_cast<int>(image.GetWidth() * image.GetVScale());
int imageHeight = static_cast<int>(image.GetHeight() * image.GetUScale());
if (scale)
{
if (stretch)
{
m_dst.w = screenWidth;
m_dst.h = screenHeight;
}
else if (imageWidth / imageHeight > screenWidth / screenHeight)
{
m_dst.w = screenWidth;
m_dst.h = imageHeight * screenWidth / imageWidth;
}
else
{
m_dst.w = imageWidth * screenHeight / imageHeight;
m_dst.h = screenHeight;
}
}
else
{
m_dst.w = imageWidth;
m_dst.h = imageHeight;
}
m_dst.x = (screenWidth - m_dst.w) / 2;
m_dst.y = (screenHeight - m_dst.h) / 2;
x_offset = m_dst.x;
y_offset = m_dst.y;
x_scale = m_dst.w / (double) imageWidth;
y_scale = m_dst.h / (double) imageHeight;
OGL_ClearScreen();
Progress(0);
return use = true;
}
开发者ID:PyroXFire,项目名称:alephone,代码行数:55,代码来源:OGL_LoadScreen.cpp
示例6: lc_global_data
void CBuild::u_Tesselate(tesscb_estimator* cb_E, tesscb_face* cb_F, tesscb_vertex* cb_V)
{
// main process
FPU::m64r ();
Status ("Tesselating...");
g_bUnregister = false;
u32 counter_create = 0;
u32 cnt_verts = lc_global_data()->g_vertices().size();
//u32 cnt_faces = g_faces.size();
for (u32 I=0; I<lc_global_data()->g_faces().size(); ++I)
{
Face* F = lc_global_data()->g_faces()[I];
if (0==F)
continue;
if( !check_and_destroy_splited( I ) )
continue;
Progress (float(I)/float(lc_global_data()->g_faces().size()));
int max_id = -1;
if( !do_tesselate_face( *F, cb_E, max_id ) )
continue;
xr_vector<Face*> adjacent_vec;
Vertex *V1,*V2;
CollectProblematicFaces( *F, max_id, adjacent_vec, &V1, &V2 );
++counter_create;
if (0==(counter_create%10000))
{
for (u32 I=0; I<lc_global_data()->g_vertices().size(); ++I)
if (lc_global_data()->g_vertices()[I]->m_adjacents.empty())
lc_global_data()->destroy_vertex (lc_global_data()->g_vertices()[I]);
Status ("Working: %d verts created, %d(now) / %d(was) ...",counter_create,lc_global_data()->g_vertices().size(),cnt_verts);
FlushLog ();
}
tessalate_faces( adjacent_vec, V1, V2, cb_F, cb_V );
}
// Cleanup
for (u32 I=0; I<lc_global_data()->g_faces().size(); ++I)
if (0!=lc_global_data()->g_faces()[I] && lc_global_data()->g_faces()[I]->flags.bSplitted)
lc_global_data()->destroy_face (lc_global_data()->g_faces()[I]);
for (u32 I=0; I<lc_global_data()->g_vertices().size(); ++I)
if (lc_global_data()->g_vertices()[I]->m_adjacents.empty())
lc_global_data()->destroy_vertex (lc_global_data()->g_vertices()[I]);
lc_global_data()->g_faces().erase (std::remove(lc_global_data()->g_faces().begin(),lc_global_data()->g_faces().end(),(Face*)0),lc_global_data()->g_faces().end());
lc_global_data()->g_vertices().erase (std::remove(lc_global_data()->g_vertices().begin(),lc_global_data()->g_vertices().end(),(Vertex*)0),lc_global_data()->g_vertices().end());
g_bUnregister = true;
}
开发者ID:2asoft,项目名称:xray,代码行数:54,代码来源:xrPhase_AdaptiveHT.cpp
示例7: if
void CBuild::CorrectTJunctions()
{
Status ("Processing...");
vecJunctions = xr_new<xr_vector<record> > (); vecJunctions->reserve (1024);
vecEdges = xr_new<xr_vector<record> > (); vecEdges->reserve (1024);
for (u32 I=0; I<g_faces.size(); I++)
{
Face* F = g_faces[I];
// Iterate on edges
for (u32 e=0; e<3; e++)
{
Vertex *vA,*vB;
F->EdgeVerts (e,&vA,&vB);
// Iterate on 'vA'-adjacent faces
for (u32 f1=0; f1!=vA->adjacent.size(); f1++)
{
Face* F1 = vA->adjacent[f1];
// Iterate on it's edges
for (u32 e1=0; e1<3; e1++)
{
Vertex *v1,*v2;
F1->EdgeVerts (e1,&v1,&v2);
edge (v1,v2);
if (v1==vA && v2!=vB) check(vA,vB,v2);
else if (v2==vA && v1!=vB) check(vA,vB,v1);
}
}
// Iterate on 'vB'-adjacent faces
for (u32 f2=0; f2!=vB->adjacent.size(); f2++)
{
Face* F2 = vB->adjacent[f2];
// Iterate on it's edges
for (u32 e1=0; e1<3; e1++)
{
Vertex *v1,*v2;
F2->EdgeVerts (e1,&v1,&v2);
edge (v1,v2);
if (v1==vB && v2!=vA) check(vA,vB,v2);
else if (v2==vB && v1!=vA) check(vA,vB,v1);
}
}
}
Progress(float(I)/float(g_faces.size()));
}
clMsg("*** %d junctions and %d long edges found.",vecJunctions->size(),vecEdges->size());
xr_delete(vecJunctions);
xr_delete(vecEdges);
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:54,代码来源:xrT_Junction.cpp
示例8: MtProgress_Set
SRes MtProgress_Set(CMtProgress *p, unsigned index, UInt64 inSize, UInt64 outSize)
{
SRes res;
CriticalSection_Enter(&p->cs);
UPDATE_PROGRESS(inSize, p->inSizes[index], p->totalInSize)
UPDATE_PROGRESS(outSize, p->outSizes[index], p->totalOutSize)
if (p->res == SZ_OK)
p->res = Progress(p->progress, p->totalInSize, p->totalOutSize);
res = p->res;
CriticalSection_Leave(&p->cs);
return res;
}
开发者ID:08opt,项目名称:gaeproxy,代码行数:12,代码来源:MtCoder.c
示例9: CancelCommand
ECommandResult::Type FPerforceSourceControlProvider::ExecuteSynchronousCommand(FPerforceSourceControlCommand& InCommand, const FText& Task, bool bSuppressResponseMsg)
{
ECommandResult::Type Result = ECommandResult::Failed;
struct Local
{
static void CancelCommand(FPerforceSourceControlCommand* InControlCommand)
{
InControlCommand->Cancel();
}
};
// Display the progress dialog
FScopedSourceControlProgress Progress(Task, FSimpleDelegate::CreateStatic(&Local::CancelCommand, &InCommand));
// Perform the command asynchronously
IssueCommand( InCommand, false );
// Wait until the command has been processed
while (!InCommand.bCancelledWhileTryingToConnect && CommandQueue.Contains(&InCommand))
{
// Tick the command queue and update progress.
Tick();
Progress.Tick();
// Sleep for a bit so we don't busy-wait so much.
FPlatformProcess::Sleep(0.01f);
}
if (InCommand.bCancelled)
{
Result = ECommandResult::Cancelled;
}
else if (InCommand.bCommandSuccessful)
{
Result = ECommandResult::Succeeded;
}
// If the command failed, inform the user that they need to try again
if ( !InCommand.bCancelled && Result != ECommandResult::Succeeded && !bSuppressResponseMsg )
{
FMessageDialog::Open( EAppMsgType::Ok, LOCTEXT("Perforce_ServerUnresponsive", "Perforce server is unresponsive. Please check your connection and try again.") );
}
// Delete the command now if not marked as auto-delete
if (!InCommand.bAutoDelete)
{
delete &InCommand;
}
return Result;
}
开发者ID:AndyHuang7601,项目名称:EpicGames-UnrealEngine,代码行数:53,代码来源:PerforceSourceControlProvider.cpp
示例10: u32
void CBuild::SaveTREE (IWriter &fs)
{
CMemoryWriter MFS;
Status ("Geometry buffers...");
xr_vector<u32> remap;
remap.reserve (g_tree.size());
for (u32 rid=0; rid<g_tree.size(); rid++) {
OGF* o = dynamic_cast<OGF*> (g_tree[rid]);
if (o) remap.push_back(rid);
}
std::stable_sort (remap.begin(),remap.end(),remap_order);
clMsg ("remap-size: %d / %d",remap.size(),g_tree.size());
for (u32 sid=0; sid<remap.size(); sid++) {
u32 id = remap[sid];
//clMsg ("%3d: subdiv: %d",sid,id);
g_tree[id]->PreSave (id);
}
Status ("Visuals...");
fs.open_chunk (fsL_VISUALS);
for (xr_vector<OGF_Base*>::iterator it = g_tree.begin(); it!=g_tree.end(); it++) {
u32 idx = u32(it-g_tree.begin());
MFS.open_chunk (idx);
(*it)->Save (MFS);
MFS.close_chunk ();
Progress (float(idx)/float(g_tree.size()));
}
fs.w (MFS.pointer(),MFS.size());
fs.close_chunk ();
clMsg ("Average: %d verts/%d faces, 50(%2.1f), 100(%2.1f), 500(%2.1f), 1000(%2.1f), 5000(%2.1f)",
g_batch_verts/g_batch_count,
g_batch_faces/g_batch_count,
100.f * float(g_batch_50)/float(g_batch_count),
100.f * float(g_batch_100)/float(g_batch_count),
100.f * float(g_batch_500)/float(g_batch_count),
100.f * float(g_batch_1000)/float(g_batch_count),
100.f * float(g_batch_5000)/float(g_batch_count)
);
mem_Compact ();
SaveGEOMs ("level.geom", g_VB,g_IB,g_SWI); // Normal
SaveGEOMs ("level.geomx", x_VB,x_IB,x_SWI); // Fast-Path
Status ("Shader table...");
fs.open_chunk (fsL_SHADERS);
fs.w_u32 (g_Shaders.size());
for (xr_vector<LPCSTR>::iterator T=g_Shaders.begin(); T!=g_Shaders.end(); T++)
fs.w_stringZ (*T);
fs.close_chunk ();
//mem_Compact ();
}
开发者ID:2asoft,项目名称:xray,代码行数:52,代码来源:xrSaveOGF.cpp
示例11: SetAway
//CALLBACK!
void
Jabber::Authorized()
{
SetAway(false);
fPerc +=0.3333;
fAuth=true;
Progress("Jabber Login", "Jabber: Authorized", fPerc);
LOG(kProtocolName, liDebug, "Jabber:Login %f - Authorized",fPerc) ;
CheckLoginStatus();
JabberHandler::Authorized();
}
开发者ID:HaikuArchives,项目名称:IMKit,代码行数:14,代码来源:Jabber.cpp
示例12: vfRecurseUpdate
void vfRecurseUpdate(u32 dwStartNodeID, u32 percent, u32 iVertexCount)
{
xr_vector<u32> curr_fringe, next_fringe;
curr_fringe.reserve (g_tDistances->size());
next_fringe.reserve (g_tDistances->size());
g_tDistances->assign (g_tDistances->size(),u32(-1));
curr_fringe.push_back (dwStartNodeID);
u32 curr_dist = 0, total_count = 0;
Progress (float(percent)/float(iVertexCount));
for (;!curr_fringe.empty();) {
xr_vector<u32>::iterator I = curr_fringe.begin();
xr_vector<u32>::iterator E = curr_fringe.end();
for ( ; I != E; ++I) {
(*g_tDistances)[*I] = curr_dist;
CLevelGraph::const_iterator i, e;
CLevelGraph::CVertex *node = (*g_tMap).vertex(*I);
(*g_tMap).begin (*I,i,e);
for ( ; i != e; ++i) {
u32 dwNexNodeID = node->link(i);
if (!(*g_tMap).valid_vertex_id(dwNexNodeID) || (*g_tMarks)[dwNexNodeID])
continue;
if ((*g_tDistances)[dwNexNodeID] > curr_dist) {
next_fringe.push_back(dwNexNodeID);
(*g_tMarks)[dwNexNodeID] = true;
}
}
}
I = curr_fringe.begin();
E = curr_fringe.end();
for ( ; I != E; ++I)
(*g_tMarks)[*I] = false;
total_count += curr_fringe.size();
curr_fringe = next_fringe;
next_fringe.clear();
++curr_dist;
Progress (float(percent)/float(iVertexCount) + float(total_count)/(float(iVertexCount)*float(g_tMap->header().vertex_count())));
}
}
开发者ID:NeoAnomaly,项目名称:xray,代码行数:39,代码来源:xrCrossTable.cpp
示例13: Progress
DFUEngine::Result DFUEngineBase::DoRecover(const DFUEngine::Result &failure)
{
DFUEngine::Result result;
DFURequests::DFUStatus status;
// Delay a little before starting the recovery action
Progress(DFUEngine::recover_clean_up, failure);
Sleep(recoverDelay);
// Ensure that the transport has been started
result = DoConnect(false, false);
if (!result) return result;
// Abort any DFU operation
result = transport->GetStatus(status);
if (result && transport->CanAbort(status.bState))
{
result = transport->Abort();
}
if (result && transport->CanClrStatus(status.bState))
{
result = transport->ClrStatus();
}
if (!result)
{
// Disconnect and reconnect the transport if any problem
Progress(DFUEngine::recover_fail, failure);
result = transport->Disconnect();
if (result) result = DoConnect(false, false);
if (!result) return result;
}
// Perform a reset and disconnect the transport
result = transport->Reset(false);
if (!result) return result;
// Assume successful if this point reached
return DFUEngine::success;
}
开发者ID:philiplin4sp,项目名称:production-test-tool,代码行数:39,代码来源:DFUEngineBase.cpp
示例14: Progress
ECommandResult::Type FSubversionSourceControlProvider::ExecuteSynchronousCommand(FSubversionSourceControlCommand& InCommand, const FText& Task, bool bSuppressResponseMsg)
{
ECommandResult::Type Result = ECommandResult::Failed;
// Display the progress dialog if a string was provided
{
FScopedSourceControlProgress Progress(Task);
// Perform the command asynchronously
IssueCommand( InCommand, false );
while(!InCommand.bExecuteProcessed)
{
// Tick the command queue and update progress.
Tick();
Progress.Tick();
// Sleep for a bit so we don't busy-wait so much.
FPlatformProcess::Sleep(0.01f);
}
// always do one more Tick() to make sure the command queue is cleaned up.
Tick();
if(InCommand.bCommandSuccessful)
{
Result = ECommandResult::Succeeded;
}
}
// If the command failed, inform the user that they need to try again
if ( Result != ECommandResult::Succeeded && !bSuppressResponseMsg )
{
FMessageDialog::Open( EAppMsgType::Ok, LOCTEXT("Subversion_ServerUnresponsive", "Subversion repository is unresponsive. Please check your connection and try again.") );
}
// Delete the command now
check(!InCommand.bAutoDelete);
// ensure commands that are not auto deleted do not end up in the command queue
if ( CommandQueue.Contains( &InCommand ) )
{
CommandQueue.Remove( &InCommand );
}
delete &InCommand;
return Result;
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:51,代码来源:SubversionSourceControlProvider.cpp
示例15: TestBackTrace
void TestBackTrace ()
{
bool rc = true;
TestHeader("backtrace test");
Tracker2 t;
t.doTest(25);
Progress(rc, "minimal functionality");
t.doTest(25);
rc = (t._codepoints[10] != 0);
Progress(rc, "many levels");
rc = (t.found() > 10);
Progress(rc, "many levels retval");
t.doTest(8);
rc = (t.found() == 8);
Progress(rc, "few levels retval");
rc = (t._codepoints[8] == 0);
Progress(rc, "few levels");
PrintSeparator();
}
开发者ID:songhtdo,项目名称:vespa,代码行数:23,代码来源:backtracetest.cpp
示例16: locker
void ThreadResult::FileChecked(const QString &file)
{
QMutexLocker locker(&mutex);
mProgress += QFile(file).size();
mFilesChecked ++;
if (mMaxProgress > 0) {
const int value = static_cast<int>(PROGRESS_MAX * mProgress / mMaxProgress);
const QString description = tr("%1 of %2 files checked").arg(mFilesChecked).arg(mTotalFiles);
emit Progress(value, description);
}
}
开发者ID:bartlomiejgrzeskowiak,项目名称:cppcheck,代码行数:14,代码来源:threadresult.cpp
示例17: while
void DFUEngineBase::AccurateSleep(uint32 milliseconds, DFUEngine::SubOperation subOperation)
{
// Loop until done
while (0 < milliseconds)
{
// Update the progress indicator
Progress(subOperation, milliseconds / 1000);
// Sleep for a second (plus any fractional part) of the remaining time
uint32 sleep = min(milliseconds, 1000 + milliseconds % 1000);
AccurateSleep(sleep);
milliseconds -= sleep;
}
}
开发者ID:philiplin4sp,项目名称:production-test-tool,代码行数:14,代码来源:DFUEngineBase.cpp
示例18: ResultAvailable
void TagFetcher::PuidFound(int index, const QString& puid) {
if (index >= songs_.count()) {
return;
}
const Song& song = songs_[index];
if (puid.isEmpty()) {
emit ResultAvailable(song, SongList());
return;
}
emit Progress(song, tr("Downloading metadata"));
musicbrainz_client_->Start(index, puid);
}
开发者ID:Gu1,项目名称:Clementine,代码行数:15,代码来源:tagfetcher.cpp
示例19: Cancel
void TagFetcher::StartFetch(const SongList& songs) {
Cancel();
songs_ = songs;
QFuture<QString> future = QtConcurrent::mapped(songs_, GetFingerprint);
fingerprint_watcher_ = new QFutureWatcher<QString>(this);
fingerprint_watcher_->setFuture(future);
connect(fingerprint_watcher_, SIGNAL(resultReadyAt(int)),
SLOT(FingerprintFound(int)));
for (const Song& song : songs) {
emit Progress(song, tr("Fingerprinting song"));
}
}
开发者ID:Gu1,项目名称:Clementine,代码行数:15,代码来源:tagfetcher.cpp
示例20: xrSaveNodes
void xrSaveNodes(LPCSTR N, LPCSTR out_name)
{
Msg ("NS: %d, CNS: %d, ratio: %f%%",sizeof(vertex),sizeof(CLevelGraph::CVertex),100*float(sizeof(CLevelGraph::CVertex))/float(sizeof(vertex)));
Msg ("Renumbering nodes...");
string_path fName;
strconcat (sizeof(fName),fName,N,out_name);
IWriter *fs = FS.w_open(fName);
// Header
Status ("Saving header...");
hdrNODES H;
H.version = XRAI_CURRENT_VERSION;
H.count = g_nodes.size();
H.size = g_params.fPatchSize;
H.size_y = CalculateHeight(H.aabb);
H.guid = generate_guid();
fs->w (&H,sizeof(H));
// fs->w_u32 (g_covers_palette.size());
// for (u32 j=0; j<g_covers_palette.size(); ++j)
// fs->w (&g_covers_palette[j],sizeof(g_covers_palette[j]));
// All nodes
Status ("Saving nodes...");
for (u32 i=0; i<g_nodes.size(); ++i) {
vertex &N = g_nodes[i];
NodeCompressed NC;
Compress (NC,N,H);
compressed_nodes.push_back(NC);
}
xr_vector<u32> sorted;
xr_vector<u32> renumbering;
CNodeRenumberer A(compressed_nodes,sorted,renumbering);
for (u32 i=0; i<g_nodes.size(); ++i) {
fs->w (&compressed_nodes[i],sizeof(NodeCompressed));
Progress (float(i)/float(g_nodes.size()));
}
// Stats
u32 SizeTotal = fs->tell();
Msg ("%dK saved",SizeTotal/1024);
FS.w_close (fs);
}
开发者ID:NeoAnomaly,项目名称:xray,代码行数:48,代码来源:compiler_save.cpp
注:本文中的Progress函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论