Angband Forums

Angband Forums (http://angband.oook.cz/forum/index.php)
-   Development (http://angband.oook.cz/forum/forumdisplay.php?f=10)
-   -   Trying to understand the Angband 3.X source code (http://angband.oook.cz/forum/showthread.php?t=3276)

nppangband June 1, 2010 17:53

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.

PowerDiver June 1, 2010 18:45

Are you #including ui-menu.h ?

nppangband June 1, 2010 19:28

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.

nppangband June 2, 2010 00:45

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.

PowerDiver June 2, 2010 00:48

Quote:

Originally Posted by nppangband (Post 34366)
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.

ui-event.h

I guess it looks a little different since the def is at the end of a struct statement.

Nick June 2, 2010 03:13

Quote:

Originally Posted by nppangband (Post 34341)
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).

Excellent :)

nppangband June 2, 2010 03:14

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.

Pete Mack June 2, 2010 07:01

@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)

nppangband June 2, 2010 15:08

@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.

nppangband June 2, 2010 15:10

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?


All times are GMT +1. The time now is 06:12.

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