0
-/* Copyright (c) Daniel Thaler, 2006
*/
0
+/* Copyright (c) Daniel Thaler, 2006
, 2008 */
0
/* NetHack may be freely redistributed. See license for details. */
0
@@ -21,12 +19,8 @@ extern "C" {
0
#include "func_tab.h" /* For extended commands list */
0
#define TRAVEL_HACK /* XXX This is to be removed once Slash'EM (NetHack?) fixes the problem of infinite loops */
0
@@ -142,7 +136,6 @@ void vultures_init_nhwindows(int *argcp, char **argv)
0
/* try to chdir to our datadir */
0
vultures_chdir_to_datadir(argv[0]);
0
if (!vultures_init_graphics())
0
panic("could not initalize graphic mode");
0
@@ -182,7 +175,6 @@ void vultures_init_nhwindows(int *argcp, char **argv)
0
iflags.menu_tab_sep = 1;
0
iflags.wc_hilite_pet = 1;
0
vultures_show_logo_screen();
0
map_data = new mapdata();
0
@@ -190,7 +182,6 @@ void vultures_init_nhwindows(int *argcp, char **argv)
0
new levelwin(map_data);
0
vultures_windows_inited = 1;
0
iflags.window_inited = TRUE;
0
@@ -220,8 +211,7 @@ winid vultures_create_nhwindow(int type)
0
win = new statuswin(vultures_get_window(0));
0
@@ -284,13 +274,10 @@ static void vultures_display_nhmap(struct window * win, vultures_event *result,
0
if (vultures_event_dispatcher_nonblocking(result, NULL))
0
vultures_stop_travelling = 1;
0
vultures_refresh_window_region();
0
@@ -318,8 +305,7 @@ void vultures_display_nhwindow(int winid, BOOLEAN_P blocking)
0
- switch(win->get_nh_type())
0
+ switch(win->get_nh_type()) {
0
if (win->get_wintype() == V_WINTYPE_ENDING) {
0
@@ -382,7 +368,6 @@ void vultures_destroy_nhwindow(int winid)
0
void vultures_start_menu(int winid)
0
window *win = vultures_get_window(winid);
0
@@ -395,9 +380,6 @@ void vultures_start_menu(int winid)
0
if (win->get_nh_type() != NHW_MENU)
0
- /* start menu should never be called on a window that is not a menu */
0
- assert (win->get_wintype() == V_WINTYPE_MENU || win->get_wintype() == V_WINTYPE_OBJWIN);
0
menu = static_cast<menuwin*>(win);
0
@@ -406,7 +388,6 @@ void vultures_start_menu(int winid)
0
/* add an item to a menu that was started with vultures_start_menu */
0
void vultures_add_menu(int winid, int glyph, const ANY_P * identifier,
0
CHAR_P accelerator, CHAR_P groupacc, int attr,
0
@@ -551,14 +532,12 @@ void vultures_raw_print_bold(const char *str)
0
void vultures_putstr(int winid, int attr, const char *str)
0
/* Display error messages immediately */
0
+ if (winid == WIN_ERR) {
0
vultures_messagebox(str);
0
@@ -569,8 +548,7 @@ void vultures_putstr(int winid, int attr, const char *str)
0
* For windows of type NHW_MESSAGE, both the messages
0
* and their send time are stored.
0
- switch (win->get_nh_type())
0
+ switch (win->get_nh_type()) {
0
/* If "what's this" is active,skip the help messages
0
* associated with NetHack's lookat command. */
0
@@ -603,12 +581,8 @@ void vultures_putstr(int winid, int attr, const char *str)
0
-// win->content_is_text = 1; /* Text content */
0
/* Add the new text line as a menu item */
0
-// menuid.a_void = 0; /* Since text lines can't be selected anyway, these can be the same */
0
-// vultures_add_menu(winid, NO_GLYPH, &menuid, 0, 0, ATR_NONE, str, FALSE);
0
- static_cast<menuwin*>(win)->add_menuitem(str, false, NULL, '\0', 0);
0
+ static_cast<menuwin*>(win)->add_menuitem(str, false, NULL, '\0', 0);
0
@@ -730,6 +704,7 @@ void vultures_bail(const char *mesg)
0
/* display a list of extended commands for the user to pick from */
0
int vultures_get_ext_cmd(void)
0
@@ -747,8 +722,7 @@ int vultures_get_ext_cmd(void)
0
/* Add extended commands as menu items */
0
- for (i = 0; extcmdlist[i].ef_txt != NULL; i++)
0
+ for (i = 0; extcmdlist[i].ef_txt != NULL; i++) {
0
/* try to find an accelerator that fits the command name */
0
cur_accelerator = tolower(extcmdlist[i].ef_txt[0]);
0
@@ -761,8 +735,7 @@ int vultures_get_ext_cmd(void)
0
/* cur_accelerator is already used, so find another */
0
cur_accelerator = vultures_find_menu_accelerator(used_accels);
0
/* cur_accelerator is not in use: claim it */
0
used_accels[len] = cur_accelerator;
0
used_accels[len+1] = '\0';
0
@@ -789,7 +762,6 @@ int vultures_get_ext_cmd(void)
0
/* display a file in a menu window */
0
void vultures_display_file(const char *fname, BOOLEAN_P complain)
0
@@ -799,10 +771,8 @@ void vultures_display_file(const char *fname, BOOLEAN_P complain)
0
f = dlb_fopen(fname, "r");
0
+ if (complain == TRUE) {
0
sprintf(tempbuffer, "Can't open file [%s].\n", fname);
0
vultures_messagebox(tempbuffer);
0
@@ -858,8 +828,7 @@ void vultures_delay_output(void)
0
/* the time it took to draw the map is subtracted from the delay time;
0
* this allows the game to adapt to slow-drawing systems (ie unaccelerated
0
* software graphics) */
0
- if (vultures_map_draw_lastmove == moves)
0
+ if (vultures_map_draw_lastmove == moves) {
0
delay -= vultures_map_draw_msecs;
0
@@ -868,8 +837,7 @@ void vultures_delay_output(void)
0
/* delay in small increments and run the eventloop in between */
0
starttick = SDL_GetTicks();
0
if (vultures_event_dispatcher_nonblocking(&result, NULL))
0
@@ -877,8 +845,7 @@ void vultures_delay_output(void)
0
endtick = SDL_GetTicks();
0
elapsed = endtick - starttick;
0
SDL_Delay(10 - elapsed);
0
@@ -911,8 +878,7 @@ char vultures_message_menu(CHAR_P let, int how, const char *mesg)
0
void vultures_curs(winid window, int x, int y)
0
/* allow selecting a position via keyboard for look and teleport (both set vultures_whatis_active) */
0
- if (window == WIN_MAP && vultures_whatis_active)
0
+ if (window == WIN_MAP && vultures_whatis_active) {
0
mappos.x = x; mappos.y = y;
0
@@ -920,8 +886,7 @@ void vultures_curs(winid window, int x, int y)
0
/* move the viewport when the mouse approaches the edge */
0
if (mouse.x < 50 || mouse.x > (vultures_screen->w-50) ||
0
- mouse.y < 50 || mouse.y > (vultures_screen->h-50))
0
+ mouse.y < 50 || mouse.y > (vultures_screen->h-50)) {
0
levwin->set_view(x, y);
0
/* calculate the new mouse position */
0
@@ -940,22 +905,18 @@ void vultures_get_nh_event(void)
0
static point lastpos[2] = {{-1,-1}, {-1,-1}};
0
/* if the positon 2 turns ago is identical to the current position,
0
* the travel algorithm has hung and travel needs to be canceled */
0
if (vultures_stop_travelling ||
0
((lastpos[1].x != lastpos[0].x || lastpos[1].y != lastpos[0].y) &&
0
- lastpos[1].x == u.ux && lastpos[1].y == u.uy))
0
+ lastpos[1].x == u.ux && lastpos[1].y == u.uy)) {
0
lastpos[0].x = lastpos[1].x = -1;
0
lastpos[1] = lastpos[0];
0
@@ -968,8 +929,6 @@ void vultures_get_nh_event(void)
0
/*******************************************************
0
*******************************************************/
0
@@ -986,8 +945,7 @@ int vultures_find_menu_accelerator(char *used_accelerators)
0
/* Pick any available letter from [a-zA-Z] */
0
- for (i = 0; i < strlen(acclist); i++)
0
+ for (i = 0; i < strlen(acclist); i++) {
0
cur_accelerator = acclist[i];
0
@@ -998,8 +956,7 @@ int vultures_find_menu_accelerator(char *used_accelerators)
0
/* Add found accelerator to string of used ones (assume there's enough room) */
0
j = strlen(used_accelerators);
0
used_accelerators[j] = cur_accelerator;
0
@@ -1010,7 +967,6 @@ int vultures_find_menu_accelerator(char *used_accelerators)
0
/*******************************************************
0
* unsupported/unnecessary functions of the nethack api
0
*******************************************************/
0
@@ -1036,5 +992,3 @@ void vultures_cliparound(int x, int y) {}
0
void vultures_update_positionbar(char *features) {}
I will be going through the source code and removing all copyright, vulture’s is copyleft not copyright
references to licence (nethack public licence): yes copyright: no
You’re welcome to add “authored by” but copyright I don’t think so, vulture’s is public domain and does not belong to any one person (?). I’m not a lawyer but copyrights do scare me ;)