Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs for PckPacker flush verbose param are misleading #58392

Closed
SylvanSign opened this issue Feb 21, 2022 · 1 comment · Fixed by #58520
Closed

Docs for PckPacker flush verbose param are misleading #58392

SylvanSign opened this issue Feb 21, 2022 · 1 comment · Fixed by #58520
Milestone

Comments

@SylvanSign
Copy link

Godot version

3.4 stable, but probably All?

System information

N/A

Issue description

For this method

Error flush ( bool verbose=false )

the docs say

...If verbose is true, a list of files added will be printed to the console for easier debugging.

which is misleading given the implementation seemingly only prints out messages every 100 files:

count += 1;
const int file_num = files.size();
if (p_verbose && (file_num > 0)) {
if (count % 100 == 0) {
printf("%i/%i (%.2f)\r", count, file_num, float(count) / file_num * 100);
fflush(stdout);
}
}

So for small pck packing with < 100 added files, this will print nothing...

Steps to reproduce

mostly following the docs in PckPacker to produce a minimal example:

extends Node

func _ready() -> void:
	var small_packer = PCKPacker.new()
	assert(OK == small_packer.pck_start("small.pck"))
	assert(OK == small_packer.add_file("res://test.png", "icon.png"))
	assert(OK == small_packer.flush(true))
	# check output and see that nothing is printed

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Feb 21, 2022

I'd say the "every 100 files" check should be removed, and a line should be printed for every exported file instead. It is called verbose for a reason 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants