-
Notifications
You must be signed in to change notification settings - Fork 26
added several new functions to nwnx_areas. added new hexdump utility. #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…routine to nwn2 lib. - plugins/areas/nwnx_areas.nss - added GetAreaTileset, GetAreaHeight, GetAreaWidth, GetAreaLighting, GetNoRest, Set/GetAreaListenMod, Set/GetAreaSpotMod, DumpArea - plugins/areas/NWNXAreas.cpp - integrated above functions - plugins/areas/area_info.h - support structure for area info output routines - plugins/areas/NWNXAreas.h - include area_info.h - plugins/areas/funcs/GetAreaHeight.cpp - implementation of above-named function - plugins/areas/funcs/GetAreaLighting.cpp - implementation of above-named function - plugins/areas/funcs/GetAreaListen.cpp - implementation of above-named function - plugins/areas/funcs/GetAreaSpot.cpp - implementation of above-named function - plugins/areas/funcs/GetAreaTileset.cpp - implementation of above-named function - plugins/areas/funcs/GetAreaWidth.cpp - implementation of above-named function - plugins/areas/funcs/GetNoRest.cpp - implementation of above-named function - plugins/areas/funcs/SetAreaListen.cpp - implementation of above-named function - plugins/areas/funcs/SetAreaName.cpp - implementation of above-named function - plugins/areas/funcs/SetAreaSpot.cpp - implementation of above-named function - plugins/areas/funcs/DumpArea.cpp - dump an area structure to log file - plugins/areas/funcs/Funcs.h - advance declarations for above functions - plugins/areas/CMakeLists.txt - added above files - plugins/funcs/funcs/area/f_GetFirstNextArea.c - fastidious variable declaration to avoid compile-time warnings - plugins/funcs/funcs/other/f_DumpObject.c - updated to output more intelligent header and use new hexdump utility - CMakeLists.txt - added hexdump to lib - lib/hexdump.c - new hexdump utility - include/hexdump.h - required for linkage to new hexdump utility
new functions: GetAreaLoadscreen(), GetAreaPVP(), GetTileAtLocation() new structure: tile_info.h updates to area_info.h, DumpArea().
| # - no-omit-frame-pointer: breaks assembly on -O1/-O2 for some plugins | ||
| # - no-accumulate-outgoing-args: same | ||
| SET(OUR_CFLAGS_MUST_HAVES "${OUR_CFLAGS_MUST_HAVES} -mno-accumulate-outgoing-args -fno-omit-frame-pointer -fno-pic") | ||
| SET(OUR_CFLAGS_MUST_HAVES "${OUR_CFLAGS_MUST_HAVES} -mno-accumulate-outgoing-args -fno-omit-frame-pointer") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This removes flags that were added recently. Seems like an unintentional change. Can you revert this?
| area_info.h | ||
| this structure details the information contained in the nwn in-memory | ||
| area structure. it differs from CNWSArea in that this structure is | ||
| complete, whereas CNWSArea contains data starting only from offset 0xd4. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CNWSArea inherits from superclasses, so their fields precede CNWSArea fields and run until 0xd4. This is expected.
| # removes stuff like -fPIC, which breaks nwnx plugin loading | ||
| set(CMAKE_SHARED_LIBRARY_C_FLAGS "") | ||
| set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "") | ||
| set(CMAKE_POSITION_INDEPENDENT_CODE FALSE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
| #include "../NWNXAreas.h" | ||
| #include "hexdump.h" | ||
|
|
||
| void dump_area(struct area_info *ap) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it a separate method from NWNXDumpArea?
| areas.Log(0, "dump_area: DUMP ENDS ----------------\n"); | ||
| } | ||
|
|
||
| void NWNXDumpArea(void *pModule, dword areaId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implementation uses custom structs instead of the API, while nwnx_areas has been updated to use the new API, and also it's mostly for debug purposes.
I think it should go into nwnx_funcs, with the other object dump function.
|
Victor Babenko wrote:
***@***.**** requested changes on this pull request.
[snip]
This removes flags that were added recently. Seems like an unintentional
change. Can you revert this?
no problem. the change was intentional, and seemed to resolve the issue, but i'll search for other possible reasons.
|
|
Victor Babenko wrote:
CNWSArea inherits from superclasses, so their fields precede CNWSArea
fields and run until 0xd4. This is expected.
yes, i understand that, but there's a major problem with that approach : it makes half the area data unavailable. i.e., there are vital data specific to areas only [and not other objects] which appear even starting from 0x04 -- well before the area object begins. for this reason, trying to get the data from the CNWSArea object got from the game object won't work. is there a different class you'd prefer that i use ?
In plugins/areas/funcs/DumpArea.cpp
[snip]
+#include "../NWNXAreas.h"
+#include "hexdump.h"
+
+void dump_area(struct area_info *ap)
Why is it a separate method from NWNXDumpArea?
i wanted the actual dump routine to be available to other routines that might be written in the future, which could call it with a more-obvious area pointer. since NWNXDumpArea is the neverscript entry point and therefore expects other parameters, it seemed clearer to me to do it this way. if you don't think there'd be any use for such a routine, of course i can put everything in NWNXDumpArea. let me know which you want.
In plugins/areas/funcs/DumpArea.cpp
[snip]
This implementation uses custom structs instead of the API, while
nwnx_areas has been updated to use the new API, and also it's mostly for
debug purposes.
I think it should go into nwnx_funcs, with the other object dump function.
i'd be happy to move the dump routine to nwnx_funcs, but there's just one small hitch : all of the new area routines i wrote depend on the new struct, not just the dump routine. so i'd also have to do one of the following :
- move all of the other new area routines into nwnx_funcs too
- move area_info.h into ~/include/structs and include in all.h.
- delete NWNXDumpArea+dump_area completely. [since, as you surmised, it is mainly for debugging anyway]
which would you prefer ?
|
this pull request SUPERSEDES pull request #127. it is functionally identical to #127, but solves the dev conflicts that arose due to my taking so long on this. there should now be no conflicts w/dev work done by other contributors. please DISREGARD pull request #127 and use this one in its place.
sorry about the mix-up !
=== details ===