Panda3D
Public Member Functions | Public Attributes | List of all members
Decompressor Class Reference

This manages run-time decompression of a zlib-compressed stream, as a background or foreground task. More...

Public Member Functions

 __init__ ()
 
 __init__ (const Decompressor)
 
bool decompress (const Filename source_file)
 Performs a foreground decompression of the named file; does not return until the decompression is complete. More...
 
bool decompress (Ramfile source_and_dest_file)
 Does an in-memory decompression of the indicated Ramfile. More...
 
float getProgress ()
 Returns the ratio through the decompression step in the background. More...
 
int initiate (const Filename source_file)
 Begins a background decompression of the named file (whose filename must end in ".pz") to a new file without the .pz extension. More...
 
int initiate (const Filename source_file, const Filename dest_file)
 Begins a background decompression from the named source file to the named destination file. More...
 
int run ()
 Called each frame to do the next bit of work in the background task. More...
 

Public Attributes

float progress
 Returns the ratio through the decompression step in the background. More...
 

Detailed Description

This manages run-time decompression of a zlib-compressed stream, as a background or foreground task.

Member Function Documentation

◆ __init__() [1/2]

__init__ ( )

◆ __init__() [2/2]

__init__ ( const  Decompressor)

◆ decompress() [1/2]

bool decompress ( const Filename  source_file)

Performs a foreground decompression of the named file; does not return until the decompression is complete.

◆ decompress() [2/2]

bool decompress ( Ramfile  source_and_dest_file)

Does an in-memory decompression of the indicated Ramfile.

The decompressed contents are written back into the same Ramfile on completion.

◆ getProgress()

float getProgress ( )

Returns the ratio through the decompression step in the background.

◆ initiate() [1/2]

int initiate ( const Filename  source_file)

Begins a background decompression of the named file (whose filename must end in ".pz") to a new file without the .pz extension.

The source file is removed after successful completion.

◆ initiate() [2/2]

int initiate ( const Filename  source_file,
const Filename  dest_file 
)

Begins a background decompression from the named source file to the named destination file.

The source file is removed after successful completion.

◆ run()

int run ( )

Called each frame to do the next bit of work in the background task.

Returns EU_ok if a chunk is completed but there is more to go, or EU_success when we're all done. Any other return value indicates an error.

Member Data Documentation

◆ progress

float progress

Returns the ratio through the decompression step in the background.