![]() |
#1 |
NPPAngband Maintainer
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 926
![]() |
Trying to understand the Angband 3.X source code
This weekend I began the project of trying to update the NPP source code with as much of the Andi Sidwell era development as possible (NPP is currently based on Angband 3.0.6, the last RR version).
My first attempt is to get the stores to interact like they do in the current Angband. I didn't get very far. I incorporated most of the updates in store.c, but my compiler (lcc-win32) gives more than a screenful errors for the display related functions, like this one: static void store_display_entry(menu_type *menu, int oid, bool cursor, int row, int col, int width) I added the ui-event.c and ui-menu.c to the build, along with the helper files listed in store.c, and now I get pagefuls of compile errors from those files instead. I am clearly missing a major section of code that need to be worked into my project, but I can't tell what it is. Is there anyone out there who can give me any guidance on this? Thanks. |
![]() |
![]() |
![]() |
#2 |
Prophet
Join Date: Mar 2008
Posts: 2,712
![]() |
Are you #including ui-menu.h ?
|
![]() |
![]() |
![]() |
#3 |
NPPAngband Maintainer
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 926
![]() |
Yes, I included that. I made sure all of the .h files at the top of Angband's current store.c are included. Now they are giving me pages and pages of error messages.
I was wondering if I have to include all the changes in main-win.c as well, or if that is completely unrelated. I probably also need to try to compile Angband with lcc-win as well. There used to be instructions for it. Maybe that compiler can't do it any more. |
![]() |
![]() |
![]() |
#4 |
NPPAngband Maintainer
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 926
![]() |
I found most of the problem, I was missing ui.h.
The final compile error I get is for any code related to "ui_event_data". I grepped the angband source code, and I cannot find where this is defined. Thanks to anyone who can help with this. |
![]() |
![]() |
![]() |
#5 | |
Prophet
Join Date: Mar 2008
Posts: 2,712
![]() |
Quote:
I guess it looks a little different since the def is at the end of a struct statement. |
|
![]() |
![]() |
![]() |
#6 | |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 57
Posts: 9,426
Donated: $60
![]() ![]() |
Quote:
![]()
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
|
![]() |
![]() |
![]() |
#7 |
NPPAngband Maintainer
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 926
![]() |
Thanks! I wasn't sure that was it, because I had it included in ui-menu.c. But once I included it in z-term.h as well, it compiled.
Of course getting it to compile and getting it to work are two completely different things, but that's a good first step. |
![]() |
![]() |
![]() |
#8 |
Prophet
Join Date: Apr 2007
Location: Seattle, WA
Posts: 6,703
Donated: $40
![]() |
@jeff [nppangband] --
If you have questions about the menu code, let me know. I wrote the menu event model 2 or 3 years back, along with the big refactoring of cmd4.c (now cmd-know.c) The menu code you can live without. The cmd4.c stuff you will certainly want. (npp 5 still uses the original crazy non-relational knowledge model.) You can get standalone cmd4.c from unangband if you don't want to port all your menu code. The menu code is useful only if you want small-screen and/or mouse support. If you do want small-screen support, you will also need to port files.c, and get a whole bunch of stuff from Nick (FAAnangband) Last edited by Pete Mack; June 2, 2010 at 07:07. |
![]() |
![]() |
![]() |
#9 |
NPPAngband Maintainer
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 926
![]() |
@Pete - thanks for the offer help me get up to speed on the Angband code. I am going to need it. I am going to try to work things one file at a time....starting with store.c (but now I have to figure out how the menu code works, because I have to change the Angband store.c code so it handles NPPAngband's store services and the adventurer's guild quests. Next will come birth.c, which should be easier.
After that, I want to get the new main-win.c to work with NPP. I don't know what to do about the other operating systems (MAC and Linux). I can look at the new main*.c files and change things I know need to be changed for NPP, but I can't compile or test it. The new makefiles make absolutely no sense to me (they don't list the individual files, so I can't tell if I have to modify them to add the files unique to NPP such as effects.c, quest.c, and terrain.c). Then after all that I will take on updating cmd4.c. It looks like Angband has made alot of good changes, and dropped support for alot of the older operating systems. IMHO that was a good thing, since it allowed Angband to move to a modern open source license. My first goal is to get NPP there too. I seriously debated which would be the bigger project, adding all the new Angband code to NPP, or putting all the NPP changes into the current Angband code. But the changes necessary to add 4gai and UnAngband terrain features are so extensive those two features alone would have made it a bigger task. |
![]() |
![]() |
![]() |
#10 |
NPPAngband Maintainer
Join Date: Dec 2008
Location: Stat Gain, Angband
Posts: 926
![]() |
One quick question (since you mentioned small screen support). Is Angband still married to a default 80x24 screen support?
Has anyone ever decided to make the default screen size a little bit larger? |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Trying to understand Ranger playing mechanics | dormouse | Vanilla | 5 | December 15, 2009 12:43 |
Angband Code Interface to GUI | meeshoo | Vanilla | 50 | February 3, 2009 18:18 |
I finally understand how diving quicker can be "safer" | Wraitheist | Vanilla | 13 | September 19, 2008 18:25 |
strange C code in Angband (am I reading this right?) | will_asher | Idle chatter | 3 | February 4, 2008 10:07 |
Angband source branches vs trac | ctate | Vanilla | 1 | July 14, 2007 12:43 |