intfiction.org

The Interactive Fiction Community Forum
It is currently Fri Oct 19, 2018 9:40 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Thu Jul 19, 2018 10:53 am 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:48 pm
Posts: 1028
Location: Greece
The custom makefile build system in frotz is rather unfortunate. I wanted to add a better sound backend to frotz, but the current build system really gets in the way of working on the code.

I'd like to replace the custom makefiles with a CMake implementation. Before doing the work however, I'd like to ask whether this is actually wanted.

_________________
@realnc


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Jul 19, 2018 7:54 pm 
Offline
User avatar

Joined: Mon Dec 12, 2011 7:03 pm
Posts: 557
Location: Washington
I looked at using CMake for Frotz and came away with the conclusion that it's too complicated for what it would do for Frotz and would cause problems for building on old systems. What sort of sound backend are you thinking of? My project to hire Mark McCurry was derailed by a death in the family. I'm working right now to get that back on track.

_________________
David Griffith


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Jul 19, 2018 7:56 pm 
Offline
User avatar

Joined: Wed Oct 14, 2009 4:02 am
Posts: 2537
I've only just started using CMake, but I'd say go ahead. It's not like it prohibits the classic Makefile from being used by those who'd prefer it.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Jul 20, 2018 5:59 am 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:48 pm
Posts: 1028
Location: Greece
DavidG wrote:
I looked at using CMake for Frotz and came away with the conclusion that it's too complicated for what it would do for Frotz and would cause problems for building on old systems. What sort of sound backend are you thinking of? My project to hire Mark McCurry was derailed by a death in the family. I'm working right now to get that back on track.

I was looking at the different sound systems currently in frotz, and it has three of them. Two for curses (libao and plain OSS) and one for sfrotz (based on SDL_mixer.) I was thinking about replacing all three with just one that is used for both frotz and sfrotz, and uses SDL (in audio-only mode in the case of curses frotz and possibly dfrotz.) This would also get rid of SDL_mixer, which is rather limited and can't play multiple audio streams at the same time. OSS support would be handled automatically by SDL.

I wrote some audio code for my own projects, which I extracted into a small library a couple years ago and I would just import that into frotz. It's a rather thin layer on top of the underlying decoding libraries (like libvorbisfile) and automates mixing and resampling. It can play audio streams directly from within other files (no need to extract "chunks" from blorb files and such) using SDL's RWops. Basically you just point it to something and call play():

https://realnc.github.io/SDL_audiolib/

(A "hello world" example is at the bottom of that page.)

However, it's a C++14 library, and since you mentioned you intend to support very old systems, I now am not sure if this is actually something that can be added to frotz.

If you think it can be added nonetheless (as a replacement for sfrotz's audio system only, and as an option for curses frotz and dfrotz) it's certainly possible to keep using a handwritten Makefile. It's just that it's difficult to work with. Not that CMake is a prime example of good design, mind you :P It's more like something people have to use rather that something they want to use.


Dannii wrote:
I've only just started using CMake, but I'd say go ahead. It's not like it prohibits the classic Makefile from being used by those who'd prefer it.

That would mean two separate build systems have to be maintained. That's not something I would recommend.

_________________
@realnc


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Jul 20, 2018 6:34 pm 
Offline
User avatar

Joined: Mon Dec 12, 2011 7:03 pm
Posts: 557
Location: Washington
RealNC wrote:
DavidG wrote:
I looked at using CMake for Frotz and came away with the conclusion that it's too complicated for what it would do for Frotz and would cause problems for building on old systems. What sort of sound backend are you thinking of? My project to hire Mark McCurry was derailed by a death in the family. I'm working right now to get that back on track.

I was looking at the different sound systems currently in frotz, and it has three of them. Two for curses (libao and plain OSS) and one for sfrotz (based on SDL_mixer.) I was thinking about replacing all three with just one that is used for both frotz and sfrotz, and uses SDL (in audio-only mode in the case of curses frotz and possibly dfrotz.) This would also get rid of SDL_mixer, which is rather limited and can't play multiple audio streams at the same time. OSS support would be handled automatically by SDL.

I wrote some audio code for my own projects, which I extracted into a small library a couple years ago and I would just import that into frotz. It's a rather thin layer on top of the underlying decoding libraries (like libvorbisfile) and automates mixing and resampling. It can play audio streams directly from within other files (no need to extract "chunks" from blorb files and such) using SDL's RWops. Basically you just point it to something and call play():

https://realnc.github.io/SDL_audiolib/

(A "hello world" example is at the bottom of that page.)

However, it's a C++14 library, and since you mentioned you intend to support very old systems, I now am not sure if this is actually something that can be added to frotz.

If you think it can be added nonetheless (as a replacement for sfrotz's audio system only, and as an option for curses frotz and dfrotz) it's certainly possible to keep using a handwritten Makefile. It's just that it's difficult to work with. Not that CMake is a prime example of good design, mind you :P It's more like something people have to use rather that something they want to use.


I removed the OSS code because it rapidly became unworkable when I tried to extend it to MOD and OGG playback. I did implement audio output for the curses interface using SDL, but I decided not to merge it to the main branch because of all the subdependencies it requires. Again, this goes with my mission of making sure Frotz works on old hardware. Libao is much nicer in that regard and will interface with whatever lower-level audio subsystem is available.

One of the old platforms I'm particularly fond of is 32-bit Sparc workstations running SunOS. I'm not clear how or if SDL can be run there, but libao can. I'll see what the cctalk mailing list has to say.

RealNC wrote:
Dannii wrote:
I've only just started using CMake, but I'd say go ahead. It's not like it prohibits the classic Makefile from being used by those who'd prefer it.

That would mean two separate build systems have to be maintained. That's not something I would recommend.


That's why I'm not keen to implement CMake for Frotz.

_________________
David Griffith


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Jul 21, 2018 2:20 pm 
Offline
User avatar

Joined: Tue Apr 20, 2010 2:48 pm
Posts: 1028
Location: Greece
DavidG wrote:
One of the old platforms I'm particularly fond of is 32-bit Sparc workstations running SunOS. I'm not clear how or if SDL can be run there, but libao can. I'll see what the cctalk mailing list has to say.

It's unlikely that this platform has a compiler available that can compile modern C++ code anyway.

_________________
@realnc


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 5 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:  
Powered by phpBB® Forum Software © phpBB Group