Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old March 27, 2016, 14:33   #71
calris
Adept
 
Join Date: Mar 2016
Posts: 194
calris is on a distinguished road
Quote:
Originally Posted by takkaria View Post
Putting an ifdef around the sound support has the side effect of producing parser errors when no sound module is present. I think there's two solutions; either split the sound config parsing from the pref parser, or put a stub in the ui-prefs file. To me the former looks cleaner and avoids putting the internal state of the pref parser in a header file but YMMV.
As in we get errors when we hit 'sound:' lines I'm assuming?

I never see any myself. Where do they get displayed?

EDIT: OK, I see it now - didn't seem to care about it in the main init, but if you include sound: in a user .prf file it complains.

I'm not a fan of splitting out processing of the sound.prf file. And I like the idea that you can just include sound: directives in a user .prf file (makes developing and testing new sounds much easier).

But I also don't like the idea of the parser having to know about the 'sound' directive.

Mmmmm

EDIT: I defined a 'dummy' parser and if SOUND is not defined, an inline function in sound.h tells the parser to use the dummy function for lines starting with sound:

Last edited by calris; March 27, 2016 at 15:24.
calris is offline   Reply With Quote
Old March 27, 2016, 18:08   #72
molybdenum
Apprentice
 
Join Date: May 2013
Posts: 84
molybdenum is on a distinguished road
OS X's sound loading/config parsing happens in load_sounds() at main-cocoa.m:2660. I don't know when the load sound hook is called, but it's likely not at a great time for the OS X port to do something like that (due to memory model and other launch stuff).
molybdenum is offline   Reply With Quote
Old March 27, 2016, 22:09   #73
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,731
Donated: $60
Nick is on a distinguished road
Now compiles cleanly for Linux (although birth tests fail) and OS X, Windows only has one missing #include, by the looks:
Code:
In file included from ./ui-prefs.h:25:0,
                 from win/win-layout.c:21:
./ui-keymap.h:60:18: error: unknown type name ‘ang_file’
 void keymap_dump(ang_file *fff);
                  ^
Makefile.win:134: recipe for target 'win/win-layout.o' failed
Looks like you guys are doing a great job in this thread, I'm happy to be the monkey that runs the autobuilder
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is online now   Reply With Quote
Old March 28, 2016, 03:24   #74
calris
Adept
 
Join Date: Mar 2016
Posts: 194
calris is on a distinguished road
Quote:
Originally Posted by Nick View Post
Now compiles cleanly for Linux (although birth tests fail)
How do I run the tests?
calris is offline   Reply With Quote
Old March 28, 2016, 03:29   #75
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,731
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by calris View Post
How do I run the tests?
You have to have configured with --enable-test, then
Code:
./run-tests
for birth tests,
Code:
make tests
for unit tests.

If you're interested in writing unit tests for any of your work (which is encouraged, but more honoured in the breach), there's a README in src/tests.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is online now   Reply With Quote
Old March 28, 2016, 04:10   #76
calris
Adept
 
Join Date: Mar 2016
Posts: 194
calris is on a distinguished road
Quote:
Originally Posted by Nick View Post
You have to have configured with --enable-test, then
Code:
./run-tests
for birth tests,
OK - so how do I figure out why the tests failed. And did they fail before my work on the sound modules (not sure how my work could impact in birth)
calris is offline   Reply With Quote
Old March 28, 2016, 04:25   #77
calris
Adept
 
Join Date: Mar 2016
Posts: 194
calris is on a distinguished road
And what are the opinions regarding #include in .h files?

The Windows build error is due to win-layout.c needing ui-keymap.h which needs ang_file which is defined in z-file.h

ui-keymap.h does not have any #includes, but I notice others, like ui-prefs.h, do.

I like to include any necessary headers in headers that need them, but I've worked with people that think this is a bad idea (I think mainly for dependency tracking).

My argument (and the argument of a lot of developers) is that if you add functionality to some code that needs definitions in foo.h then you should only ever need to #include fooh. - foo.h will #include everything foo.h needs in order to compile.
calris is offline   Reply With Quote
Old March 28, 2016, 04:32   #78
calris
Adept
 
Join Date: Mar 2016
Posts: 194
calris is on a distinguished road
Quote:
Originally Posted by Nick View Post
Windows only has one missing #include, by the looks:
Code:
In file included from ./ui-prefs.h:25:0,
                 from win/win-layout.c:21:
./ui-keymap.h:60:18: error: unknown type name ?ang_file’
 void keymap_dump(ang_file *fff);
                  ^
Makefile.win:134: recipe for target 'win/win-layout.o' failed
Added #include "z-file.h" to ui-keymap.h to resolve this

Also fixed an oversight with the new handling of supported file type hook

Pushed to sound-devel

I think I'm getting closer to the finish line - When we are all happy, I will trash sound-devel and develop a better set of patches that apply the changes incrementally, somthing like:
- Add sound-core
- Migrate Linux sound
- Migrate Windows sound
calris is offline   Reply With Quote
Old March 28, 2016, 04:47   #79
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,731
Donated: $60
Nick is on a distinguished road
Quote:
Originally Posted by calris View Post
OK - so how do I figure out why the tests failed. And did they fail before my work on the sound modules (not sure how my work could impact in birth)
I've been wondering the same thing recently - unit tests are in src/tests/bin/whatever and can be run with gdb, but I'm not sure how to debug an individual birth test. Maybe someone else knows.
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.
Nick is online now   Reply With Quote
Old March 28, 2016, 04:52   #80
calris
Adept
 
Join Date: Mar 2016
Posts: 194
calris is on a distinguished road
Quote:
Originally Posted by Nick View Post
I've been wondering the same thing recently - unit tests are in src/tests/bin/whatever and can be run with gdb, but I'm not sure how to debug an individual birth test. Maybe someone else knows.
OK, looks like the birth test creates a new character, and tests that, at the end of the test, it is Level 1 with the same race and class specified by the test. Really not sure how it could fail TBH
calris is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reworking the entire magic system (yay)! TricksterWolf Development 8 September 20, 2015 20:22
Mk build system? CJNyfalt Development 11 March 25, 2015 07:25
Resist system Jungle_Boy Development 65 August 30, 2011 03:10
Combat System Sirridan Development 9 July 14, 2009 07:11
RFC: Middle Earth map for Un in ASCII; is it readable? Bandobras Variants 13 November 25, 2007 03:15


All times are GMT +1. The time now is 01:04.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.