On 2/5/06, Scott Balneaves <[EMAIL PROTECTED]> wrote:
> Well, after several days of tinkering, here's the results of my efforts:
> the soundtrack code converted to PHYSFS_* calls!


> 1) in src/main.c:initialize_PhysicsFS, calls were being made to
> PHYSFS_getBaseDir(), On my box (at least) this was consistently
> returning /usr/local/bin, and according to the docs, that's what it
> should have been returning, but the code looks and acts like it wants
> the base dir of the files: /usr/local/share/warzone.  I've subbed in
> DEFAULT_DATA_DIR where I thought it was appropriate.  If I was wrong in
> these assumptions, let me know.

There is a problem here, yes, but I don't think using DEFAULT_DATA_DIR
is a good idea. Instead, the result of find_data_dir() should be
recorded and used instead of PHYSFS_getBaseDir().

> 2) The patch modifies the Makefile.am in the lib/sound directory, as I
> create two new files: physfs_support.[ch].  One of the main reasons for
> this is that both the MP3 and the Vorbis routines need a FILE * handle
> to work with the soundfile, so I wrote a little routine that checks the
> PHYSFS path for a file, and if it exists, then figures out the real
> path, and does a standard fopen().

This will not work. Sometimes the files are inside a zip archive, so
passing a FILE * handle will give you totally wrong results... The
MP3/Vorbis functions need to be rewritten to work with buffers, there
is no way around it.

Also there is no need to add a physfs_loadBufferFromFile() function,
since we already have a readFile() function defined for this purpose
in lib/framework/frame_stub.c

  - Per

Reply via email to