Implement a Quake-like virtual file system layer
authorparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Fri, 12 Jun 2009 02:37:22 +0000 (02:37 +0000)
committerparasti <parasti@78b8d119-cf0a-0410-b17c-f493084dd1d7>
Fri, 12 Jun 2009 02:37:22 +0000 (02:37 +0000)
commitb016323d1ef629e78aa54bcf101b46a7e31c2ad2
treea9f8dc932ab7afbb1eace8fc64654697b44792fa
parent163ea190b979b9720cb0d6e0a8757679baab4c56
Implement a Quake-like virtual file system layer

This patch introduces a new module "share/fs" through which all file
system and input/output operations are handled.  The module internally
is supported by the PhysicsFS 1.0 API, so this change adds an external
dependency on that library.

How things work (for those not familiar with Quake's PK3):

Neverball now has a single, unified view of the file system, there's
only the "write directory" to which files are written and the "search
path" from which files are read.  The write directory is simply the
user directory (ie., ~/.neverball).  The search path consists of the
following components (items listed later take precedence):

 * archives found in the game data directory;
 * game data directory itself;
 * archives found in the user directory;
 * user directory itself.

Archives are sorted alphabetically (and similarly, archives later in
the alphabet take precedence).

A file in one component with the same name as another file in another
component of lower precedence overrides that file, and Neverball only
ever sees the file from the higher-precedence component.

This has not seen significant testing yet, and some things have
probably stopped working.  Keep your eyes open.

git-svn-id: https://s.snth.net/svn/neverball/trunk@2877 78b8d119-cf0a-0410-b17c-f493084dd1d7
47 files changed:
Makefile
ball/demo.c
ball/demo.h
ball/demo_dir.c
ball/game_client.c
ball/game_client.h
ball/game_server.c
ball/game_server.h
ball/level.c
ball/main.c
ball/set.c
ball/st_demo.c
ball/st_help.c
ball/st_title.c
putt/course.c
putt/game.c
putt/hole.c
putt/main.c
share/audio.c
share/ball.c
share/base_config.c
share/base_config.h
share/base_image.c
share/binary.c
share/binary.h
share/cmd.c
share/cmd.h
share/common.c
share/common.h
share/config.c
share/fs.c [new file with mode: 0644]
share/fs.h [new file with mode: 0644]
share/fs_jpg.c [new file with mode: 0644]
share/fs_jpg.h [new file with mode: 0644]
share/fs_ov.c [new file with mode: 0644]
share/fs_ov.h [new file with mode: 0644]
share/fs_png.c [new file with mode: 0644]
share/fs_png.h [new file with mode: 0644]
share/fs_rwops.c [new file with mode: 0644]
share/fs_rwops.h [new file with mode: 0644]
share/gui.c
share/image.c
share/item.c
share/lang.c
share/mapc.c
share/solid.c
share/syswm.c