Homesource Forums

Homeworld Source Editing Talk
It is currently Fri Mar 24, 2017 11:01 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Mon Mar 05, 2007 4:50 am 
Offline
coder

Joined: Tue Nov 07, 2006 4:40 am
Posts: 236
Hi.

When I updated and re-compiled I got an error about finding the Homeworld.big file.
I provide here a quick fix as I don't really have time to inspect the code fully and offer a more complete fix.

I run the binary from a different location to the game files, which I assume is causing the problem.

This undoes a change made in r535

Code:
--- BigFile.c   (revision 538)
+++ BigFile.c   (working copy)
@@ -2252,8 +2252,8 @@
     char bigFilename[PATH_MAX];
     char updateFilename[PATH_MAX];
 
-    strcpy(bigFilename,    filePathPrepend(_bigFilename,    FF_HomeworldRootPath));
-    strcpy(updateFilename, filePathPrepend(_updateFilename, FF_HomeworldRootPath));
+    strcpy(bigFilename,    filePathPrepend(_bigFilename,    0));
+    strcpy(updateFilename, filePathPrepend(_updateFilename, 0));
 
     if (IgnoreBigfiles)
     {


I'm not able to make any commits at the moment due to my code being quite modified from the norm, and I don't want any of it corrupting the source. :)

Aunxx


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 11:29 am 
Offline
coder

Joined: Wed Nov 15, 2006 8:15 am
Posts: 100
Same bug showing up here too. :)

Aunxx fixes it for me too. Cannot apply it either as some suprises for you guys are in preparation ;)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 12:46 pm 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
Oh man, yet another development setup configuration! Am I correct in saying you do:

Code:
% cd /directory/with/homeworld/data/files
% /path/to/homeworld/binary/in/development

The reason the reverted code works is the prepend path is defaulting to the current directory on Windows/Linux and you happen to be in the directory with all the data files in it. I'm (sort of) in the reverse situation, running from the installed location and overriding where the data files live (well, the local filesystem .big override files at any rate).

It sounds like we may need to track (yet) another directory path:

- Homeworld root path
- game data root path
- local file overrides to data file contents for ease of development/debugging
- user settings path
- cdrom path (not convinced this is really needed any more)

where game data root path should default to Homeworld root path (because that's how the game gets installed) with the option to override at run time.

Does that sound like I've understood the situation correctly and does my proposed solution seem reasonable to you guys?

Also, I've symlinked to the real data files from where my Homeworld binary gets built so that it more closely resembles a normal installation. If you don't want to have to set a runtime environment variable or equivalent all the time then this might also be an alternative solution.

_________________
MacHomeworld | HomeworldSDL.org


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 1:43 pm 
Offline
coder

Joined: Tue Nov 07, 2006 4:40 am
Posts: 236
Hi.

Easiest example is to give how I have mine setup. :)

Datafiles live in /usr/local/games/Homeworld

SVN code is ~/svn/homeworld/

I launch the game from ~/svn/homeworld/Linux/src

I use the HW_Data environment variable either defined in ~/.homeworld/reg or start the game with HW_Data=/usr/local/games/Homeworld ./homeworld

When I ran strace on the binary it was looking _ONLY_ in the local directory and not using the HW_Data value to prepend the file. It seems to work for the other files, but the problem is with the bigfile.

I didn't know what you were planning with respect to accessing the files so I didn't want to step on your toes by arbitrarily making changes. :)

Hope that this clarifies the situation a bit more. :)

#include <2p.h>

I agree we don't need the cdrom path as I bet no-one here plays the game from the cdrom, and we're not exactly using the CD validation routines. :)

I think that we need, as you say, a root path to the main homeworld data files. A bigfile override path for changes which reverts to the root path if no updates found, and a user setting path for user config data.

Wherever you run the binary from should make no difference unless the paths defined are relative.



Aunxx


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 4:07 pm 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
Thanks. I was going to say I've just fixed it in r539 but in that I actually deprecated the reg:HW_Data entry as redundant but I see that you do actually use it, so I may have been a bit hasty. My reasoning was that it was just doing what other code is trying to do and the rest of the entries are related to hardware configuration, rather than the runtime environment.

aunxx wrote:
When I ran strace on the binary it was looking _ONLY_ in the local directory and not using the HW_Data value to prepend the file.

This concerns me slightly. Is that still true in r539? If so, there's probably a bad fileOpen floating around somewhere which is quite possible. There's too much code trying to specify where to find particular files which then doesn't quite work when there's an override in play...

_________________
MacHomeworld | HomeworldSDL.org


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group