Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Sat Sep 21, 2019 1:55 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Mon May 08, 2006 5:27 pm 
Offline

Joined: Fri Mar 17, 2006 12:41 pm
Posts: 46
Location: Gif/Yvette, France
I've worked a bit on a mania_drive subdirectory, and it went surprisingly well ;)

-- media files have been put to the global media directory, but it could be local as well. You can use the tidy.sh script to do the job.

-- music files (mania_music) go to a music/ subdirectory. And, on a side note, the track played in the menu is now random

-- I've hacked a bit the comp scripts : now, you do a ./odyncomp.sh mania_drive that will search a mania_drive directory and a mania_drive.c file to compile. If it doesn't find it, it backs up to the good old method (try ./odyncomp test6, without the ".c"). So everything else stays compatible.

I had to create a softlink to ../rayphp, but I believe it could be deleted shortly by applying the same "path" algorithm to the PHP file execution.

A problem I've encountered is with story mode : the php script mania_story.php tries to open a mni file using fopen() (baaaad!) and should be using raydium_file_fopen(), but we've come back to the "C->PHP->C" problem. Hope somebody can come with a (elegant) solution. The quick and dirty way could be to implement raydium_file_fopen() directly in PHP, but I don't like to do things twice :)

Also had to copy my raydium.db, again I think it should be in $HOME (or the Win32 equivalent "My documents").

I may be forgetting some steps, but on the whole, I found the migration process pretty easy ;)

I won't commit a broken story mode, so I'm looking for PHP<->C interaction advice right now.

_________________
Phyce


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 11, 2006 4:56 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
Before talking about all this, I think we must talk a bit about the commit 307 (file.c) since I see potential memory leaks (no time for now to confirm this [complete_path]) and --repository-refresh is no more valid (file opening fails each time). No time to test --repository-force yet.

Please, please ... be sure to test as accuratly as possible your commits, since we have no branches for Raydium (and no enough people to have more :) ).


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 12, 2006 11:51 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
I'm sorry, but I think I must revert the "media path" commit again ... Dandling pointers, memory leaks, win32 is broken (sound loading ends with a coredump). That's more than I can manage right now.

IMHO, we should think about another way to do all this, and from my point of vue, the idea of vicente is probably the simpliest : a function resolving a correct path from a given filename. This allow us to deal with WAV loading easily, but also with OGG (wich isn't the case with the current implementation) and even to use this function is PHP scripts.

Code:
char realpath[RAYDIUM_MAX_NAME_LEN];
...
raydium_file_path(filename,realpath); // find the 'realpath' for 'filename'
ov_open(realpath, ...); // opens vorbis file


With this method, we need only very small changes in other subjects (sound, php, raydium_file_fopen, ...), avoiding current problem wich already takes me more than 2 hours today ;)

Next commit (312) will revert all about this subject, including my previous commits.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 12, 2006 6:18 pm 
Offline

Joined: Fri Mar 17, 2006 12:41 pm
Posts: 46
Location: Gif/Yvette, France
Quote:
I'm sorry, but I think I must revert the "media path" commit again ... Dandling pointers, memory leaks, win32 is broken (sound loading ends with a coredump). That's more than I can manage right now.


OK, my C is rusty (who said crappy?)

Quote:
IMHO, we should think about another way to do all this, and from my point of vue, the idea of vicente is probably the simpliest : a function resolving a correct path from a given filename.


I couldn't disagree more : It's the kind of things that drive programmers crazy (what happens if I forgot to use the path function?) and it is ugly (IMHO).

About OGG, from the ogg vorbis library :
Code:
int ov_open(FILE *f, OggVorbis_File *vf,char *initial,long ibytes);

I don't see how your code will work, and, for the record, OGG worked perfectly well here...So I don't understand your problem with OGG (I know the code in file.c should be more polished, but I thought it was "well enough" for a sharing, testing, debugging cycle)

About the WAV loading problem under win32, sorry I can't test changes under win32. This may have to do with the second #ifdef block wich uses an older (and untested) API. Let's hope windows implements fread() correctly...

About strtok_r, maybe the non-reentrant strtok (not thread safe) or a more portable string tokenizer exists. BTW, the method you talk about hits the same problem.

Quote:
With this method, we need only very small changes in other subjects (sound, php, raydium_file_fopen, ...), avoiding current problem wich already takes me more than 2 hours today ;)


I thought Mania Drive was ready for release when I tested it 2 months ago, I don't see why you're so in a hurry now ; Do as you want but I find sad to give up API's clarity for schedule proposes. So release Mania Drive, and let's work on issues after that.

_________________
Phyce


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 12, 2006 7:41 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
Quote:
I couldn't disagree more : It's the kind of things that drive programmers crazy (what happens if I forgot to use the path function?) and it is ugly (IMHO).

OK, right. There's drawbacks with both methods.
I'm sorry about the example of ov_open: I was searching for an example to illustrate the idea of a "realpath function", and misreaded the prototype of ov_open(). Sorry again about this, OGG support is OK, but the idea remains the same: with the "don't use fopen()" method, each external lib who deals with files is potentially a problem.

About win32 WAV loading, we need time (again) to find the problem. I know that most of current developpers here are linux ones, including myself. But providing a win32 support is absolutely needed. For many reasons, we can't release games and apps only for Linux. So we must do our best to lose as less time as possible porting Raydium to win32. I highly recommend you to try to get (time to time) an access to a win32 computer. SDK is easy to use, no third app is needed but subversion. OpenAL is a good example of how hard it is to make and maintain a portable application.

About strtok_r, we can make our own version for win32 (this was done in commit 311 : http://raydium.org/svn.php?d=/trunk/ray ... er.c&v=311 ) but parser.c is also providing raydium_parser_cut() wich can do the deal in a clean and portable way, I think.

Quote:
I thought Mania Drive was ready for release when I tested it 2 months ago, I don't see why you're so in a hurry now ; Do as you want but I find sad to give up API's clarity for schedule proposes.

Let me explain: releasing a game (I already did it for NewSkyDiver) is a loooong task. To give you an idea, I'm on this since 2 (almost full) days, testing (I must test [and finish] all modes each time, under both OS), making archives, uploading it, refresh ManiaDrive website, write for news sites, supporting the game (bug reports) ... And my hollidays will finish this week-end. That's why I want to go quick :)
FYI, you're right : ManiaDrive was ready during LinuxFr beta test (but you proxy support). But tracks were not :) (and it's long too !)


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


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