Beherith / springrts_smf_compiler

This tool allows the compilation and decompilation of maps to springrts's binary smf map format.
Creative Commons Zero v1.0 Universal
11 stars 9 forks source link

Output is not flushed regulary #17

Closed adras closed 2 years ago

adras commented 2 years ago

I'm working on integrating your great tool to my new mapping project. For that I'm starting the compilation process, and then I constantly read the output from pymapconv. However since the console buffer is not flushed by pymapconv I'm getting weird results.

For instance, the output of nvdxt comes before the output of pymapconv.

I see two options to fix that:

  1. Use --python-option u of pyinstaller to have python use unbuffered output
  2. Change all print statements to use sys.stdout.flush() after printing a line

However I was unable to get option 1 working. Pyinstaller gave me an error message that the --python-option parameter doesn't exist. So I went and quickly implemented option 2 by adding a new function which prints a line and then flushes the output buffer. It's not perfect, but it does the job.

Could you please investigate that?

I created a pull request #18 with my changes. I guess it's more of a draft than a proper implementation though

Beherith commented 2 years ago

If it works, and you can compile/decompile a map then its fine. Also, im sure youve noticed that nvdxt cant be run multi-threaded. This is the biggest bottleneck in the entire app, and the reason it cant be run in multiprocessing way, is that it creates and nvdxt_scratch.tmp file next to the nvdxt.exe, which prevents identical processes working :/