You should probably try to base it on the stable branch if you can at this point
Thanks for the advice WMCoolmon, I will do that...
I've just completed porting
HUDbrackets to
CHUDBrackets, and after doing so I have a few questions. I think Backslash will be in the best positing to answer, but If anyone else can give some input it will be much appreciated.
In
HUDBrackets, in the function
hud_target_show_dist_on_bracket(int x, int y, float distance) there is a line:
displayed_distance = distance * Hud_unit_multiplier;
Now
Hud_unit_multiplier is declared in
hudparse.cpp, and not in
hudparse.h, and
HUDbrackets includes
neither of these files.
By what voodoo magic is this variable visible?
There is something even more curious in
HUDbrackets, a function definition standing by itself:
int num_ships_attacking(int target_objnum);
but this function is again declared in
AiCode.cpp, this time with an implementation.
In
HUDbrackets in a function called
draw_bounding_bracketsthe function above is actually called in the line:
//Maybe show + for each additional fighter or bomber attacking target.
if ( (target_objnum != -1) && hud_gauge_active(HUD_ATTACKING_TARGET_COUNT) ) {
int num_attacking = num_ships_attacking(target_objnum);
}
Now, this line seems pointless because as far as I can see it is going to use the definition of
num_ships_attacking that is defined in
HUDbrackets, which as you can see has no implementation whatsoever.
Furthermore, it bothers me that
AiCode.cpp does not have a header file? How is it ever used?
I hope someone can shed some light on these issues.
Many thanks
Samuel
P.S. The code seems to be littered with magic variables and functions like the ones I mentioned above. Is it perhaps an abuse of #includes?