DavidGriffith / frotz

Infocom-style interactive fiction player for Unix and DOS (moved to https://gitlab.com/DavidGriffith/frotz)
GNU General Public License v2.0
209 stars 64 forks source link

SDL #67

Closed tkorvola closed 6 years ago

tkorvola commented 6 years ago

SDL Frotz now builds and runs again. It gets built by default along with curses and dumb. Of course you then need SDL, SDL_mixer, libpng, libjpeg, freetype2, libz and pkgconfig. The code compiles without warnings with current CFLAGS. I removed -Wextra because I think it produces too many false positives for regular use (I also went from gnu99 to c99 plus some POSIX).

There used to be some documentation by Aldo Cumani. It has been removed but fortunately Git remembers. Not knowing the reason for removal I have not restored it, but some documentation would definitely be appropriate. Anyway, sfrotz reads .sfrotzrc from the current (not home) directory. The syntax is that of a Windows ini file. You can specify fonts, among other things. As a new item you can specify a scalable graphics font. You should either should do so (anyone up to drawing us a nice one?) or not change any monospace fonts. The graphics font must be scaled to fit monospace text and we don't have a general bitmap scaler (unlike Winfrotz). Feel free to play with the proportional fonts though. They should not have ridiculously disparate size from monospace (16 pixels for the built-in font) but don't have to be an exact match.

Much of the code is rather ugly and there is plenty of room for improvement, e.g., window resizing. But it is a somewhat portable interpreter with graphics and sound.

DavidGriffith commented 6 years ago

Nice! I've been playing with porting sfrotz back into Unix Frotz for a few months off and on, but I didn't get as far as this.

Did you forget to add src/sdl/generic.h? The build is complaining about implicit declarations and I think the function prototypes it wants are there.

So I created generic.h with those missing prototypes and moved #include "sf_frotz.h" above #include "generic.h" to get it to compile. Would you please add and commit your version so we can keep both of our repos clean?

tkorvola commented 6 years ago

Oops, sorry about the missing generic.h. There you go. No need to change the include order: I prefer every header to include what it needs instead of .c files having to worry about that. That requires include guards though.

DavidGriffith commented 6 years ago

I rebased your changes to introduce generic.c and generic.h where I suppose they should have first appeared. I left alone the order of header files. Looks good so far. Now for some cleanup.

Thanks!