Skip to content

Feature packages physfs (WIP)#176

Closed
brianvanderburg2 wants to merge 19 commits intodevelfrom
feature-packages-physfs
Closed

Feature packages physfs (WIP)#176
brianvanderburg2 wants to merge 19 commits intodevelfrom
feature-packages-physfs

Conversation

@brianvanderburg2
Copy link
Copy Markdown

This is the continuation of #139 using the official repository.

This feature uses PhysFS to create a form of a virtual file system. Archives need to be mounted before the VFS can read inside them. Until they are mounted, VFS will see them as a file. Once they are mounted, VFS sees the archive as a directory. Packages are automatically mounted during the scan if needed.

I've tested this on Linux using Debian 7 and everything seems to work fine. It works just like the package manager current does: levels, worlds, and campaigns come from the current package, graphics, sounds, and music use the current package and dependencies (so called resource packages), and scripts can be loaded from a package by specifying the name. I've also already merged the packages anywhere code into this branch.

There is one main problem. It is quite slow. Using normal packages seems to be quite fast, but when this feature is compiled, loading some levels is slow and loading the level editor is slow. Perhaps the VFS object needs to cache certain results such as File_Exist tests and Find results.

I don't believe this breaks any compatibility with the current devel code, but due to the slowness issue, I don't plan on merging this any time soon and would like for others to test it if possible. Also, any ideas on how to solve the slowness issue.

Conflicts:
	smc/src/core/filesystem/package_manager.cpp
To fix certain inconsistencies, VFS no longer auto-mounts zip files
during Find (and thus Open, Get_Directory_Files, Exists, etc).  Any zip
files that need to be used should be mounted beforehand.  Regular file
reading works as normal, there is no need to mount directories, only zip
files.
Conflicts:
	smc/src/audio/audio.cpp
	smc/src/core/filesystem/package_manager.cpp
	smc/src/gui/menu.cpp
…-anywhere

Conflicts:
	smc/src/core/filesystem/package_manager.cpp
	smc/src/core/filesystem/package_manager.hpp
Conflicts:
	smc/src/audio/audio.cpp
	smc/src/audio/sound_manager.cpp
	smc/src/campaign/campaign_loader.cpp
	smc/src/campaign/campaign_manager.cpp
	smc/src/core/file_parser.cpp
	smc/src/core/filesystem/package_manager.cpp
	smc/src/core/filesystem/package_manager.hpp
	smc/src/core/main.cpp
	smc/src/core/main.hpp
	smc/src/core/property_helper.hpp
	smc/src/enemies/eato.cpp
	smc/src/enemies/flyon.cpp
	smc/src/enemies/thromp.cpp
	smc/src/gui/menu.cpp
	smc/src/gui/menu_data.cpp
	smc/src/level/level.cpp
	smc/src/level/level_loader.cpp
	smc/src/level/level_manager.cpp
	smc/src/level/level_settings.cpp
	smc/src/overworld/overworld_description_loader.cpp
	smc/src/overworld/overworld_layer_loader.cpp
	smc/src/overworld/overworld_loader.cpp
	smc/src/overworld/world_manager.cpp
	smc/src/scripting/objects/mrb_smc.cpp
	smc/src/video/img_settings.cpp
	smc/src/video/video.cpp
@brianvanderburg2
Copy link
Copy Markdown
Author

I'm not sure, but part of the slowness issue may be due to repetitive testing for existence. Perhaps one option may to be have a cache in VFS for this.

@Luiji
Copy link
Copy Markdown
Member

Luiji commented Dec 30, 2014

This looks very interesting, but it's curious why it isn't performing too well. I'll see if I can get time to look into it myself and see if there's any peculiarities.

@Quintus
Copy link
Copy Markdown
Member

Quintus commented Jul 23, 2016

With no activity in almost two years, I think this can be considered abandoned now. If you want to pick up work again, feel free to reopen this.

Valete,
Quintus

@Quintus Quintus closed this Jul 23, 2016
@Quintus Quintus deleted the feature-packages-physfs branch November 25, 2016 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants