Requiring C99 means dropping support for both MSVC (C89 compiler only) and native MingW32 (recent standard header releases don't compile as C99).
Trying to understand the Angband 3.X source code
Collapse
X
-
Zaiband: end the "I shouldn't have survived that" experience. V3.0.6 fork on Hg.
Zaiband 3.0.10 ETA Mar. 7 2011 (Yes, schedule slipped. Latest testing indicates not enough assert() calls to allow release.)
Z.C++: pre-alpha C/C++ compiler system (usable preprocessor). Also on Hg. Z.C++ 0.0.10 ETA December 31 2011 -
I have a bug that should be simple to fix, but I don't know where to do it.
The game crashes if I use the up, down, left, or right direction keys on my keyboard without the numlock on, but the diagonal direction keys work fine. It crashes on this line, in textui_process_command.
assert(p_ptr->command_cmd >= CHAR_MIN && p_ptr->command_cmd <= CHAR_MAX);
If the numlock is on, the p_ptr->command is 59, and if numlock is off, the direction keys are between 138-141, and the game crashes. Again, the diagonal keys work fine either way
Isn't there a pref file that converts certain keyboard commands like this? I know the 138 is above the 127 limit, but I can't figure out why it would be crashing the game. I have assert.h declared in h-basic.h just like in Angband.
Any thoughts or suggestions? I am stumped. Thanks.NPPAngband current home page: http://nppangband.bitshepherd.net/
Source code repository:
https://github.com/nppangband/NPPAngband_QT
Downloads:
https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57Comment
-
assert(p_ptr->command_cmd >= CHAR_MIN && p_ptr->command_cmd <= CHAR_MAX);
If the numlock is on, the p_ptr->command is 59, and if numlock is off, the direction keys are between 138-141, and the game crashes. Again, the diagonal keys work fine either way
Isn't there a pref file that converts certain keyboard commands like this? I know the 138 is above the 127 limit, but I can't figure out why it would be crashing the game. I have assert.h declared in h-basic.h just like in Angband.
If I understand assert correctly, that is what it does - if the condition is not satisfied, it terminates the program.
Good luckOne for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.Comment
-
Thanks! With that help I found it. Strangely, utting in the updated pref-win.prf fromthe current angband into NPP causes the crashes. If I keep the current one from NPPAngband it works fine.NPPAngband current home page: http://nppangband.bitshepherd.net/
Source code repository:
https://github.com/nppangband/NPPAngband_QT
Downloads:
https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57Comment
-
I saw the question in Nick's thread first, ( http://angband.oook.cz/forum/showthread.php?t=3004), but here is the answer:
For NPP 0.5.0, I am not sure. But very soon, the answer will be a definite yes.
I have an updated version coming out that updates the core of NPP from Angband 3.0.6 to the current Angband 3.1.2v2 beta. It won't have all of the features yet, but it will have all of the updated makefiles, main-xxx files, mouse support, the improved Angband UI and all of the core files that make Angband run. That that point, anything that can compile the current Vanilla should compile NPP as well.
My target for releasing a beta is August 1. I am actually almsot done now, but I have a project at work that is going to keep me busy for the next two weeks. I want to hold off the beta release until I actually will have time to fix the problems people discover.NPPAngband current home page: http://nppangband.bitshepherd.net/
Source code repository:
https://github.com/nppangband/NPPAngband_QT
Downloads:
https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57Comment
-
I'm really glad that you're bringing the codebase in line with current V, since it's only fair to say that Andi and co. have implemented some really nice features. I'm glad NPP is still actively under development, and look forward to the results.Comment
-
Thanks. Implementing the Vanilla changes is long overdue. After more than a decade of minimal changes in Vanilla, I think it is more active than most variants. I just hope I have the time to keep up with them.NPPAngband current home page: http://nppangband.bitshepherd.net/
Source code repository:
https://github.com/nppangband/NPPAngband_QT
Downloads:
https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57Comment
-
This is a quick question for the Angband maintainers. I just need to confirm how often store_display_entry is called.
The reason I ask is that in NPP, due to store services or quild rewards, charisma can change while a person is in the store (restore stat, increase stat, and sometimes a quest reward are stat increases.
I guess the player's charisma can change in Angabnd as well, if they take off or wield equipment. Do these lines (at the end of store_process_command) assure that inventory and prices re-drawn in the store?
Thanks.
event_signal(EVENT_INVENTORY);
event_signal(EVENT_EQUIPMENT);NPPAngband current home page: http://nppangband.bitshepherd.net/
Source code repository:
https://github.com/nppangband/NPPAngband_QT
Downloads:
https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57Comment
-
I guess the player's charisma can change in Angabnd as well, if they take off or wield equipment. Do these lines (at the end of store_process_command) assure that inventory and prices re-drawn in the store?
event_signal(EVENT_INVENTORY);
event_signal(EVENT_EQUIPMENT);
The event handlers are reigstered in src/xtra3.c if you want to see what they do.Comment
-
Thanks. I tested it, and although I am not sure what code triggers it (something in ui-menu.c), but the game does re-price everything and re-draw all of the prices if the player's charisma changes when they are inside the store.NPPAngband current home page: http://nppangband.bitshepherd.net/
Source code repository:
https://github.com/nppangband/NPPAngband_QT
Downloads:
https://app.box.com/s/1x7k65ghsmc31usmj329pb8415n1ux57Comment
-
OK, I agree the current store.c event loop is a bit confusing.
I cleaned it up a bit.
diff is attached.
Edit:
Reloaded, to get rid of annoying flicker on double-tap (existing bug)
Edit:
There's a bug in this-- more prompt is not working for lists too long by one.Attached FilesLast edited by Pete Mack; July 11, 2010, 05:21.Comment
-
@Jeff--
One other thing.
In cleaning up store.c, I recalled another trivial change I made ~3.0.8: adding type union
Code:%y
It makes complicated formatting like files.c a lot easier. Unfortunately, it's not useful when you want to do formatted text with mixed colors.
I added some really hacky support for multiple colors in files.c -- display_panel
It makes formatting character info much easier, but it does not generalize.
...
In fact, let me whip something up... TBC in a week or so.Comment
Comment