mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
*** empty log message ***
This commit is contained in:
parent
42392f0d0c
commit
7bfdd75113
@ -175,3 +175,23 @@ run(void) {
|
|||||||
|
|
||||||
return DS_ok;
|
return DS_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: Decompressor::decompress
|
||||||
|
// Access: Public
|
||||||
|
// Description:
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
bool Decompressor::
|
||||||
|
decompress(Filename &source_file) {
|
||||||
|
int ret = initiate(source_file);
|
||||||
|
if (ret < 0)
|
||||||
|
return false;
|
||||||
|
for (;;) {
|
||||||
|
ret = run();
|
||||||
|
if (ret == DS_success)
|
||||||
|
return true;
|
||||||
|
else if (ret < 0)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@ -35,9 +35,10 @@ PUBLISHED:
|
|||||||
|
|
||||||
int initiate(Filename &source_file);
|
int initiate(Filename &source_file);
|
||||||
int initiate(Filename &source_file, Filename &dest_file);
|
int initiate(Filename &source_file, Filename &dest_file);
|
||||||
|
|
||||||
int run(void);
|
int run(void);
|
||||||
|
|
||||||
|
bool decompress(Filename &source_file);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init(PT(Buffer) buffer);
|
void init(PT(Buffer) buffer);
|
||||||
|
|
||||||
|
@ -116,3 +116,23 @@ run(void) {
|
|||||||
}
|
}
|
||||||
return ES_ok;
|
return ES_ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
// Function: Extractor::extract
|
||||||
|
// Access: Public
|
||||||
|
// Description:
|
||||||
|
////////////////////////////////////////////////////////////////////
|
||||||
|
bool Extractor::
|
||||||
|
extract(Filename &source_file, const Filename &rel_path) {
|
||||||
|
int ret = initiate(source_file, rel_path);
|
||||||
|
if (ret < 0)
|
||||||
|
return false;
|
||||||
|
for (;;) {
|
||||||
|
ret = run();
|
||||||
|
if (ret == ES_success)
|
||||||
|
return true;
|
||||||
|
if (ret < 0)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@ -35,6 +35,8 @@ PUBLISHED:
|
|||||||
int initiate(Filename &source_file, const Filename &rel_path = "");
|
int initiate(Filename &source_file, const Filename &rel_path = "");
|
||||||
int run(void);
|
int run(void);
|
||||||
|
|
||||||
|
bool extract(Filename &source_file, const Filename &rel_path = "");
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void init(PT(Buffer) buffer);
|
void init(PT(Buffer) buffer);
|
||||||
|
|
||||||
|
@ -78,7 +78,6 @@ main(int argc, char *argv[]) {
|
|||||||
mfile.extract_all(rel_path);
|
mfile.extract_all(rel_path);
|
||||||
#else
|
#else
|
||||||
Extractor extor;
|
Extractor extor;
|
||||||
extor.set_frequency(0);
|
|
||||||
extor.extract(dest_file, rel_path);
|
extor.extract(dest_file, rel_path);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user